From ba8cb853730fda59cc29dc33948d25825a6bc0be Mon Sep 17 00:00:00 2001 From: Szymon Kłos Date: Tue, 13 Jun 2017 10:22:58 +0200 Subject: tdf#108494 incorrect Watermark position Change-Id: Iec1dba66604af008ad8b6b1c20cd508048144463 --- sw/source/core/edit/edfcol.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'sw') diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx index 82256317bb20..910850971830 100644 --- a/sw/source/core/edit/edfcol.cxx +++ b/sw/source/core/edit/edfcol.cxx @@ -352,6 +352,10 @@ void SwEditShell::SetWatermark(const SfxWatermarkItem& rWatermark) if (!bHeaderIsOn) xPageStyle->setPropertyValue(UNO_NAME_HEADER_IS_ON, uno::makeAny(true)); + // backup header height + sal_Int32 nOldValue; + xPageStyle->getPropertyValue(UNO_NAME_HEADER_HEIGHT) >>= nOldValue; + // If the header already contains a document header field, no need to do anything. uno::Reference xHeaderText; xPageStyle->getPropertyValue(UNO_NAME_HEADER_TEXT) >>= xHeaderText; @@ -505,6 +509,11 @@ void SwEditShell::SetWatermark(const SfxWatermarkItem& rWatermark) xNamed->setName(sWatermark); xLockable->removeActionLock(); } + + // tdf#108494 the header height was switched to height of a watermark + // and shape was moved to the lower part of a page + xPageStyle->setPropertyValue(UNO_NAME_HEADER_HEIGHT, uno::makeAny((sal_Int32)11)); + xPageStyle->setPropertyValue(UNO_NAME_HEADER_HEIGHT, uno::makeAny(nOldValue)); } } -- cgit