sw/source/core/edit/edfcol.cxx |   14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

New commits:
commit 1cbe551d86ec528533fee04f20c490a96c0ec3d3
Author: Szymon Kłos <szymon.k...@collabora.com>
Date:   Fri Jul 28 11:25:13 2017 +0200

    tdf#109313 tdf#108494: fix incorrect Watermark position
    
    Change-Id: I578d89cb732bf3e75b83ee6c65d0320659b5c3f8
    Reviewed-on: https://gerrit.libreoffice.org/40514
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>

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));
     }
 }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to