From 617c577b372deebfb4050713a79c97cc512b16aa Mon Sep 17 00:00:00 2001 From: Szymon Kłos Date: Mon, 19 Jun 2017 15:32:16 +0200 Subject: Watermark: tdf#91687 correct size in the .doc Export: * Watermarks saved using Writer were very small in the MSO. Export fUsegtextFStretch property in the Geometry Text Boolean Properties. * tdf#91687: SnapRect contains size of Watermark after rotation. We have to export size without rotation. Import: * When import set height depending on used font and width. Text will keep the ratio. Remember the padding for export. * added unit test * introduced enum to avoid magic numbers for stretch and best fit properties. Change-Id: I3427afe78488d499f13c543ca401c096161aaf34 Reviewed-on: https://gerrit.libreoffice.org/39355 Reviewed-by: Andras Timar Tested-by: Andras Timar --- sw/source/filter/ww8/wrtw8esh.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sw/source/filter/ww8/wrtw8esh.cxx') diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index 9fc44252d0d6..2e94c500cbde 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -759,7 +759,12 @@ void PlcDrawObj::WritePlc( WW8Export& rWrt ) const OSL_ENSURE(pObj, "wo ist das SDR-Object?"); if (pObj) { - aRect = pObj->GetSnapRect(); + aRect = pObj->GetLogicRect(); + + // We have to export original size with padding + const SfxItemSet& rSet = pObj->GetMergedItemSet(); + const SdrMetricItem* pItem = static_cast(rSet.GetItem(SDRATTR_TEXT_UPPERDIST)); + aRect.SetSize(Size(aRect.GetWidth(), aRect.GetHeight() + pItem->GetValue())); } } -- cgit v1.2.3