summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2017-07-28 11:25:13 +0200
committerAron Budea <aron.budea@collabora.com>2017-07-28 14:33:18 +0200
commit0f75c004cc20e14c7d33c8f2a4451d71681af146 (patch)
tree56db1bdc77386b66d001a259e5d8218485b5864c
parent72567a8259633cf28736780abaed7643295c5ccb (diff)
tdf#109313 tdf#108494: fix incorrect Watermark position
Change-Id: I578d89cb732bf3e75b83ee6c65d0320659b5c3f8 Reviewed-on: https://gerrit.libreoffice.org/40514 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> (cherry picked from commit 1cbe551d86ec528533fee04f20c490a96c0ec3d3) Reviewed-on: https://gerrit.libreoffice.org/40524 Reviewed-by: Aron Budea <aron.budea@collabora.com> Tested-by: Aron Budea <aron.budea@collabora.com>
-rw-r--r--sw/source/core/edit/edfcol.cxx14
1 files changed, 5 insertions, 9 deletions
diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx
index d83be8aace45..df253bb29d7d 100644
--- a/sw/source/core/edit/edfcol.cxx
+++ b/sw/source/core/edit/edfcol.cxx
@@ -492,6 +492,11 @@ void lcl_placeWatermarkInHeader(const SfxWatermarkItem& rWatermark,
it->Value <<= aPropertyValues;
xPropertySet->setPropertyValue("CustomShapeGeometry", uno::makeAny(comphelper::containerToSequence(aGeomPropVec)));
+ // tdf#108494, tdf#109313 the header height was switched to height of a watermark
+ // and shape was moved to the lower part of a page, force position update
+ xPropertySet->getPropertyValue("Transformation") >>= aMatrix;
+ xPropertySet->setPropertyValue("Transformation", uno::makeAny(aMatrix));
+
uno::Reference<container::XNamed> xNamed(xShape, uno::UNO_QUERY);
xNamed->setName(sWatermark);
xLockable->removeActionLock();
@@ -520,10 +525,6 @@ 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<text::XText> xHeaderText;
uno::Reference<text::XText> xHeaderTextFirst;
@@ -532,11 +533,6 @@ void SwEditShell::SetWatermark(const SfxWatermarkItem& rWatermark)
xPageStyle->getPropertyValue(UNO_NAME_HEADER_TEXT_FIRST) >>= xHeaderTextFirst;
lcl_placeWatermarkInHeader(rWatermark, xModel, xPageStyle, xHeaderTextFirst);
-
- // 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));
}
}