22#include <document.hxx>
89 std::vector<RowData> rowData;
90 for (
SCROW nRow = startRow; nRow <= endRow; ++nRow)
94 rowData.push_back(RowData{ nRow, cell.
getValue() });
110 sal_uInt32 format = 0;
116 std::stable_sort(rowData.begin(), rowData.end(),
117 [](
const RowData& d1,
const RowData& d2) { return d1.value < d2.value; });
119 for (
auto it = rowData.rbegin(); it != rowData.rend(); ++it)
122 for (
const RowData&
d : rowData)
132 std::vector<RowData> rowData;
137 for (
SCROW nRow = startRow; nRow <= endRow; ++nRow)
150 OUString
string = evaluator.
getCellString(cell, nRow, nCol, &sharedString);
153 rowData.push_back(RowData{ nRow,
string });
158 std::stable_sort(rowData.begin(), rowData.end(),
159 [&collator](
const RowData& d1,
const RowData& d2) {
160 return collator.compareString(d1.string, d2.string) < 0;
163 for (
auto it = rowData.rbegin(); it != rowData.rend(); ++it)
166 for (
const RowData&
d : rowData)
180 if (rHint.
GetId() == SfxHintId::ScDataChanged || rHint.
GetId() == SfxHintId::ScAreaChanged)
SC_DLLPUBLIC ScTable * FetchTable(SCTAB nTab)
bool ShrinkToDataArea(SCTAB nTab, SCCOL &rStartCol, SCROW &rStartRow, SCCOL &rEndCol, SCROW &rEndRow) const
Shrink a range to only include data area.
void RemoveSortedRangeCache(ScSortedRangeCache &rCache)
bool IsInDtorClear() const
ScRefCellValue GetRefCellValue(const ScAddress &rPos)
static SC_DLLPUBLIC CollatorWrapper & GetCollator()
case-insensitive collator
OUString getCellString(const ScRefCellValue &rCell, SCROW nRow, SCCOL nCol, const svl::SharedString **sharedString)
bool isMatchWholeCell(ScQueryOp eOp) const
static bool isQueryByValue(ScQueryOp eOp, ScQueryEntry::QueryType eType, const ScRefCellValue &rCell)
static bool isQueryByString(ScQueryOp eOp, ScQueryEntry::QueryType eType, const ScRefCellValue &rCell)
std::vector< SCROW > mSortedRows
std::vector< size_t > mRowToIndex
virtual void Notify(const SfxHint &rHint) override
Remove from document structure and delete (!) cache on modify hint.
ScQueryEntry::QueryType mQueryType
ScSortedRangeCache(ScDocument *pDoc, const ScRange &rRange, const ScQueryParam ¶m, ScInterpreterContext *context, bool invalid=false)
MUST be new'd because Notify() deletes.
static HashKey makeHashKey(const ScRange &range, const ScQueryParam ¶m)
const OUString & getString() const
static ScSortedRangeCache::ValueType toValueType(const ScQueryParam ¶m)
static bool needsDescending(ScQueryOp op)
SvNumberFormatter * GetFormatTable() const
Each instance of this struct represents a single filtering criteria.
const Item & GetQueryItem() const
QueryItemsType & GetQueryItems()
SC_DLLPUBLIC const ScQueryEntry & GetEntry(SCSIZE n) const
This is very similar to ScCellValue, except that it references the original value instead of copying ...
OUString getString(const ScDocument *pDoc) const
Retrieve string value.