summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/source/core/edit/edfcol.cxx6
1 files changed, 6 insertions, 0 deletions
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;