diff options
-rw-r--r-- | sw/source/core/text/itrtxt.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/text/pormulti.cxx | 23 |
2 files changed, 16 insertions, 11 deletions
diff --git a/sw/source/core/text/itrtxt.cxx b/sw/source/core/text/itrtxt.cxx index c62265e093d8..093927bd49b8 100644 --- a/sw/source/core/text/itrtxt.cxx +++ b/sw/source/core/text/itrtxt.cxx @@ -231,7 +231,9 @@ sal_uInt16 SwTextCursor::AdjustBaseLine( const SwLineLayout& rLine, const sal_uInt16 nRubyHeight = pGrid->GetRubyHeight(); const bool bRubyTop = ! pGrid->GetRubyTextBelow(); - if ( GetInfo().IsMulti() ) + if ( !pGrid->IsSquaredMode() ) + nOfst += ( rLine.Height() - nPorHeight ) / 2 + nPorAscent; + else if ( GetInfo().IsMulti() ) // we are inside the GetCharRect recursion for multi portions // we center the portion in its surrounding line nOfst = ( m_pCurr->Height() - nPorHeight ) / 2 + nPorAscent; diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx index 554dadf254f8..42fba70e6769 100644 --- a/sw/source/core/text/pormulti.cxx +++ b/sw/source/core/text/pormulti.cxx @@ -1256,9 +1256,9 @@ void SwTextPainter::PaintMultiPortion( const SwRect &rPaint, SwTextGridItem const*const pGrid(GetGridItem(m_pFrame->FindPageFrame())); const bool bHasGrid = pGrid && GetInfo().SnapToGrid(); sal_uInt16 nRubyHeight = 0; - bool bRubyTop = false; + bool bRubyTop = true; - if ( bHasGrid ) + if ( bHasGrid && pGrid->IsSquaredMode() ) { nRubyHeight = pGrid->GetRubyHeight(); bRubyTop = ! pGrid->GetRubyTextBelow(); @@ -1273,7 +1273,8 @@ void SwTextPainter::PaintMultiPortion( const SwRect &rPaint, if ( bRubyInGrid ) { GetInfo().SetSnapToGrid( ! bRubyTop ); - rMulti.Height( m_pCurr->Height() ); + if (pGrid->IsSquaredMode()) + rMulti.Height( m_pCurr->Height() ); } SwLayoutModeModifier aLayoutModeModifier( *GetInfo().GetOut() ); @@ -1297,7 +1298,7 @@ void SwTextPainter::PaintMultiPortion( const SwRect &rPaint, GetInfo().DrawViewOpt( rMulti, POR_FLD ); #endif - if ( bRubyInGrid ) + if ( bRubyInGrid && pGrid->IsSquaredMode() ) rMulti.Height( nOldHeight ); // do we have to repaint a post it portion? @@ -1394,7 +1395,7 @@ void SwTextPainter::PaintMultiPortion( const SwRect &rPaint, do { - if ( bHasGrid ) + if ( bHasGrid && pGrid->IsSquaredMode() ) { if( rMulti.HasRotation() ) { @@ -1524,16 +1525,18 @@ void SwTextPainter::PaintMultiPortion( const SwRect &rPaint, } else if ( bHasGrid && rMulti.IsRuby() ) { + GetInfo().SetSnapToGrid( bRubyTop ); GetInfo().X( nTmpX ); - if ( bRubyTop ) + if (pGrid->IsSquaredMode() ) { - nOfst += nRubyHeight; - GetInfo().SetSnapToGrid( true ); + if ( bRubyTop ) + nOfst += nRubyHeight; + else + nOfst += m_pCurr->Height() - nRubyHeight; } else { - nOfst += m_pCurr->Height() - nRubyHeight; - GetInfo().SetSnapToGrid( false ); + nOfst += rMulti.GetRoot().Height(); } } else { |