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-05-19 19:24:05 +0200 |
commit | 48906a5e899e517af76e04afb5659232b336e206 (patch) | |
tree | 3e6159253675799bbed9948164f78510ddef86ab /sfx2 | |
parent | a3f9f03f52c2134058dff87eb1528a19450c566c (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 'sfx2')
-rw-r--r-- | sfx2/sdi/sfx.sdi | 5 | ||||
-rw-r--r-- | sfx2/source/doc/watermarkitem.cxx | 28 |
2 files changed, 25 insertions, 8 deletions
diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi index 6fce89a16635..03b536d3c4d6 100644 --- a/sfx2/sdi/sfx.sdi +++ b/sfx2/sdi/sfx.sdi @@ -4268,7 +4268,10 @@ SfxVoidItem ClassificationApply SID_CLASSIFICATION_APPLY ] SfxWatermarkItem Watermark SID_WATERMARK -(SfxStringItem Text SID_WATERMARK) +(SfxStringItem Text SID_WATERMARK, SfxStringItem Font SID_WATERMARK_FONT, + SfxInt16Item Angle SID_WATERMARK_ANGLE, SfxInt16Item Transparency SID_WATERMARK_TRANSPARENCY, + SfxUInt32Item Color SID_WATERMARK_COLOR +) [ AutoUpdate = FALSE, FastCall = FALSE, diff --git a/sfx2/source/doc/watermarkitem.cxx b/sfx2/source/doc/watermarkitem.cxx index 00c31f25d823..ebb794fcd73e 100644 --- a/sfx2/source/doc/watermarkitem.cxx +++ b/sfx2/source/doc/watermarkitem.cxx @@ -13,6 +13,10 @@ SfxWatermarkItem::SfxWatermarkItem() : SfxPoolItem( SID_WATERMARK ) , m_aText( "" ) +, m_aFont( "Liberation Sans" ) +, m_nAngle( 45 ) +, m_nTransparency( 50 ) +, m_nColor( 0xc0c0c0 ) { } @@ -21,22 +25,24 @@ SfxPoolItem* SfxWatermarkItem::CreateDefault() return new SfxWatermarkItem(); } -SfxWatermarkItem::SfxWatermarkItem( sal_uInt16 nWhichId, const OUString& rText ) -: SfxPoolItem( nWhichId ) -, m_aText( rText ) -{ -} - SfxWatermarkItem::SfxWatermarkItem( const SfxWatermarkItem& rCopy ) : SfxPoolItem( rCopy ) , m_aText( rCopy.m_aText ) +, m_aFont( rCopy.m_aFont ) +, m_nAngle( rCopy.m_nAngle ) +, m_nTransparency( rCopy.m_nTransparency ) +, m_nColor( rCopy.m_nColor ) { } bool SfxWatermarkItem::operator==( const SfxPoolItem& rCmp ) const { return ( SfxPoolItem::operator==( rCmp ) && - m_aText == static_cast<const SfxWatermarkItem&>(rCmp).m_aText ); + m_aText == static_cast<const SfxWatermarkItem&>(rCmp).m_aText && + m_aFont == static_cast<const SfxWatermarkItem&>(rCmp).m_aFont && + m_nAngle == static_cast<const SfxWatermarkItem&>(rCmp).m_nAngle && + m_nTransparency == static_cast<const SfxWatermarkItem&>(rCmp).m_nTransparency && + m_nColor == static_cast<const SfxWatermarkItem&>(rCmp).m_nColor ); } SfxPoolItem* SfxWatermarkItem::Clone( SfxItemPool *) const @@ -47,6 +53,10 @@ SfxPoolItem* SfxWatermarkItem::Clone( SfxItemPool *) const bool SfxWatermarkItem::QueryValue( css::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const { rVal <<= m_aText; + rVal <<= m_aFont; + rVal <<= m_nAngle; + rVal <<= m_nTransparency; + rVal <<= m_nColor; return true; } @@ -58,6 +68,10 @@ bool SfxWatermarkItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /*nMemberI if ( rVal >>= aText ) { m_aText = aText; + rVal >>= m_aFont; + rVal >>= m_nAngle; + rVal >>= m_nTransparency; + rVal >>= m_nColor; return true; } |