From 1f47b46959267a25195d4f3f5602ca638bb14c58 Mon Sep 17 00:00:00 2001 From: Zolnai Tamás Date: Tue, 23 Jul 2013 13:14:53 +0200 Subject: Fix drop caps background Background were shifted upwards with the descent of the character and so the default grey background hanged out under the user added background. Examples: A (no descent), S (small descent) Q (big descent) Change-Id: I044fc63cf9988152e7b6aa4042bcf14651e097c0 --- sw/source/core/text/txtdrop.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sw/source/core/text/txtdrop.cxx b/sw/source/core/text/txtdrop.cxx index d61ca5ce0f19..d708cc67c2c0 100644 --- a/sw/source/core/text/txtdrop.cxx +++ b/sw/source/core/text/txtdrop.cxx @@ -281,9 +281,11 @@ void SwDropPortion::PaintTxt( const SwTxtPaintInfo &rInf ) const const SwDropPortionPart* pCurrPart = GetPart(); const xub_StrLen nOldLen = GetLen(); + const KSHORT nOldAscent = GetAscent(); const SwTwips nBasePosY = rInf.Y(); ((SwTxtPaintInfo&)rInf).Y( nBasePosY + nY ); + ((SwDropPortion*)this)->SetAscent( nOldAscent + nY ); SwDropSave aSave( rInf ); // for text inside drop portions we let vcl handle the text directions SwLayoutModeModifier aLayoutModeModifier( *rInf.GetOut() ); @@ -304,6 +306,7 @@ void SwDropPortion::PaintTxt( const SwTxtPaintInfo &rInf ) const ((SwTxtPaintInfo&)rInf).Y( nBasePosY ); ((SwDropPortion*)this)->SetLen( nOldLen ); + ((SwDropPortion*)this)->SetAscent( nOldAscent ); } /************************************************************************* -- cgit v1.2.3