LibreOffice Module sc (master) 1
|
#include <queryevaluator.hxx>
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 | |
ScDocument & | mrDoc |
svl::SharedStringPool & | mrStrPool |
const ScTable & | mrTab |
const ScQueryParam & | mrParam |
bool * | mpTestEqualCondition |
utl::TransliterationWrapper * | mpTransliteration |
CollatorWrapper * | mpCollator |
const bool | mbMatchWholeCell |
const bool | mbCaseSensitive |
const ScInterpreterContext * | mpContext |
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::SharedString > | mCachedSharedErrorStrings |
std::vector< std::vector< double > > | mCachedSortedItemValues |
std::vector< std::vector< const rtl_uString * > > | mCachedSortedItemStrings |
Static Private Attributes | |
static constexpr SCSIZE | nFixedBools = 32 |
Definition at line 48 of file queryevaluator.hxx.
ScQueryEvaluator::ScQueryEvaluator | ( | ScDocument & | rDoc, |
const ScTable & | rTab, | ||
const ScQueryParam & | rParam, | ||
const ScInterpreterContext * | pContext = nullptr , |
||
bool * | pTestEqualCondition = nullptr |
||
) |
Definition at line 102 of file queryevaluator.cxx.
References maBool, maTest, mnEntryCount, mpBoolDynamic, mpContext, mpPasst, mpTest, mpTestDynamic, and nFixedBools.
|
private |
Definition at line 602 of file queryevaluator.cxx.
References ScTable::GetCellBackgroundColor(), ScTable::GetTab(), ScQueryEntry::Item::maColor, and mrTab.
Referenced by processEntry().
|
staticprivate |
Definition at line 615 of file queryevaluator.cxx.
References ScQueryEntry::ByString, CELLTYPE_FORMULA, ScQueryEntry::eOp, ScFormulaCell::GetErrCode(), ScRefCellValue::getFormula(), ScRefCellValue::getType(), ScRefCellValue::hasNumeric(), ScQueryEntry::Item::meType, SC_GREATER, SC_GREATER_EQUAL, SC_LESS, and SC_LESS_EQUAL.
Referenced by processEntry().
|
private |
Definition at line 352 of file queryevaluator.cxx.
References ScQueryParamBase::bCaseSens, ScQueryEntry::ByString, CollatorWrapper::compareString(), ScQueryEntry::eOp, ScQueryParamBase::eSearchType, svl::SharedString::getData(), svl::SharedString::getDataIgnoreCase(), svl::SharedString::getEmptyString(), ScQueryEntry::GetSearchTextPtr(), svl::SharedString::getString(), svl::SharedStringPool::intern(), svl::SharedString::isEmpty(), isMatchWholeCell(), isRealWildOrRegExp(), isTestWildOrRegExp(), isTextMatchOp(), ScQueryEntry::Item::maString, mbCaseSensitive, ScQueryEntry::Item::meType, mpCollator, mpTestEqualCondition, mpTransliteration, mrParam, mrStrPool, nIndex, ScGlobal::oSysLocale, SC_BEGINS_WITH, SC_CONTAINS, SC_DOES_NOT_BEGIN_WITH, SC_DOES_NOT_CONTAIN, SC_DOES_NOT_END_WITH, SC_ENDS_WITH, SC_EQUAL, SC_GREATER, SC_GREATER_EQUAL, SC_LESS, SC_LESS_EQUAL, SC_NOT_EQUAL, utl::TextSearch::SearchBackward(), utl::TextSearch::SearchForward(), setupCollatorIfNeeded(), setupTransliteratorIfNeeded(), and utl::TransliterationWrapper::transliterate().
Referenced by processEntry().
|
private |
Definition at line 592 of file queryevaluator.cxx.
References ScTable::GetCellTextColor(), ScTable::GetTab(), ScQueryEntry::Item::maColor, and mrTab.
Referenced by processEntry().
|
private |
Definition at line 192 of file queryevaluator.cxx.
References ScQueryEntry::ByDate, CELLTYPE_FORMULA, CELLTYPE_VALUE, ScQueryEntry::eOp, ScRefCellValue::getDouble(), SvNumberFormatter::GetEntry(), ScDocument::GetFormatTable(), ScInterpreterContext::GetFormatTable(), ScRefCellValue::getFormula(), getNumFmt(), SvNumberformat::GetType(), ScRefCellValue::getType(), ScFormulaCell::GetValue(), ScQueryEntry::Item::mbRoundForFilter, ScQueryEntry::Item::meType, ScQueryEntry::Item::mfVal, mpContext, mpTestEqualCondition, mrDoc, NUMBERFORMAT_ENTRY_NOT_FOUND, ScDocument::RoundValueAsShown(), SC_EQUAL, SC_GREATER, SC_GREATER_EQUAL, SC_LESS, SC_LESS_EQUAL, and SC_NOT_EQUAL.
Referenced by processEntry().
OUString ScQueryEvaluator::getCellString | ( | const ScRefCellValue & | rCell, |
SCROW | nRow, | ||
SCCOL | nCol, | ||
const svl::SharedString ** | sharedString | ||
) |
Definition at line 301 of file queryevaluator.cxx.
References CELLTYPE_FORMULA, CELLTYPE_STRING, ScFormulaCell::GetErrCode(), ScGlobal::GetErrorString(), ScDocument::GetFormatTable(), ScInterpreterContext::GetFormatTable(), ScRefCellValue::getFormula(), ScCellFormat::GetInputString(), ScTable::GetNumberFormat(), ScRefCellValue::getSharedString(), ScTable::GetTab(), ScRefCellValue::getType(), svl::SharedStringPool::intern(), mCachedSharedErrorStrings, mpContext, mrDoc, mrStrPool, mrTab, and pos.
Referenced by processEntry(), and ScSortedRangeCache::ScSortedRangeCache().
Definition at line 181 of file queryevaluator.cxx.
References ScTable::GetNumberFormat(), ScTable::GetTab(), mpContext, mrTab, and SV_COUNTRY_LANGUAGE_OFFSET.
Referenced by compareByValue().
|
private |
Definition at line 336 of file queryevaluator.cxx.
References ScQueryEntry::eOp, isMatchWholeCell(), isRealWildOrRegExp(), isTestWildOrRegExp(), and SC_EQUAL.
Referenced by processEntry().
|
static |
Definition at line 85 of file queryevaluator.cxx.
References ScDocument::GetDocOptions(), ScDocOptions::IsMatchWholeCell(), and isMatchWholeCellHelper().
|
private |
Definition at line 80 of file queryevaluator.cxx.
References isMatchWholeCellHelper(), and mbMatchWholeCell.
Referenced by CanBeUsedForSorterCache(), compareByString(), isFastCompareByString(), and ScSortedRangeCache::ScSortedRangeCache().
|
staticprivate |
Definition at line 71 of file queryevaluator.cxx.
References isPartialTextMatchOp().
Referenced by isMatchWholeCell().
|
staticprivate |
Definition at line 38 of file queryevaluator.cxx.
References SC_BEGINS_WITH, SC_CONTAINS, SC_DOES_NOT_BEGIN_WITH, SC_DOES_NOT_CONTAIN, SC_DOES_NOT_END_WITH, and SC_ENDS_WITH.
Referenced by isMatchWholeCellHelper(), isQueryByValue(), and isTextMatchOp().
|
static |
Definition at line 169 of file queryevaluator.cxx.
References ScQueryEntry::ByString, eType, ScRefCellValue::hasString(), and isTextMatchOp().
Referenced by processEntry(), and ScSortedRangeCache::ScSortedRangeCache().
|
static |
Definition at line 150 of file queryevaluator.cxx.
References ScQueryEntry::ByString, eType, isPartialTextMatchOp(), and isQueryByValueForCell().
Referenced by processEntry(), and ScSortedRangeCache::ScSortedRangeCache().
|
staticprivate |
Definition at line 159 of file queryevaluator.cxx.
References CELLTYPE_FORMULA, ScFormulaCell::GetErrCode(), ScRefCellValue::getFormula(), ScRefCellValue::getType(), and ScRefCellValue::hasNumeric().
Referenced by isQueryByValue(), and processEntry().
|
private |
Definition at line 131 of file queryevaluator.cxx.
References ScQueryEntry::eOp, ScQueryParamBase::eSearchType, isTextMatchOp(), mrParam, and utl::SearchParam::Normal.
Referenced by compareByString(), and isFastCompareByString().
|
private |
Definition at line 139 of file queryevaluator.cxx.
References ScQueryEntry::eOp, ScQueryParamBase::eSearchType, mpTestEqualCondition, mrParam, utl::SearchParam::Normal, SC_GREATER_EQUAL, and SC_LESS_EQUAL.
Referenced by compareByString(), and isFastCompareByString().
|
staticprivate |
Definition at line 55 of file queryevaluator.cxx.
References isPartialTextMatchOp(), SC_EQUAL, and SC_NOT_EQUAL.
Referenced by compareByString(), isQueryByString(), and isRealWildOrRegExp().
|
private |
Definition at line 642 of file queryevaluator.cxx.
References ScQueryParamBase::bCaseSens, ScQueryEntry::ByBackgroundColor, ScQueryEntry::ByEmpty, ScQueryEntry::ByString, ScQueryEntry::ByTextColor, ScQueryEntry::ByValue, CELLTYPE_FORMULA, CELLTYPE_VALUE, compareByBackgroundColor(), compareByRangeLookup(), compareByString(), compareByTextColor(), compareByValue(), ScQueryEntry::eOp, getCellString(), svl::SharedString::getData(), svl::SharedString::getDataIgnoreCase(), ScRefCellValue::getDouble(), ScFormulaCell::GetErrCode(), ScRefCellValue::getFormula(), ScQueryEntry::GetQueryItems(), ScRefCellValue::getType(), ScFormulaCell::GetValue(), ScRefCellValue::isEmpty(), isFastCompareByString(), ScQueryEntry::IsQueryByEmpty(), ScQueryEntry::IsQueryByNonEmpty(), isQueryByString(), isQueryByValue(), isQueryByValueForCell(), ScFormulaCell::IsValue(), ScQueryParamBase::mbRangeLookup, mCachedSortedItemStrings, mCachedSortedItemValues, mpTestEqualCondition, mrParam, ScQueryEntry::nField, SC_EQUAL, value, and values.
Referenced by ValidQuery().
|
private |
Definition at line 96 of file queryevaluator.cxx.
References ScQueryParamBase::bCaseSens, ScGlobal::GetCollator(), mpCollator, and mrParam.
Referenced by compareByString().
|
private |
Definition at line 90 of file queryevaluator.cxx.
References ScQueryParamBase::bCaseSens, ScGlobal::GetTransliteration(), mpTransliteration, and mrParam.
Referenced by compareByString().
bool ScQueryEvaluator::ValidQuery | ( | SCROW | nRow, |
const ScRefCellValue * | pCell = nullptr , |
||
sc::TableColumnBlockPositionSet * | pBlockPos = nullptr |
||
) |
Definition at line 827 of file queryevaluator.cxx.
References ScQueryEntry::bDoQuery, ScQueryParamBase::begin(), ScQueryEntry::eConnect, ScQueryParamBase::end(), sc::TableColumnBlockPositionSet::getBlockPosition(), ScTable::GetCellValue(), ScQueryParamBase::GetEntry(), mpPasst, mpTest, mpTestEqualCondition, mrParam, mrTab, ScQueryEntry::nField, nPos, processEntry(), and SC_AND.
Referenced by ScTable::GetFilteredFilterEntries(), ScDBQueryDataIterator::IsQueryValid(), and ScTable::Query().
|
private |
Definition at line 65 of file queryevaluator.hxx.
Referenced by ScQueryEvaluator().
|
private |
Definition at line 66 of file queryevaluator.hxx.
Referenced by ScQueryEvaluator().
|
private |
Definition at line 58 of file queryevaluator.hxx.
Referenced by compareByString().
|
private |
Definition at line 57 of file queryevaluator.hxx.
Referenced by isMatchWholeCell().
|
private |
Definition at line 70 of file queryevaluator.hxx.
Referenced by getCellString().
|
private |
Definition at line 73 of file queryevaluator.hxx.
Referenced by processEntry().
|
private |
Definition at line 72 of file queryevaluator.hxx.
Referenced by processEntry().
|
private |
Definition at line 61 of file queryevaluator.hxx.
Referenced by ScQueryEvaluator().
|
private |
Definition at line 67 of file queryevaluator.hxx.
Referenced by ScQueryEvaluator().
|
private |
Definition at line 56 of file queryevaluator.hxx.
Referenced by compareByString(), and setupCollatorIfNeeded().
|
private |
Definition at line 59 of file queryevaluator.hxx.
Referenced by compareByValue(), getCellString(), and getNumFmt().
|
private |
Definition at line 62 of file queryevaluator.hxx.
Referenced by ScQueryEvaluator(), and ValidQuery().
|
private |
Definition at line 63 of file queryevaluator.hxx.
Referenced by ScQueryEvaluator(), and ValidQuery().
|
private |
Definition at line 68 of file queryevaluator.hxx.
Referenced by ScQueryEvaluator().
|
private |
Definition at line 54 of file queryevaluator.hxx.
Referenced by compareByString(), compareByValue(), isTestWildOrRegExp(), processEntry(), and ValidQuery().
|
private |
Definition at line 55 of file queryevaluator.hxx.
Referenced by compareByString(), and setupTransliteratorIfNeeded().
|
private |
Definition at line 50 of file queryevaluator.hxx.
Referenced by compareByValue(), and getCellString().
|
private |
Definition at line 53 of file queryevaluator.hxx.
Referenced by compareByString(), isRealWildOrRegExp(), isTestWildOrRegExp(), processEntry(), setupCollatorIfNeeded(), setupTransliteratorIfNeeded(), and ValidQuery().
|
private |
Definition at line 51 of file queryevaluator.hxx.
Referenced by compareByString(), and getCellString().
|
private |
Definition at line 52 of file queryevaluator.hxx.
Referenced by compareByBackgroundColor(), compareByTextColor(), getCellString(), getNumFmt(), and ValidQuery().
|
staticconstexprprivate |
Definition at line 64 of file queryevaluator.hxx.
Referenced by ScQueryEvaluator().