LibreOffice Module sc (master)  1
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
ScQueryEvaluator Class Reference

#include <queryevaluator.hxx>

Collaboration diagram for ScQueryEvaluator:
[legend]

Public Member Functions

 ScQueryEvaluator (ScDocument &rDoc, const ScTable &rTab, const ScQueryParam &rParam, const ScInterpreterContext *pContext=nullptr, bool *pTestEqualCondition=nullptr)
 
bool ValidQuery (SCROW nRow, const ScRefCellValue *pCell=nullptr, sc::TableColumnBlockPositionSet *pBlockPos=nullptr)
 
OUString getCellString (const ScRefCellValue &rCell, SCROW nRow, const ScQueryEntry &rEntry, const svl::SharedString **sharedString)
 

Static Public Member Functions

static bool isQueryByValue (const ScQueryEntry &rEntry, const ScQueryEntry::Item &rItem, const ScRefCellValue &rCell)
 
static bool isQueryByString (const ScQueryEntry &rEntry, const ScQueryEntry::Item &rItem, const ScRefCellValue &rCell)
 
static bool isMatchWholeCell (const ScDocument &rDoc, const ScQueryEntry &rEntry)
 

Private Member Functions

bool isMatchWholeCell (const ScQueryEntry &rEntry) const
 
void setupTransliteratorIfNeeded ()
 
void setupCollatorIfNeeded ()
 
bool isRealWildOrRegExp (const ScQueryEntry &rEntry) const
 
bool isTestWildOrRegExp (const ScQueryEntry &rEntry) const
 
sal_uInt32 getNumFmt (SCCOL nCol, SCROW nRow)
 
std::pair< bool, bool > compareByValue (const ScRefCellValue &rCell, SCCOL nCol, SCROW nRow, const ScQueryEntry &rEntry, const ScQueryEntry::Item &rItem)
 
bool isFastCompareByString (const ScQueryEntry &rEntry) const
 
template<bool bFast = false>
std::pair< bool, bool > compareByString (const ScQueryEntry &rEntry, const ScQueryEntry::Item &rItem, const svl::SharedString *pValueSource1, const OUString *pValueSource2)
 
std::pair< bool, bool > compareByTextColor (SCCOL nCol, SCROW nRow, const ScQueryEntry::Item &rItem)
 
std::pair< bool, bool > compareByBackgroundColor (SCCOL nCol, SCROW nRow, const ScQueryEntry::Item &rItem)
 
std::pair< bool, bool > processEntry (SCROW nRow, SCCOL nCol, ScRefCellValue &aCell, const ScQueryEntry &rEntry, size_t nEntryIndex)
 

Static Private Member Functions

static bool isPartialTextMatchOp (const ScQueryEntry &rEntry)
 
static bool isTextMatchOp (const ScQueryEntry &rEntry)
 
static bool isMatchWholeCellHelper (bool docMatchWholeCell, const ScQueryEntry &rEntry)
 
static bool isQueryByValueForCell (const ScRefCellValue &rCell)
 
static std::pair< bool, bool > compareByRangeLookup (const ScRefCellValue &rCell, const ScQueryEntry &rEntry, const ScQueryEntry::Item &rItem)
 

Private Attributes

ScDocumentmrDoc
 
svl::SharedStringPoolmrStrPool
 
const ScTablemrTab
 
const ScQueryParammrParam
 
bool * mpTestEqualCondition
 
utl::TransliterationWrappermpTransliteration
 
CollatorWrappermpCollator
 
const bool mbMatchWholeCell
 
const bool mbCaseSensitive
 
const ScInterpreterContextmpContext
 
const SCSIZE mnEntryCount
 
bool * mpPasst
 
bool * mpTest
 
bool maBool [nFixedBools]
 
bool maTest [nFixedBools]
 
std::unique_ptr< bool[]> mpBoolDynamic
 
std::unique_ptr< bool[]> mpTestDynamic
 
