diff options
author | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-11-03 22:57:31 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-11-04 22:40:27 -0400 |
commit | d6edecd37c4fe71cdb7aea313ac1c7478c7920e4 (patch) | |
tree | 0e6ec8cba35f291f78f73bb1da66ce0b4be1a1c5 | |
parent | fa42b0d8382d1a509ff95a79dbd18787fd5b3735 (diff) |
Moved ScQueryEntry out of global.?xx to queryparam.?xx.
This is more appropriate.
-rw-r--r-- | sc/inc/global.hxx | 40 | ||||
-rw-r--r-- | sc/inc/lookupcache.hxx | 1 | ||||
-rw-r--r-- | sc/inc/queryparam.hxx | 39 | ||||
-rw-r--r-- | sc/source/core/data/global2.cxx | 106 | ||||
-rw-r--r-- | sc/source/core/tool/queryparam.cxx | 103 | ||||
-rw-r--r-- | sc/source/filter/inc/excrecds.hxx | 1 | ||||
-rw-r--r-- | sc/source/filter/xml/XMLExportDataPilot.hxx | 1 |
7 files changed, 145 insertions, 146 deletions
diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx index cc8c0fde1028..78360b69cf1e 100644 --- a/sc/inc/global.hxx +++ b/sc/inc/global.hxx @@ -741,46 +741,6 @@ enum ScSubTotalFunc SUBTOTAL_FUNC_VARP = 11 }; -/* - * dialog returns the special field values "empty"/"not empty" - * as constants SC_EMPTYFIELDS and SC_NONEMPTYFIELDS respectively in nVal in - * conjuctions with the flag bQueryByString = FALSE. - */ - -#define SC_EMPTYFIELDS ((double)0x0042) -#define SC_NONEMPTYFIELDS ((double)0x0043) - -namespace utl -{ - class SearchParam; - class TextSearch; -} - -struct ScQueryEntry -{ - bool bDoQuery; - bool bQueryByString; - bool bQueryByDate; - SCCOLROW nField; - ScQueryOp eOp; - ScQueryConnect eConnect; - String* pStr; - double nVal; - mutable utl::SearchParam* pSearchParam; // if RegExp, not saved - mutable utl::TextSearch* pSearchText; // if RegExp, not saved - - ScQueryEntry(); - ScQueryEntry(const ScQueryEntry& r); - ~ScQueryEntry(); - - // creates pSearchParam and pSearchText if necessary, always RegExp! - utl::TextSearch* GetSearchTextPtr( bool bCaseSens ) const; - - void Clear(); - ScQueryEntry& operator=( const ScQueryEntry& r ); - bool operator==( const ScQueryEntry& r ) const; -}; - class ScArea; struct ScConsolidateParam diff --git a/sc/inc/lookupcache.hxx b/sc/inc/lookupcache.hxx index 9901ba5a5479..01ab42522b8f 100644 --- a/sc/inc/lookupcache.hxx +++ b/sc/inc/lookupcache.hxx @@ -31,6 +31,7 @@ #include "address.hxx" #include "global.hxx" +#include "queryparam.hxx" #include "formula/token.hxx" #include <svl/listener.hxx> #include <tools/string.hxx> diff --git a/sc/inc/queryparam.hxx b/sc/inc/queryparam.hxx index a083f74acb9c..105a80180588 100644 --- a/sc/inc/queryparam.hxx +++ b/sc/inc/queryparam.hxx @@ -34,8 +34,47 @@ #include <vector> +/* + * dialog returns the special field values "empty"/"not empty" + * as constants SC_EMPTYFIELDS and SC_NONEMPTYFIELDS respectively in nVal in + * conjuctions with the flag bQueryByString = FALSE. + */ + +#define SC_EMPTYFIELDS ((double)0x0042) +#define SC_NONEMPTYFIELDS ((double)0x0043) + struct ScDBQueryParamInternal; +namespace utl { + class SearchParam; + class TextSearch; +} + +struct ScQueryEntry +{ + bool bDoQuery; + bool bQueryByString; + bool bQueryByDate; + SCCOLROW nField; + ScQueryOp eOp; + ScQueryConnect eConnect; + String* pStr; + double nVal; + mutable utl::SearchParam* pSearchParam; // if RegExp, not saved + mutable utl::TextSearch* pSearchText; // if RegExp, not saved + + ScQueryEntry(); + ScQueryEntry(const ScQueryEntry& r); + ~ScQueryEntry(); + + // creates pSearchParam and pSearchText if necessary, always RegExp! + utl::TextSearch* GetSearchTextPtr( bool bCaseSens ) const; + + void Clear(); + ScQueryEntry& operator=( const ScQueryEntry& r ); + bool operator==( const ScQueryEntry& r ) const; +}; + struct ScQueryParamBase { bool bHasHeader; diff --git a/sc/source/core/data/global2.cxx b/sc/source/core/data/global2.cxx index 91c4ff63ad13..28219fdae266 100644 --- a/sc/source/core/data/global2.cxx +++ b/sc/source/core/data/global2.cxx @@ -33,7 +33,6 @@ #include <sfx2/docfile.hxx> #include <sfx2/objsh.hxx> -#include <unotools/textsearch.hxx> #include <unotools/pathoptions.hxx> #include <unotools/useroptions.hxx> #include <tools/urlobj.hxx> @@ -123,111 +122,6 @@ bool ScImportParam::operator==( const ScImportParam& rOther ) const } //------------------------------------------------------------------------ -// struct ScQueryParam: - -ScQueryEntry::ScQueryEntry() : - bDoQuery(false), - bQueryByString(false), - bQueryByDate(false), - nField(0), - eOp(SC_EQUAL), - eConnect(SC_AND), - pStr(new String), - nVal(0.0), - pSearchParam(NULL), - pSearchText(NULL) -{ -} - -ScQueryEntry::ScQueryEntry(const ScQueryEntry& r) : - bDoQuery(r.bDoQuery), - bQueryByString(r.bQueryByString), - bQueryByDate(r.bQueryByDate), - nField(r.nField), - eOp(r.eOp), - eConnect(r.eConnect), - pStr(new String(*r.pStr)), - nVal(r.nVal), - pSearchParam(NULL), - pSearchText(NULL) -{ -} - -ScQueryEntry::~ScQueryEntry() -{ - delete pStr; - if ( pSearchParam ) - { - delete pSearchParam; - delete pSearchText; - } -} - -ScQueryEntry& ScQueryEntry::operator=( const ScQueryEntry& r ) -{ - bDoQuery = r.bDoQuery; - bQueryByString = r.bQueryByString; - bQueryByDate = r.bQueryByDate; - eOp = r.eOp; - eConnect = r.eConnect; - nField = r.nField; - nVal = r.nVal; - *pStr = *r.pStr; - if ( pSearchParam ) - { - delete pSearchParam; - delete pSearchText; - } - pSearchParam = NULL; - pSearchText = NULL; - - return *this; -} - -void ScQueryEntry::Clear() -{ - bDoQuery = false; - bQueryByString = false; - bQueryByDate = false; - eOp = SC_EQUAL; - eConnect = SC_AND; - nField = 0; - nVal = 0.0; - pStr->Erase(); - if ( pSearchParam ) - { - delete pSearchParam; - delete pSearchText; - } - pSearchParam = NULL; - pSearchText = NULL; -} - -bool ScQueryEntry::operator==( const ScQueryEntry& r ) const -{ - return bDoQuery == r.bDoQuery - && bQueryByString == r.bQueryByString - && bQueryByDate == r.bQueryByDate - && eOp == r.eOp - && eConnect == r.eConnect - && nField == r.nField - && nVal == r.nVal - && *pStr == *r.pStr; - //! pSearchParam und pSearchText nicht vergleichen -} - -utl::TextSearch* ScQueryEntry::GetSearchTextPtr( bool bCaseSens ) const -{ - if ( !pSearchParam ) - { - pSearchParam = new utl::SearchParam( *pStr, utl::SearchParam::SRCH_REGEXP, - bCaseSens, false, false ); - pSearchText = new utl::TextSearch( *pSearchParam, *ScGlobal::pCharClass ); - } - return pSearchText; -} - -//------------------------------------------------------------------------ // struct ScConsolidateParam: ScConsolidateParam::ScConsolidateParam() : diff --git a/sc/source/core/tool/queryparam.cxx b/sc/source/core/tool/queryparam.cxx index f75c677a2312..44d6201fe6c1 100644 --- a/sc/source/core/tool/queryparam.cxx +++ b/sc/source/core/tool/queryparam.cxx @@ -32,6 +32,7 @@ // INCLUDE --------------------------------------------------------------- #include "queryparam.hxx" +#include <unotools/textsearch.hxx> using ::std::vector; @@ -41,6 +42,108 @@ const SCSIZE MAXQUERY = 8; } +ScQueryEntry::ScQueryEntry() : + bDoQuery(false), + bQueryByString(false), + bQueryByDate(false), + nField(0), + eOp(SC_EQUAL), + eConnect(SC_AND), + pStr(new String), + nVal(0.0), + pSearchParam(NULL), + pSearchText(NULL) +{ +} + +ScQueryEntry::ScQueryEntry(const ScQueryEntry& r) : + bDoQuery(r.bDoQuery), + bQueryByString(r.bQueryByString), + bQueryByDate(r.bQueryByDate), + nField(r.nField), + eOp(r.eOp), + eConnect(r.eConnect), + pStr(new String(*r.pStr)), + nVal(r.nVal), + pSearchParam(NULL), + pSearchText(NULL) +{ +} + +ScQueryEntry::~ScQueryEntry() +{ + delete pStr; + if ( pSearchParam ) + { + delete pSearchParam; + delete pSearchText; + } +} + +ScQueryEntry& ScQueryEntry::operator=( const ScQueryEntry& r ) +{ + bDoQuery = r.bDoQuery; + bQueryByString = r.bQueryByString; + bQueryByDate = r.bQueryByDate; + eOp = r.eOp; + eConnect = r.eConnect; + nField = r.nField; + nVal = r.nVal; + *pStr = *r.pStr; + if ( pSearchParam ) + { + delete pSearchParam; + delete pSearchText; + } + pSearchParam = NULL; + pSearchText = NULL; + + return *this; +} + +void ScQueryEntry::Clear() +{ + bDoQuery = false; + bQueryByString = false; + bQueryByDate = false; + eOp = SC_EQUAL; + eConnect = SC_AND; + nField = 0; + nVal = 0.0; + pStr->Erase(); + if ( pSearchParam ) + { + delete pSearchParam; + delete pSearchText; + } + pSearchParam = NULL; + pSearchText = NULL; +} + +bool ScQueryEntry::operator==( const ScQueryEntry& r ) const +{ + return bDoQuery == r.bDoQuery + && bQueryByString == r.bQueryByString + && bQueryByDate == r.bQueryByDate + && eOp == r.eOp + && eConnect == r.eConnect + && nField == r.nField + && nVal == r.nVal + && *pStr == *r.pStr; + //! pSearchParam und pSearchText nicht vergleichen +} + +utl::TextSearch* ScQueryEntry::GetSearchTextPtr( bool bCaseSens ) const +{ + if ( !pSearchParam ) + { + pSearchParam = new utl::SearchParam( *pStr, utl::SearchParam::SRCH_REGEXP, + bCaseSens, false, false ); + pSearchText = new utl::TextSearch( *pSearchParam, *ScGlobal::pCharClass ); + } + return pSearchText; +} + // ============================================================================ ScQueryParamBase::ScQueryParamBase() : diff --git a/sc/source/filter/inc/excrecds.hxx b/sc/source/filter/inc/excrecds.hxx index 7da65c7c57c3..9689d0109fa0 100644 --- a/sc/source/filter/inc/excrecds.hxx +++ b/sc/source/filter/inc/excrecds.hxx @@ -62,6 +62,7 @@ class SfxItemSet; class EditTextObject; class ScPageHFItem; class ScProgress; +struct ScQueryEntry; class ExcTable; diff --git a/sc/source/filter/xml/XMLExportDataPilot.hxx b/sc/source/filter/xml/XMLExportDataPilot.hxx index 7fa4eee21f6d..5ea7bf8fd42d 100644 --- a/sc/source/filter/xml/XMLExportDataPilot.hxx +++ b/sc/source/filter/xml/XMLExportDataPilot.hxx @@ -43,6 +43,7 @@ class ScDPSaveGroupDimension; class ScDPSaveNumGroupDimension; struct ScDPNumGroupInfo; struct ScQueryParam; +struct ScQueryEntry; class ScXMLExportDataPilot { |