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, SCCOL nCol, const svl::SharedString **sharedString)
 

Static Public Member Functions

static bool isQueryByValue (ScQueryOp eOp, ScQueryEntry::QueryType eType, const ScRefCellValue &rCell)
 
static bool isQueryByString (ScQueryOp eOp, ScQueryEntry::QueryType eType, const ScRefCellValue &rCell)
 
static bool isMatchWholeCell (const ScDocument &rDoc, ScQueryOp eOp)
 

Private Member Functions

bool isMatchWholeCell (ScQueryOp eOp) 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 (ScQueryOp eOp)
 
static bool isTextMatchOp (ScQueryOp eOp)
 
static bool isMatchWholeCellHelper (bool docMatchWholeCell, ScQueryOp eOp)
 
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::ScQueryEvaluator ( ScDocument rDoc,
const ScTable rTab,
const ScQueryParam rParam,
const ScInterpreterContext pContext = nullptr,
bool *  pTestEqualCondition = nullptr 
)

Member Function Documentation

◆ compareByBackgroundColor()

std::pair< bool, bool > ScQueryEvaluator::compareByBackgroundColor ( SCCOL  nCol,
SCROW  nRow,
const ScQueryEntry::Item rItem 
)
private

◆ compareByRangeLookup()

std::pair< bool, bool > ScQueryEvaluator::compareByRangeLookup ( const ScRefCellValue rCell,
const ScQueryEntry rEntry,
const ScQueryEntry::Item rItem 
)
staticprivate

◆ compareByString()

template<bool bFast>
std::pair< bool, bool > ScQueryEvaluator::compareByString ( const ScQueryEntry rEntry,
const ScQueryEntry::Item rItem,
const svl::SharedString pValueSource1,
const OUString *  pValueSource2 
)
private

◆ compareByTextColor()

std::pair< bool, bool > ScQueryEvaluator::compareByTextColor ( SCCOL  nCol,
SCROW  nRow,
const ScQueryEntry::Item rItem 
)
private

◆ compareByValue()

std::pair< bool, bool > ScQueryEvaluator::compareByValue ( const ScRefCellValue rCell,
SCCOL  nCol,
SCROW  nRow,
const ScQueryEntry rEntry,
const ScQueryEntry::Item rItem 
)
private

◆ getCellString()

OUString ScQueryEvaluator::getCellString ( const ScRefCellValue rCell,
SCROW  nRow,
SCCOL  nCol,
const svl::SharedString **  sharedString 
)

◆ getNumFmt()

sal_uInt32 ScQueryEvaluator::getNumFmt ( SCCOL  nCol,
SCROW  nRow 
)
private

◆ isFastCompareByString()

bool ScQueryEvaluator::isFastCompareByString ( const ScQueryEntry rEntry) const
private

◆ isMatchWholeCell() [1/2]

bool ScQueryEvaluator::isMatchWholeCell ( const ScDocument rDoc,
ScQueryOp  eOp 
)
static

◆ isMatchWholeCell() [2/2]

bool ScQueryEvaluator::isMatchWholeCell ( ScQueryOp  eOp) const
private

◆ isMatchWholeCellHelper()

bool ScQueryEvaluator::isMatchWholeCellHelper ( bool  docMatchWholeCell,
ScQueryOp  eOp 
)
staticprivate

Definition at line 71 of file queryevaluator.cxx.

References isPartialTextMatchOp().

Referenced by isMatchWholeCell().

◆ isPartialTextMatchOp()

bool ScQueryEvaluator::isPartialTextMatchOp ( ScQueryOp  eOp)
staticprivate

◆ isQueryByString()

bool ScQueryEvaluator::isQueryByString ( ScQueryOp  eOp,
ScQueryEntry::QueryType  eType,
const ScRefCellValue rCell 
)
static

◆ isQueryByValue()

bool ScQueryEvaluator::isQueryByValue ( ScQueryOp  eOp,
ScQueryEntry::QueryType  eType,
const ScRefCellValue rCell 
)
static

◆ isQueryByValueForCell()

bool ScQueryEvaluator::isQueryByValueForCell ( const ScRefCellValue rCell)
staticprivate

◆ isRealWildOrRegExp()

bool ScQueryEvaluator::isRealWildOrRegExp ( const ScQueryEntry rEntry) const
private

◆ isTestWildOrRegExp()