std::unordered_map< FormulaError, svl::SharedStringmCachedSharedErrorStrings
 
std::vector< std::vector< double > > mCachedSortedItemValues
 
std::vector< std::vector< const rtl_uString * > > mCachedSortedItemStrings
 

Static Private Attributes

static constexpr SCSIZE nFixedBools = 32
 

Detailed Description

Definition at line 48 of file queryevaluator.hxx.

Constructor & Destructor Documentation

ScQueryEvaluator::ScQueryEvaluator ( ScDocument rDoc,
const ScTable rTab,
const ScQueryParam rParam,
const ScInterpreterContext pContext = nullptr,
bool *  pTestEqualCondition = nullptr 
)

Member Function Documentation

std::pair< bool, bool > ScQueryEvaluator::compareByBackgroundColor ( SCCOL  nCol,
SCROW  nRow,
const ScQueryEntry::Item rItem 
)
private
std::pair< bool, bool > ScQueryEvaluator::compareByRangeLookup ( const ScRefCellValue rCell,
const ScQueryEntry rEntry,
const ScQueryEntry::Item rItem 
)
staticprivate
template<bool bFast>
std::pair< bool, bool > ScQueryEvaluator::compareByString ( const ScQueryEntry rEntry,
const ScQueryEntry::Item rItem,
const svl::SharedString pValueSource1,
const OUString *  pValueSource2 
)
private
std::pair< bool, bool > ScQueryEvaluator::compareByTextColor ( SCCOL  nCol,
SCROW  nRow,
const ScQueryEntry::Item rItem 
)
private
std::pair< bool, bool > ScQueryEvaluator::compareByValue ( const ScRefCellValue rCell,
SCCOL  nCol,
SCROW  nRow,
const ScQueryEntry rEntry,
const ScQueryEntry::Item rItem 
)
private
OUString ScQueryEvaluator::getCellString ( const ScRefCellValue rCell,
SCROW  nRow,
const ScQueryEntry rEntry,
const svl::SharedString **  sharedString 
)
sal_uInt32 ScQueryEvaluator::getNumFmt ( SCCOL  nCol,
SCROW  nRow 
)
private
bool ScQueryEvaluator::isFastCompareByString ( const ScQueryEntry rEntry) const
private
bool ScQueryEvaluator::isMatchWholeCell ( const ScQueryEntry rEntry) const
private
bool ScQueryEvaluator::isMatchWholeCell ( const ScDocument rDoc,
const ScQueryEntry rEntry 
)
static
bool ScQueryEvaluator::isMatchWholeCellHelper ( bool  docMatchWholeCell,
const ScQueryEntry rEntry 
)
staticprivate

Definition at line 71 of file queryevaluator.cxx.

References isPartialTextMatchOp().

Referenced by isMatchWholeCell().

bool ScQueryEvaluator::isPartialTextMatchOp ( const ScQueryEntry rEntry)
staticprivate
bool ScQueryEvaluator::isQueryByString ( const ScQueryEntry rEntry,
const ScQueryEntry::Item rItem,
const ScRefCellValue rCell 
)
static
bool ScQueryEvaluator::isQueryByValue ( const ScQueryEntry rEntry,
const ScQueryEntry::Item rItem,
const ScRefCellValue rCell 
)
static
bool ScQueryEvaluator::isQueryByValueForCell ( const ScRefCellValue rCell)
staticprivate
bool ScQueryEvaluator::isRealWildOrRegExp ( const ScQueryEntry rEntry) const
private
bool ScQueryEvaluator::isTestWildOrRegExp ( const ScQueryEntry rEntry) const
private
bool ScQueryEvaluator::isTextMatchOp ( const ScQueryEntry rEntry)
staticprivate
std::pair< bool, bool > ScQueryEvaluator::processEntry ( SCROW  nRow,
SCCOL  nCol,
ScRefCellValue aCell,
const ScQueryEntry rEntry,
size_t  nEntryIndex 
)
private
void ScQueryEvaluator::setupCollatorIfNeeded ( )
private

