diff options
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/msfilter/msdffimp.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index fdc3f1e3a5dd..1fc80da83cb8 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -4419,13 +4419,13 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r OutputDevice* pOut = Application::GetDefaultDevice(); vcl::Font aFont( pOut->GetFont() ); aFont.SetFamilyName( aFontName ); - auto nTextWidth = pOut->GetTextWidth( aObjectText ); + tools::Rectangle aBoundingRect; + pOut->GetTextBoundRect( aBoundingRect, aObjectText ); OUString aObjName = GetPropertyString(DFF_Prop_wzName, rSt); - if ( nTextWidth && aObjData.eShapeType == mso_sptTextPlainText && aObjName.match("PowerPlusWaterMarkObject")) + if ( aBoundingRect.GetWidth() && aObjData.eShapeType == mso_sptTextPlainText && aObjName.match( "PowerPlusWaterMarkObject" ) ) { - fRatio = aFont.GetFontSize().Height(); - fRatio /= nTextWidth; + fRatio = (double)aBoundingRect.GetHeight() / aBoundingRect.GetWidth(); sal_Int32 nNewHeight = fRatio * aObjData.aBoundRect.getWidth(); sal_Int32 nPaddingY = aObjData.aBoundRect.getHeight() - nNewHeight; |