sw/source/core/edit/edfcol.cxx | 6 ++++++ 1 file changed, 6 insertions(+)
New commits: commit c4f3bd7c94cacb52f7a791a0d364818cee6080b6 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Tue Dec 18 09:19:06 2018 +0300 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Tue Dec 18 09:43:18 2018 +0100 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.kagan...@collabora.com> Tested-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx index 3164e00dd0f0..a3ca45f5ad5a 100644 --- a/sw/source/core/edit/edfcol.cxx +++ b/sw/source/core/edit/edfcol.cxx @@ -1606,6 +1606,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); @@ -1621,7 +1622,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; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits