diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2018-12-18 09:19:06 +0300 |
---|---|---|
committer | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2018-12-19 21:26:13 +0100 |
commit | b1059dcad84dccc68b45819ed0d74dcb577fe19e (patch) | |
tree | 54ab3a32eea3b88763a26792b099e8d670b51573 /sw | |
parent | ec04d0ef3457a96175c1e9723a9bea0c69a9c528 (diff) |
tdf#116496: don't add header when setting empty watermark
Regression from commit 22e94ab1860b1bdea8d107d4e8824f63c6b1c8c5
Change-Id: I66a6e0b5069fe459b887a52f1ea26904dfc2d37b
Reviewed-on: https://gerrit.libreoffice.org/65303
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit c4f3bd7c94cacb52f7a791a0d364818cee6080b6)
Reviewed-on: https://gerrit.libreoffice.org/65415
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/edit/edfcol.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx index a38e5e70fdbe..2335d49af1a9 100644 --- a/sw/source/core/edit/edfcol.cxx +++ b/sw/source/core/edit/edfcol.cxx @@ -1603,6 +1603,7 @@ void SwEditShell::SetWatermark(const SfxWatermarkItem& rWatermark) SwDocShell* pDocShell = GetDoc()->GetDocShell(); if (!pDocShell) return; + const bool bNoWatermark = rWatermark.GetText().isEmpty(); uno::Reference<frame::XModel> xModel = pDocShell->GetBaseModel(); uno::Reference<style::XStyleFamiliesSupplier> xStyleFamiliesSupplier(xModel, uno::UNO_QUERY); @@ -1618,7 +1619,12 @@ void SwEditShell::SetWatermark(const SfxWatermarkItem& rWatermark) bool bHeaderIsOn = false; xPageStyle->getPropertyValue(UNO_NAME_HEADER_IS_ON) >>= bHeaderIsOn; if (!bHeaderIsOn) + { + if (bNoWatermark) + continue; // the style doesn't have any watermark - no need to do anything + xPageStyle->setPropertyValue(UNO_NAME_HEADER_IS_ON, uno::makeAny(true)); + } // backup header height bool bDynamicHeight = true; |