diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2017-05-25 15:12:46 +0200 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2017-05-26 02:29:15 +0200 |
commit | 6533c30f7f8b62671fef9e636c49b11127812ed1 (patch) | |
tree | 6c240f3cf55c813943541af680ded84a96d0cda2 /sfx2/source/doc/watermarkitem.cxx | |
parent | b139bf96574010f317c543bc45d23dd6a5810621 (diff) |
Watermark: updated Put and QueryValue
Change-Id: Ica65be783130b1981093204edd03dc793a16343b
Reviewed-on: https://gerrit.libreoffice.org/38027
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
Diffstat (limited to 'sfx2/source/doc/watermarkitem.cxx')
-rw-r--r-- | sfx2/source/doc/watermarkitem.cxx | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/sfx2/source/doc/watermarkitem.cxx b/sfx2/source/doc/watermarkitem.cxx index ebb794fcd73e..f54745694557 100644 --- a/sfx2/source/doc/watermarkitem.cxx +++ b/sfx2/source/doc/watermarkitem.cxx @@ -9,6 +9,7 @@ #include <sfx2/watermarkitem.hxx> #include <sfx2/sfxsids.hrc> +#include <comphelper/propertysequence.hxx> SfxWatermarkItem::SfxWatermarkItem() : SfxPoolItem( SID_WATERMARK ) @@ -52,26 +53,36 @@ 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; + rVal <<= comphelper::InitPropertySequence( { + { "Text", css::uno::makeAny( m_aText ) }, + { "Font", css::uno::makeAny( m_aFont ) }, + { "Angle", css::uno::makeAny( m_nAngle ) }, + { "Transparency", css::uno::makeAny( m_nTransparency ) }, + { "Color", css::uno::makeAny( m_nColor ) }, + } ); return true; } bool SfxWatermarkItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) { - OUString aText; + css::uno::Sequence<css::beans::PropertyValue> aSequence; - if ( rVal >>= aText ) + if ( rVal >>= aSequence ) { - m_aText = aText; - rVal >>= m_aFont; - rVal >>= m_nAngle; - rVal >>= m_nTransparency; - rVal >>= m_nColor; + for(const auto& aEntry : aSequence) + { + if(aEntry.Name == "Text") + aEntry.Value >>= m_aText; + if(aEntry.Name == "Font") + aEntry.Value >>= m_aFont; + if(aEntry.Name == "Angle") + aEntry.Value >>= m_nAngle; + if(aEntry.Name == "Transparency") + aEntry.Value >>= m_nTransparency; + if(aEntry.Name == "Color") + aEntry.Value >>= m_nColor; + } return true; } |