diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2017-05-19 00:18:15 +0200 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2017-06-01 08:10:00 +0200 |
commit | 489597d339af14a6403ee079bea35908112720ec (patch) | |
tree | 86fff09ced71a625e030cdc2325e1644ba5c1cd3 /sw/source/uibase/app | |
parent | abf39e521178e3438dc507167e18a24d160b3fd5 (diff) |
Watermark: extended configuration
* it is possible to set font family,
color, angle and transparency
Change-Id: Idea2fb9ee748394bb3d706fa790e109238584cdb
Reviewed-on: https://gerrit.libreoffice.org/37793
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'sw/source/uibase/app')
-rw-r--r-- | sw/source/uibase/app/docsh2.cxx | 16 | ||||
-rw-r--r-- | sw/source/uibase/app/docst.cxx | 5 |
2 files changed, 16 insertions, 5 deletions
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx index 7268c502230e..55db8a619643 100644 --- a/sw/source/uibase/app/docsh2.cxx +++ b/sw/source/uibase/app/docsh2.cxx @@ -57,6 +57,7 @@ #include <svx/fmshell.hxx> #include <sfx2/linkmgr.hxx> #include <sfx2/classificationhelper.hxx> +#include <sfx2/watermarkitem.hxx> #include <svtools/htmlcfg.hxx> #include <svx/ofaitem.hxx> @@ -1167,8 +1168,19 @@ void SwDocShell::Execute(SfxRequest& rReq) { if (pArgs && pArgs->GetItemState( SID_WATERMARK, false, &pItem ) == SfxItemState::SET) { - OUString aText = static_cast<const SfxStringItem*>( pItem )->GetValue(); - pSh->SetWatermark( aText ); + SfxWatermarkItem aItem; + aItem.SetText( static_cast<const SfxStringItem*>( pItem )->GetValue() ); + + if ( pArgs->GetItemState( SID_WATERMARK_FONT, false, &pItem ) == SfxItemState::SET ) + aItem.SetFont( static_cast<const SfxStringItem*>( pItem )->GetValue() ); + if ( pArgs->GetItemState( SID_WATERMARK_ANGLE, false, &pItem ) == SfxItemState::SET ) + aItem.SetAngle( static_cast<const SfxInt16Item*>( pItem )->GetValue() ); + if ( pArgs->GetItemState( SID_WATERMARK_TRANSPARENCY, false, &pItem ) == SfxItemState::SET ) + aItem.SetTransparency( static_cast<const SfxInt16Item*>( pItem )->GetValue() ); + if ( pArgs->GetItemState( SID_WATERMARK_COLOR, false, &pItem ) == SfxItemState::SET ) + aItem.SetColor( static_cast<const SfxUInt32Item*>( pItem )->GetValue() ); + + pSh->SetWatermark( aItem ); } else { diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx index cffd2eca88ca..6eff974face6 100644 --- a/sw/source/uibase/app/docst.cxx +++ b/sw/source/uibase/app/docst.cxx @@ -276,10 +276,9 @@ void SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh) break; case SID_WATERMARK: { + SfxWatermarkItem aItem = pSh->GetWatermark(); if( pSh ) - rSet.Put(pSh->GetWatermark()); - - rSet.InvalidateItem(nWhich); + rSet.Put(aItem); } break; default: |