diff options
Diffstat (limited to 'sw/source/uibase/app/docsh2.cxx')
-rw-r--r-- | sw/source/uibase/app/docsh2.cxx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx index 4198d18ec46b..7268c502230e 100644 --- a/sw/source/uibase/app/docsh2.cxx +++ b/sw/source/uibase/app/docsh2.cxx @@ -124,6 +124,7 @@ #include "dialog.hrc" #include "swabstdlg.hxx" +#include "watermarkdialog.hxx" #include <ndtxt.hxx> @@ -1159,6 +1160,27 @@ void SwDocShell::Execute(SfxRequest& rReq) SAL_WARN("sw.ui", "missing parameter for SID_CLASSIFICATION_APPLY"); } break; + case SID_WATERMARK: + { + SwWrtShell* pSh = GetWrtShell(); + if ( pSh ) + { + if (pArgs && pArgs->GetItemState( SID_WATERMARK, false, &pItem ) == SfxItemState::SET) + { + OUString aText = static_cast<const SfxStringItem*>( pItem )->GetValue(); + pSh->SetWatermark( aText ); + } + else + { + SfxViewShell* pViewShell = GetView()? GetView(): SfxViewShell::Current(); + SfxBindings& rBindings( pViewShell->GetViewFrame()->GetBindings() ); + ScopedVclPtr<SwWatermarkDialog> pDlg( VclPtr<SwWatermarkDialog>::Create( nullptr, rBindings ) ); + pDlg->Execute(); + pDlg.disposeAndClear(); + } + } + } + break; case SID_NOTEBOOKBAR: { const SfxStringItem* pFile = rReq.GetArg<SfxStringItem>( SID_NOTEBOOKBAR ); |