Kaydet (Commit) e9b84827 authored tarafından Miklos Vajna's avatar Miklos Vajna

SwFmt: add getter / setter for InteropGrabBag

Change-Id: I3f97c23077f8c2af69873e9cef244265378f44f7
üst db1118a6
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <swatrset.hxx> #include <swatrset.hxx>
#include <calbck.hxx> #include <calbck.hxx>
#include <hintids.hxx> #include <hintids.hxx>
#include <boost/shared_ptr.hpp>
class IDocumentSettingAccess; class IDocumentSettingAccess;
class IDocumentDrawModelAccess; class IDocumentDrawModelAccess;
...@@ -32,6 +33,7 @@ class IDocumentTimerAccess; ...@@ -32,6 +33,7 @@ class IDocumentTimerAccess;
class IDocumentFieldsAccess; class IDocumentFieldsAccess;
class IDocumentChartDataProviderAccess; class IDocumentChartDataProviderAccess;
class SwDoc; class SwDoc;
class SfxGrabBagItem;
/// Base class for various Writer styles. /// Base class for various Writer styles.
class SW_DLLPUBLIC SwFmt : public SwModify class SW_DLLPUBLIC SwFmt : public SwModify
...@@ -52,6 +54,7 @@ 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 sal_Bool bAutoUpdateFmt : 1;/**< TRUE: Set attributes of a whole paragraph
at format (UI-side!). */ at format (UI-side!). */
bool bHidden : 1; bool bHidden : 1;
boost::shared_ptr<SfxGrabBagItem> m_pGrabBagItem; ///< Style InteropGrabBag.
protected: protected:
SwFmt( SwAttrPool& rPool, const sal_Char* pFmtNm, SwFmt( SwAttrPool& rPool, const sal_Char* pFmtNm,
...@@ -158,6 +161,9 @@ public: ...@@ -158,6 +161,9 @@ public:
bool IsHidden() const { return bHidden; } bool IsHidden() const { return bHidden; }
void SetHidden( bool bValue = false ) { bHidden = bValue; } 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. /// Query / set bAutoUpdateFmt-flag.
sal_Bool IsAutoUpdateFmt() const { return bAutoUpdateFmt; } sal_Bool IsAutoUpdateFmt() const { return bAutoUpdateFmt; }
void SetAutoUpdateFmt( sal_Bool bNew = sal_True ) { bAutoUpdateFmt = bNew; } void SetAutoUpdateFmt( sal_Bool bNew = sal_True ) { bAutoUpdateFmt = bNew; }
......
...@@ -25,6 +25,10 @@ ...@@ -25,6 +25,10 @@
#include <hints.hxx> #include <hints.hxx>
#include <paratr.hxx> #include <paratr.hxx>
#include <swcache.hxx> #include <swcache.hxx>
#include <svl/grabbagitem.hxx>
#include <com/sun/star/beans/PropertyValues.hpp>
using namespace com::sun::star;
TYPEINIT1( SwFmt, SwClient ); TYPEINIT1( SwFmt, SwClient );
...@@ -603,4 +607,23 @@ IDocumentTimerAccess* SwFmt::getIDocumentTimerAccess() { return GetDoc(); } ...@@ -603,4 +607,23 @@ IDocumentTimerAccess* SwFmt::getIDocumentTimerAccess() { return GetDoc(); }
IDocumentFieldsAccess* SwFmt::getIDocumentFieldsAccess() { return GetDoc(); } IDocumentFieldsAccess* SwFmt::getIDocumentFieldsAccess() { return GetDoc(); }
IDocumentChartDataProviderAccess* SwFmt::getIDocumentChartDataProviderAccess() { 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: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment