diff options
author | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-11-05 01:05:29 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-11-05 01:05:29 -0400 |
commit | 9c8670847f0945c05c8f40e83f0d845c0d3cff6b (patch) | |
tree | e33fd1fe17c7e034534718319c55cb33e1abda09 /sc | |
parent | 7b6b60608b8a403e39b2919ba1c186fd64ea1f77 (diff) |
Removed queryentry.hxx include from lookupcache.hxx header.
For better encapsulation of ScQueryEntry.
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/lookupcache.hxx | 43 | ||||
-rw-r--r-- | sc/source/core/tool/lookupcache.cxx | 43 |
2 files changed, 46 insertions, 40 deletions
diff --git a/sc/inc/lookupcache.hxx b/sc/inc/lookupcache.hxx index 49b5def70d2d..d70b1b5d6dea 100644 --- a/sc/inc/lookupcache.hxx +++ b/sc/inc/lookupcache.hxx @@ -32,7 +32,6 @@ #include "address.hxx" #include "global.hxx" #include "queryparam.hxx" -#include "queryentry.hxx" #include "formula/token.hxx" #include <svl/listener.hxx> #include <tools/string.hxx> @@ -91,45 +90,9 @@ public: public: - explicit QueryCriteria( const ScQueryEntry & rEntry ) : - mfVal(0.0), mbAlloc(false), mbString(false) - { - switch (rEntry.eOp) - { - case SC_EQUAL : - meOp = EQUAL; - break; - case SC_LESS_EQUAL : - meOp = LESS_EQUAL; - break; - case SC_GREATER_EQUAL : - meOp = GREATER_EQUAL; - break; - default: - meOp = UNKNOWN; - DBG_ERRORFILE( "ScLookupCache::QueryCriteria not prepared for this ScQueryOp"); - } - if (rEntry.bQueryByString) - setString(rEntry.GetQueryString()); - else - setDouble( rEntry.nVal); - } - QueryCriteria( const QueryCriteria & r ) : - mfVal( r.mfVal), - mbAlloc( false), - mbString( false), - meOp( r.meOp) - { - if (r.mbString && r.mpStr) - { - mpStr = new String( *r.mpStr); - mbAlloc = mbString = true; - } - } - ~QueryCriteria() - { - deleteString(); - } + explicit QueryCriteria( const ScQueryEntry & rEntry ); + QueryCriteria( const QueryCriteria & r ); + ~QueryCriteria(); QueryOp getQueryOp() const { return meOp; } diff --git a/sc/source/core/tool/lookupcache.cxx b/sc/source/core/tool/lookupcache.cxx index 1fbc1ec78975..3c82a2a3e083 100644 --- a/sc/source/core/tool/lookupcache.cxx +++ b/sc/source/core/tool/lookupcache.cxx @@ -31,6 +31,49 @@ #include "lookupcache.hxx" #include "document.hxx" +#include "queryentry.hxx" + +ScLookupCache::QueryCriteria::QueryCriteria( const ScQueryEntry& rEntry ) : + mfVal(0.0), mbAlloc(false), mbString(false) +{ + switch (rEntry.eOp) + { + case SC_EQUAL : + meOp = EQUAL; + break; + case SC_LESS_EQUAL : + meOp = LESS_EQUAL; + break; + case SC_GREATER_EQUAL : + meOp = GREATER_EQUAL; + break; + default: + meOp = UNKNOWN; + DBG_ERRORFILE( "ScLookupCache::QueryCriteria not prepared for this ScQueryOp"); + } + if (rEntry.bQueryByString) + setString(rEntry.GetQueryString()); + else + setDouble( rEntry.nVal); +} + +ScLookupCache::QueryCriteria::QueryCriteria( const ScLookupCache::QueryCriteria & r ) : + mfVal( r.mfVal), + mbAlloc( false), + mbString( false), + meOp( r.meOp) +{ + if (r.mbString && r.mpStr) + { + mpStr = new String( *r.mpStr); + mbAlloc = mbString = true; + } +} + +ScLookupCache::QueryCriteria::~QueryCriteria() +{ + deleteString(); +} ScLookupCache::ScLookupCache( ScDocument * pDoc, const ScRange & rRange ) : maRange( rRange), |