[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - sw/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Sat Dec 29 19:20:16 UTC 2018
sw/source/core/edit/edfcol.cxx | 6 ++++++
1 file changed, 6 insertions(+)
New commits:
commit f192d5b200ed4568c9d03f69f4148a8fc619122c
Author: Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Tue Dec 18 09:19:06 2018 +0300
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Sat Dec 29 20:19:52 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.kaganski at collabora.com>
Tested-by: Mike Kaganski <mike.kaganski at collabora.com>
(cherry picked from commit c4f3bd7c94cacb52f7a791a0d364818cee6080b6)
Reviewed-on: https://gerrit.libreoffice.org/65318
Reviewed-by: Andras Timar <andras.timar at collabora.com>
diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx
index bf12303ba2c7..f79fc443199e 100644
--- a/sw/source/core/edit/edfcol.cxx
+++ b/sw/source/core/edit/edfcol.cxx
@@ -1598,6 +1598,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);
@@ -1613,7 +1614,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;
More information about the Libreoffice-commits
mailing list