diff options
author | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-11-16 15:57:53 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-11-16 15:57:53 -0500 |
commit | 892a9ff6181cd08797359e1299e67009ba4749b8 (patch) | |
tree | 2d13c271181ed572ad7752899570f1d8f9fad285 /sc | |
parent | d37950cb1678b1560e1c2ca17c38caa7a008df87 (diff) |
More on reducing header dependency.
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/app/uiitems.cxx | 36 | ||||
-rw-r--r-- | sc/source/ui/inc/filtdlg.hxx | 1 | ||||
-rw-r--r-- | sc/source/ui/inc/uiitems.hxx | 12 |
3 files changed, 33 insertions, 16 deletions
diff --git a/sc/source/ui/app/uiitems.cxx b/sc/source/ui/app/uiitems.cxx index 78e4e6710ca7..1e2df4c58cec 100644 --- a/sc/source/ui/app/uiitems.cxx +++ b/sc/source/ui/app/uiitems.cxx @@ -30,12 +30,13 @@ #include "precompiled_sc.hxx" - -#include <editeng/editobj.hxx> +#include "uiitems.hxx" #include "userlist.hxx" -#include "uiitems.hxx" #include "dpsave.hxx" +#include "queryparam.hxx" + +#include <editeng/editobj.hxx> // STATIC DATA ----------------------------------------------------------- @@ -237,10 +238,14 @@ ScQueryItem::ScQueryItem( sal_uInt16 nWhichP, ScViewData* ptrViewData, const ScQueryParam* pQueryData ) : SfxPoolItem ( nWhichP ), + mpQueryData(NULL), pViewData ( ptrViewData ), bIsAdvanced ( false ) { - if ( pQueryData ) theQueryData = *pQueryData; + if (pQueryData) + mpQueryData.reset(new ScQueryParam(*pQueryData)); + else + mpQueryData.reset(new ScQueryParam); } //------------------------------------------------------------------------ @@ -248,20 +253,24 @@ ScQueryItem::ScQueryItem( sal_uInt16 nWhichP, ScQueryItem::ScQueryItem( sal_uInt16 nWhichP, const ScQueryParam* pQueryData ) : SfxPoolItem ( nWhichP ), + mpQueryData(NULL), pViewData ( NULL ), bIsAdvanced ( false ) { - if ( pQueryData ) theQueryData = *pQueryData; + if (pQueryData) + mpQueryData.reset(new ScQueryParam(*pQueryData)); + else + mpQueryData.reset(new ScQueryParam); } //------------------------------------------------------------------------ ScQueryItem::ScQueryItem( const ScQueryItem& rItem ) : SfxPoolItem ( rItem ), + mpQueryData(new ScQueryParam(*rItem.mpQueryData)), pViewData ( rItem.pViewData ), - theQueryData( rItem.theQueryData ), - bIsAdvanced ( rItem.bIsAdvanced ), - aAdvSource ( rItem.aAdvSource ) + aAdvSource ( rItem.aAdvSource ), + bIsAdvanced ( rItem.bIsAdvanced ) { } @@ -276,13 +285,18 @@ void ScQueryItem::SetAdvancedQuerySource(const ScRange* pSource) if (pSource) { aAdvSource = *pSource; - bIsAdvanced = sal_True; + bIsAdvanced = true; } else bIsAdvanced = false; } -sal_Bool ScQueryItem::GetAdvancedQuerySource(ScRange& rSource) const +const ScQueryParam& ScQueryItem::GetQueryData() const +{ + return *mpQueryData; +} + +bool ScQueryItem::GetAdvancedQuerySource(ScRange& rSource) const { rSource = aAdvSource; return bIsAdvanced; @@ -306,7 +320,7 @@ int ScQueryItem::operator==( const SfxPoolItem& rItem ) const return ( (pViewData == rQueryItem.pViewData) && (bIsAdvanced == rQueryItem.bIsAdvanced) && (aAdvSource == rQueryItem.aAdvSource) - && (theQueryData == rQueryItem.theQueryData) ); + && (*mpQueryData == *rQueryItem.mpQueryData) ); } //------------------------------------------------------------------------ diff --git a/sc/source/ui/inc/filtdlg.hxx b/sc/source/ui/inc/filtdlg.hxx index 693c2d7a1421..865fc1b6a31c 100644 --- a/sc/source/ui/inc/filtdlg.hxx +++ b/sc/source/ui/inc/filtdlg.hxx @@ -36,6 +36,7 @@ #include "global.hxx" // -> ScQueryParam #include "address.hxx" #include "anyrefdg.hxx" +#include "queryparam.hxx" #include <deque> #include <vector> diff --git a/sc/source/ui/inc/uiitems.hxx b/sc/source/ui/inc/uiitems.hxx index 7f71a152684e..2e8258a46852 100644 --- a/sc/source/ui/inc/uiitems.hxx +++ b/sc/source/ui/inc/uiitems.hxx @@ -32,15 +32,17 @@ #include "scdllapi.h" #include "conditio.hxx" #include "sortparam.hxx" -#include "queryparam.hxx" #include "subtotalparam.hxx" #include "paramisc.hxx" #include <svl/poolitem.hxx> +#include <boost/scoped_ptr.hpp> + class ScEditEngineDefaulter; class EditTextObject; class ScViewData; class ScDPSaveData; +struct ScQueryParam; // --------------------------------------------------------------------------- @@ -192,16 +194,16 @@ public: virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; ScViewData* GetViewData () const { return pViewData; } - const ScQueryParam& GetQueryData() const { return theQueryData; } + const ScQueryParam& GetQueryData() const; - sal_Bool GetAdvancedQuerySource(ScRange& rSource) const; + bool GetAdvancedQuerySource(ScRange& rSource) const; void SetAdvancedQuerySource(const ScRange* pSource); private: + boost::scoped_ptr<ScQueryParam> mpQueryData; ScViewData* pViewData; - ScQueryParam theQueryData; - sal_Bool bIsAdvanced; ScRange aAdvSource; + bool bIsAdvanced; }; //---------------------------------------------------------------------------- |