summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
Diffstat (limited to 'filter')
-rw-r--r--filter/source/msfilter/msdffimp.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 98427c6ebab6..36a3f59c3787 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -4414,13 +4414,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 );
+ 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;