diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-11-06 11:32:33 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-11-06 16:53:53 +0100 |
commit | e9b848270850f57965d274f7fd47fc2a84611465 (patch) | |
tree | 85cb38a8fabddb47c0235260cdb8a0da381ff497 /sw | |
parent | db1118a652891543a4d71e29d7a4fcd9c2d79515 (diff) |
SwFmt: add getter / setter for InteropGrabBag
Change-Id: I3f97c23077f8c2af69873e9cef244265378f44f7
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/format.hxx | 6 | ||||
-rw-r--r-- | sw/source/core/attr/format.cxx | 23 |
2 files changed, 29 insertions, 0 deletions
diff --git a/sw/inc/format.hxx b/sw/inc/format.hxx index c9efac333085..abea51a88d64 100644 --- a/sw/inc/format.hxx +++ b/sw/inc/format.hxx @@ -24,6 +24,7 @@ #include <swatrset.hxx> #include <calbck.hxx> #include <hintids.hxx> +#include <boost/shared_ptr.hpp> class IDocumentSettingAccess; class IDocumentDrawModelAccess; @@ -32,6 +33,7 @@ class IDocumentTimerAccess; class IDocumentFieldsAccess; class IDocumentChartDataProviderAccess; class SwDoc; +class SfxGrabBagItem; /// Base class for various Writer styles. class SW_DLLPUBLIC SwFmt : public SwModify @@ -52,6 +54,7 @@ class SW_DLLPUBLIC SwFmt : public SwModify sal_Bool bAutoUpdateFmt : 1;/**< TRUE: Set attributes of a whole paragraph at format (UI-side!). */ bool bHidden : 1; + boost::shared_ptr<SfxGrabBagItem> m_pGrabBagItem; ///< Style InteropGrabBag. protected: SwFmt( SwAttrPool& rPool, const sal_Char* pFmtNm, @@ -158,6 +161,9 @@ public: bool IsHidden() const { return bHidden; } void SetHidden( bool bValue = false ) { bHidden = bValue; } + void GetGrabBagItem(com::sun::star::uno::Any& rVal) const; + void SetGrabBagItem(const com::sun::star::uno::Any& rVal); + /// Query / set bAutoUpdateFmt-flag. sal_Bool IsAutoUpdateFmt() const { return bAutoUpdateFmt; } void SetAutoUpdateFmt( sal_Bool bNew = sal_True ) { bAutoUpdateFmt = bNew; } diff --git a/sw/source/core/attr/format.cxx b/sw/source/core/attr/format.cxx index de54367b6cd2..d94f2d7a5451 100644 --- a/sw/source/core/attr/format.cxx +++ b/sw/source/core/attr/format.cxx @@ -25,6 +25,10 @@ #include <hints.hxx> #include <paratr.hxx> #include <swcache.hxx> +#include <svl/grabbagitem.hxx> +#include <com/sun/star/beans/PropertyValues.hpp> + +using namespace com::sun::star; TYPEINIT1( SwFmt, SwClient ); @@ -603,4 +607,23 @@ IDocumentTimerAccess* SwFmt::getIDocumentTimerAccess() { return GetDoc(); } IDocumentFieldsAccess* SwFmt::getIDocumentFieldsAccess() { return GetDoc(); } IDocumentChartDataProviderAccess* SwFmt::getIDocumentChartDataProviderAccess() { return GetDoc(); } +void SwFmt::GetGrabBagItem(uno::Any& rVal) const +{ + if (m_pGrabBagItem.get()) + m_pGrabBagItem->QueryValue(rVal); + else + { + uno::Sequence<beans::PropertyValue> aValue(0); + rVal = uno::makeAny(aValue); + } +} + +void SwFmt::SetGrabBagItem(const uno::Any& rVal) +{ + if (!m_pGrabBagItem.get()) + m_pGrabBagItem.reset(new SfxGrabBagItem); + + m_pGrabBagItem->PutValue(rVal); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |