summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2017-07-28 11:25:13 +0200
committerSzymon Kłos <szymon.klos@collabora.com>2017-07-28 14:09:23 +0200
commit1cbe551d86ec528533fee04f20c490a96c0ec3d3 (patch)
treef52795edd16e3b42c316f1665caa94cfc92ef270
parent351fd8f027907b079dad19c0c34b0b5fff9b27b1 (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>
-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 ee054fcaa41d..808525287c75 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));
}
}