summaryrefslogtreecommitdiffstats
path: root/sc/inc/queryentry.hxx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@suse.com>2011-11-07 17:40:38 -0500
committerKohei Yoshida <kohei.yoshida@suse.com>2011-11-07 21:33:02 -0500
commit8808d77f199720be596a09084fbc36569ed2f1f1 (patch)
treecf13a63ef1db80a7e48655e6b431b8712ea2aef6 /sc/inc/queryentry.hxx
parentdeliver .h also from np_sdk/inc (diff)
downloadcore-8808d77f199720be596a09084fbc36569ed2f1f1.tar.gz
core-8808d77f199720be596a09084fbc36569ed2f1f1.zip
Changed data storage structure in ScQueryEntry.
This required a whole bunch of chnages all over the place.
Diffstat (limited to 'sc/inc/queryentry.hxx')
-rw-r--r--sc/inc/queryentry.hxx31
1 files changed, 21 insertions, 10 deletions
diff --git a/sc/inc/queryentry.hxx b/sc/inc/queryentry.hxx
index 48f7637c97d8..c0ce6e40d686 100644
--- a/sc/inc/queryentry.hxx
+++ b/sc/inc/queryentry.hxx
@@ -44,15 +44,23 @@ namespace utl {
*/
struct ScQueryEntry
{
- typedef std::vector<rtl::OUString> QueryStringsType;
+ enum QueryType { ByValue, ByString, ByDate };
+
+ struct Item
+ {
+ QueryType meType;
+ double mfVal;
+ rtl::OUString maString;
+
+ bool operator== (const Item& r) const;
+ Item();
+ };
+ typedef std::vector<Item> QueryItemsType;
bool bDoQuery;
- bool bQueryByString;
- bool bQueryByDate;
SCCOLROW nField;
ScQueryOp eOp;
ScQueryConnect eConnect;
- double nVal;
mutable utl::SearchParam* pSearchParam; // if RegExp, not saved
mutable utl::TextSearch* pSearchText; // if RegExp, not saved
@@ -63,16 +71,19 @@ struct ScQueryEntry
// creates pSearchParam and pSearchText if necessary, always RegExp!
utl::TextSearch* GetSearchTextPtr( bool bCaseSens ) const;
- bool IsQueryStringEmpty() const;
- bool MatchByString(const rtl::OUString& rStr, bool bCaseSens) const;
- void SortQueryStrings(bool bCaseSens);
- SC_DLLPUBLIC void SetQueryString(const rtl::OUString& rStr);
- SC_DLLPUBLIC rtl::OUString GetQueryString() const;
+ SC_DLLPUBLIC const Item& GetQueryItem() const;
+ SC_DLLPUBLIC Item& GetQueryItem();
void Clear();
ScQueryEntry& operator=( const ScQueryEntry& r );
bool operator==( const ScQueryEntry& r ) const;
+
private:
- QueryStringsType maQueryStrings;
+ /**
+ * Stores all query items. It must contain at least one item at all times
+ * (for single equality match queries or comparative queries). It may
+ * contain multiple items for multi-equality match queries.
+ */
+ mutable QueryItemsType maQueryItems;
};
#endif