From 22e94ab1860b1bdea8d107d4e8824f63c6b1c8c5 Mon Sep 17 00:00:00 2001 From: Szymon Kłos Date: Thu, 21 Sep 2017 11:31:53 +0200 Subject: Watermark: apply when new page style is created MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I0d0103f8cc351ec87f7c3bf936ef4725a166d315 Reviewed-on: https://gerrit.libreoffice.org/42581 Tested-by: Jenkins Reviewed-by: Szymon Kłos --- sw/source/uibase/app/docst.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sw') diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx index a93bb5ab9ab0..f8c424db280f 100644 --- a/sw/source/uibase/app/docst.cxx +++ b/sw/source/uibase/app/docst.cxx @@ -324,6 +324,14 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq ) sName = SfxStyleDialog::GenerateUnusedName(*m_xBasePool); nRet = Edit( sName, sParent, nFamily, nMask, true, OString(), nullptr, rReq.IsAPI() ); + + // Update Watermark if new page style was created + if( nFamily == SfxStyleFamily::Page ) + { + SwWrtShell* pShell = GetWrtShell(); + const SfxWatermarkItem aWatermark = pShell->GetWatermark(); + pShell->SetWatermark( aWatermark ); + } } break; -- cgit v1.2.3