summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2017-11-02 17:22:03 +0100
committerAndras Timar <andras.timar@collabora.com>2018-01-17 08:39:17 +0100
commit0f4e87dee94788bbaf61efc473981e715a33e7cb (patch)
treeabaf1389568faba6f62de3d911508129495f4d72 /filter
parent9150385a3a152f66fdd5587727008eb240aa9ae0 (diff)
tdf#113037 create Watermark with correct ratio
Reviewed-on: https://gerrit.libreoffice.org/44228 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> (cherry picked from commit 1e6abe31eb8f7c12c725f7e1267a7cedfcd3d157) Change-Id: I17ab8d98a618cff6e38dad344f4096dc520cce43 Reviewed-on: https://gerrit.libreoffice.org/45994 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com> (cherry picked from commit fec53ea4c33b012ef76d971d0b154d766c8e5759)
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 1a8d53138700..6b00faf649d8 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;