bool ScQueryEvaluator::isTestWildOrRegExp ( const ScQueryEntry rEntry) const
private

◆ isTextMatchOp()

bool ScQueryEvaluator::isTextMatchOp ( ScQueryOp  eOp)
staticprivate

◆ processEntry()

std::pair< bool, bool > ScQueryEvaluator::processEntry ( SCROW  nRow,
SCCOL  nCol,
ScRefCellValue aCell,
const ScQueryEntry rEntry,
size_t  nEntryIndex 
)
private

◆ setupCollatorIfNeeded()

void ScQueryEvaluator::setupCollatorIfNeeded ( )
private

Definition at line 96 of file queryevaluator.cxx.

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

Referenced by compareByString().

◆ setupTransliteratorIfNeeded()

void ScQueryEvaluator::setupTransliteratorIfNeeded ( )
private

◆ ValidQuery()

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

Member Data Documentation

◆ maBool

bool ScQueryEvaluator::maBool[nFixedBools]
private

Definition at line 65 of file queryevaluator.hxx.

Referenced by ScQueryEvaluator().

◆ maTest

bool ScQueryEvaluator::maTest[nFixedBools]
private

Definition at line 66 of file queryevaluator.hxx.

Referenced by ScQueryEvaluator().

◆ mbCaseSensitive

const bool ScQueryEvaluator::mbCaseSensitive
private

Definition at line 58 of file queryevaluator.hxx.

Referenced by compareByString().

◆ mbMatchWholeCell

const bool ScQueryEvaluator::mbMatchWholeCell
private

Definition at line 57 of file queryevaluator.hxx.

Referenced by isMatchWholeCell().

◆ mCachedSharedErrorStrings

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

Definition at line 70 of file queryevaluator.hxx.

Referenced by getCellString().

◆ mCachedSortedItemStrings

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

Definition at line 73 of file queryevaluator.hxx.

Referenced by processEntry().

◆ mCachedSortedItemValues

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

Definition at line 72 of file queryevaluator.hxx.

Referenced by processEntry().

◆ mnEntryCount

const SCSIZE ScQueryEvaluator::mnEntryCount
private

Definition at line 61 of file queryevaluator.hxx.

Referenced by ScQueryEvaluator().

◆ mpBoolDynamic

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

Definition at line 67 of file queryevaluator.hxx.

Referenced by ScQueryEvaluator().

◆ mpCollator

CollatorWrapper* ScQueryEvaluator::mpCollator
private

Definition at line 56 of file queryevaluator.hxx.

Referenced by compareByString(), and setupCollatorIfNeeded().

◆ mpContext

const ScInterpreterContext* ScQueryEvaluator::mpContext
private

Definition at line 59 of file queryevaluator.hxx.

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

◆ mpPasst

bool* ScQueryEvaluator::mpPasst
private

Definition at line 62 of file queryevaluator.hxx.

Referenced by ScQueryEvaluator(), and ValidQuery().

◆ mpTest

bool* ScQueryEvaluator::mpTest
private

Definition at line 63 of file queryevaluator.hxx.

Referenced by ScQueryEvaluator(), and ValidQuery().

◆ mpTestDynamic

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

Definition at line 68 of file queryevaluator.hxx.

Referenced by ScQueryEvaluator().

◆ mpTestEqualCondition

bool* ScQueryEvaluator::mpTestEqualCondition
private

◆ mpTransliteration

utl::TransliterationWrapper* ScQueryEvaluator::mpTransliteration
private

Definition at line 55 of file queryevaluator.hxx.

Referenced by compareByString(), and setupTransliteratorIfNeeded().

◆ mrDoc

ScDocument& ScQueryEvaluator::mrDoc
private

Definition at line 50 of file queryevaluator.hxx.

Referenced by compareByValue(), and getCellString().

◆ mrParam

const ScQueryParam& ScQueryEvaluator::mrParam
private

◆ mrStrPool

svl::SharedStringPool& ScQueryEvaluator::mrStrPool
private

Definition at line 51 of file queryevaluator.hxx.

Referenced by compareByString(), and getCellString().

◆ mrTab

const ScTable& ScQueryEvaluator::mrTab
private

◆ nFixedBools

constexpr SCSIZE ScQueryEvaluator::nFixedBools = 32
staticconstexprprivate

Definition at line 64 of file queryevaluator.hxx.

Referenced by ScQueryEvaluator().


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