diff options
Diffstat (limited to 'drawinglayer/source/processor2d/vclprocessor2d.cxx')
-rw-r--r-- | drawinglayer/source/processor2d/vclprocessor2d.cxx | 41 |
1 files changed, 34 insertions, 7 deletions
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx index e49e54fb751c..ca53ae07e916 100644 --- a/drawinglayer/source/processor2d/vclprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx @@ -250,22 +250,49 @@ namespace drawinglayer mpOutputDevice->SetFont(aFont); mpOutputDevice->SetTextColor(Color(aRGBFontColor)); + String aText( rTextCandidate.getText() ); + xub_StrLen nPos = rTextCandidate.getTextPosition(); + xub_StrLen nLen = rTextCandidate.getTextLength(); + + sal_Int32* pDXArray = aTransformedDXArray.size() ? &(aTransformedDXArray[0]) : NULL ; + + if ( rTextCandidate.isFilled() ) + { + basegfx::B2DVector aOldFontScaling, aOldTranslate; + double fOldRotate, fOldShearX; + rTextCandidate.getTextTransform().decompose(aOldFontScaling, aOldTranslate, fOldRotate, fOldShearX); + + long nWidthToFill = rTextCandidate.getWidthToFill( ) * aFontScaling.getX() / aOldFontScaling.getX(); + + long nWidth = mpOutputDevice->GetTextArray( + rTextCandidate.getText(), pDXArray, 0, 1 ); + long nChars = 2; + if ( nWidth ) + nChars = nWidthToFill / nWidth; + + String aFilled; + aFilled.Fill( (USHORT)nChars, aText.GetChar( 0 ) ); + aText = aFilled; + nPos = 0; + nLen = nChars; + } + if(aTransformedDXArray.size()) { mpOutputDevice->DrawTextArray( aStartPoint, - rTextCandidate.getText(), - &(aTransformedDXArray[0]), - rTextCandidate.getTextPosition(), - rTextCandidate.getTextLength()); + aText, + pDXArray, + nPos, + nLen); } else { mpOutputDevice->DrawText( aStartPoint, - rTextCandidate.getText(), - rTextCandidate.getTextPosition(), - rTextCandidate.getTextLength()); + aText, + nPos, + nLen); } if(rTextCandidate.getFontAttribute().getRTL()) |