Definition at line 96 of file queryevaluator.cxx.

References ScQueryParamBase::bCaseSens, ScGlobal::GetCollator(), mpCollator, and mrParam.

Referenced by compareByString().

void ScQueryEvaluator::setupTransliteratorIfNeeded ( )
private
bool ScQueryEvaluator::ValidQuery ( SCROW  nRow,
const ScRefCellValue pCell = nullptr,
sc::TableColumnBlockPositionSet pBlockPos = nullptr 
)

Member Data Documentation

bool ScQueryEvaluator::maBool[nFixedBools]
private

Definition at line 65 of file queryevaluator.hxx.

Referenced by ScQueryEvaluator().

bool ScQueryEvaluator::maTest[nFixedBools]
private

Definition at line 66 of file queryevaluator.hxx.

Referenced by ScQueryEvaluator().

const bool ScQueryEvaluator::mbCaseSensitive
private

Definition at line 58 of file queryevaluator.hxx.

Referenced by compareByString().

const bool ScQueryEvaluator::mbMatchWholeCell
private

Definition at line 57 of file queryevaluator.hxx.

Referenced by isMatchWholeCell().

std::unordered_map<FormulaError, svl::SharedString> ScQueryEvaluator::mCachedSharedErrorStrings
private

Definition at line 70 of file queryevaluator.hxx.

Referenced by getCellString().

std::vector<std::vector<const rtl_uString*> > ScQueryEvaluator::mCachedSortedItemStrings
private

Definition at line 73 of file queryevaluator.hxx.

Referenced by processEntry().

std::vector<std::vector<double> > ScQueryEvaluator::mCachedSortedItemValues
private

Definition at line 72 of file queryevaluator.hxx.

Referenced by processEntry().

const SCSIZE ScQueryEvaluator::mnEntryCount
private

Definition at line 61 of file queryevaluator.hxx.

Referenced by ScQueryEvaluator().

std::unique_ptr<bool[]> ScQueryEvaluator::mpBoolDynamic
private

Definition at line 67 of file queryevaluator.hxx.

Referenced by ScQueryEvaluator().

CollatorWrapper* ScQueryEvaluator::mpCollator
private

Definition at line 56 of file queryevaluator.hxx.

Referenced by compareByString(), and setupCollatorIfNeeded().

const ScInterpreterContext* ScQueryEvaluator::mpContext
private

Definition at line 59 of file queryevaluator.hxx.

Referenced by compareByValue(), getCellString(), and getNumFmt().

bool* ScQueryEvaluator::mpPasst
private

Definition at line 62 of file queryevaluator.hxx.

Referenced by ScQueryEvaluator(), and ValidQuery().

bool* ScQueryEvaluator::mpTest
private

Definition at line 63 of file queryevaluator.hxx.

Referenced by ScQueryEvaluator(), and ValidQuery().

std::unique_ptr<bool[]> ScQueryEvaluator::mpTestDynamic
private

Definition at line 68 of file queryevaluator.hxx.

Referenced by ScQueryEvaluator().

bool* ScQueryEvaluator::mpTestEqualCondition
private
utl::TransliterationWrapper* ScQueryEvaluator::mpTransliteration
private

Definition at line 55 of file queryevaluator.hxx.

Referenced by compareByString(), and setupTransliteratorIfNeeded().

ScDocument& ScQueryEvaluator::mrDoc
private
const ScQueryParam& ScQueryEvaluator::mrParam
private
svl::SharedStringPool& ScQueryEvaluator::mrStrPool
private

Definition at line 51 of file queryevaluator.hxx.

Referenced by compareByString(), and getCellString().

const ScTable& ScQueryEvaluator::mrTab
private
constexpr SCSIZE ScQueryEvaluator::nFixedBools = 32
staticprivate

Definition at line 64 of file queryevaluator.hxx.

Referenced by ScQueryEvaluator().


The documentation for this class was generated from the following files: