summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2017-11-02 17:22:03 +0100
committerSzymon Kłos <szymon.klos@collabora.com>2017-11-05 20:53:09 +0100
commit1e6abe31eb8f7c12c725f7e1267a7cedfcd3d157 (patch)
tree02a9ea7cf0da452330344a79ce25dcc05c5da727 /filter
parent1bacce999d7dad91b1f87baaf09b08e6b4629fad (diff)
tdf#113037 create Watermark with correct ratio
Change-Id: I17ab8d98a618cff6e38dad344f4096dc520cce43 Reviewed-on: https://gerrit.libreoffice.org/44228 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
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 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;