22 #include <document.hxx>
26 #include <globstr.hrc>
36 #include <rtl/math.hxx>
44 #include <osl/diagnose.h>
47 #include <com/sun/star/sheet/DataPilotFieldGroupBy.hpp>
53 #define ENABLE_THREADED_PIVOT_CACHE 0
55 #if ENABLE_THREADED_PIVOT_CACHE
63 using ::com::sun::star::uno::Exception;
68 maInfo(rInfo), mnGroupType(nGroupType) {}
84 struct ClearObjectSource
108 class MacroInterpretIncrementer
111 explicit MacroInterpretIncrementer(
ScDocument& rDoc) :
114 mrDoc.IncMacroInterpretLevel();
116 ~MacroInterpretIncrementer()
118 mrDoc.DecMacroInterpretLevel();
126 return rPool.insert(rStr).first->pData;
133 if (aDocStr.isEmpty())
174 mnOrderIndex(0), mnDataIndex(0) {}
176 maValue(rValue), mnOrderIndex(0), mnDataIndex(nData) {}
179 #if DEBUG_PIVOT_TABLE
186 void operator() (
const Bucket& v)
const
188 cout <<
"value: " << v.maValue.GetValue() <<
" order index: " << v.mnOrderIndex <<
" data index: " << v.mnDataIndex <<
endl;
196 bool operator() (
const Bucket& left,
const Bucket& right)
const
198 return left.maValue < right.maValue;
202 struct LessByOrderIndex
204 bool operator() (
const Bucket& left,
const Bucket& right)
const
206 return left.mnOrderIndex < right.mnOrderIndex;
210 struct LessByDataIndex
212 bool operator() (
const Bucket& left,
const Bucket& right)
const
214 return left.mnDataIndex < right.mnDataIndex;
218 struct EqualByOrderIndex
220 bool operator() (
const Bucket& left,
const Bucket& right)
const
222 return left.mnOrderIndex == right.mnOrderIndex;
231 void operator() (
const Bucket& v)
233 mrItems.push_back(v.maValue);
237 class PushBackOrderIndex
242 void operator() (
const Bucket& v)
244 mrData.push_back(v.mnOrderIndex);
248 void processBuckets(std::vector<Bucket>& aBuckets,
ScDPCache::Field& rField)
250 if (aBuckets.empty())
259 std::vector<Bucket>::iterator it = aBuckets.begin(), itEnd = aBuckets.end();
261 it->mnOrderIndex = nCurIndex;
262 for (++it; it != itEnd; ++it)
267 it->mnOrderIndex = nCurIndex;
276 rField.
maData.reserve(aBuckets.size());
277 std::for_each(aBuckets.begin(), aBuckets.end(), PushBackOrderIndex(rField.
maData));
283 std::vector<Bucket>::iterator itUniqueEnd =
284 std::unique(aBuckets.begin(), aBuckets.end(), EqualByOrderIndex());
287 std::vector<Bucket>::iterator itBeg = aBuckets.begin();
288 size_t nLen =
distance(itBeg, itUniqueEnd);
290 std::for_each(itBeg, itUniqueEnd, PushBackValue(rField.
maItems));
293 struct InitColumnData
304 maEmptyRows(0, rSheetLimits.GetMaxRowCount(), true),
311 mpStrPool = pStrPool;
323 bool mbTailEmptyRows;
330 mbTailEmptyRows(
false) {}
333 typedef std::unordered_set<OUString> LabelSet;
335 void normalizeAddLabel(
const OUString& rLabel, std::vector<OUString>& rLabels, LabelSet& rExistingNames)
338 sal_Int32 nSuffix = 1;
339 OUString aNewLabel = rLabel;
340 OUString aNewLabelLower = aLabelLower;
343 if (!rExistingNames.count(aNewLabelLower))
346 rLabels.push_back(aNewLabel);
347 rExistingNames.insert(aNewLabelLower);
352 aNewLabel = rLabel + OUString::number(++nSuffix);
353 aNewLabelLower = aLabelLower + OUString::number(nSuffix);
357 std::vector<OUString> normalizeLabels(
const std::vector<InitColumnData>& rColData)
359 std::vector<OUString> aLabels;
360 aLabels.reserve(rColData.size() + 1);
362 LabelSet aExistingNames;
363 normalizeAddLabel(
ScResId(STR_PIVOT_DATA), aLabels, aExistingNames);
365 for (
const InitColumnData& rCol : rColData)
366 normalizeAddLabel(rCol.maLabel, aLabels, aExistingNames);
373 std::vector<OUString> aLabels;
374 aLabels.reserve(nLabelCount + 1);
376 LabelSet aExistingNames;
377 normalizeAddLabel(
ScResId(STR_PIVOT_DATA), aLabels, aExistingNames);
379 for (sal_Int32 nCol = 0; nCol < nLabelCount; ++nCol)
382 normalizeAddLabel(aColTitle, aLabels, aExistingNames);
388 void initColumnFromDoc( InitDocData& rDocData, InitColumnData &rColData )
392 SCTAB nDocTab = rDocData.mnDocTab;
393 SCCOL nCol = rColData.mnCol;
394 SCROW nStartRow = rDocData.mnStartRow;
395 SCROW nEndRow = rDocData.mnEndRow;
396 bool bTailEmptyRows = rDocData.mbTailEmptyRows;
398 std::optional<sc::ColumnIterator> pIter =
401 assert(pIter->hasCell());
405 rColData.maLabel = createLabelString(rDoc, nCol, pIter->getCell());
408 std::vector<Bucket> aBuckets;
409 aBuckets.reserve(nEndRow-nStartRow);
412 for (
SCROW i = 0, n = nEndRow-nStartRow;
i <
n; ++
i, pIter->next())
414 assert(pIter->hasCell());
416 sal_uInt32 nNumFormat = 0;
417 ScAddress aPos(nCol, pIter->getRow(), nDocTab);
418 initFromCell(*rColData.mpStrPool, rDoc, aPos, pIter->getCell(), aData, nNumFormat);
420 aBuckets.emplace_back(aData, i);
422 if (!aData.IsEmpty())
424 rColData.maEmptyRows.insert_back(i, i+1,
false);
431 processBuckets(aBuckets, rField);
440 rField.
maItems.push_back(aData);
445 #if ENABLE_THREADED_PIVOT_CACHE
449 using FutureType = std::future<void>;
450 std::queue<FutureType> maQueue;
452 std::condition_variable maCond;
457 ThreadQueue(
size_t nMaxQueue ) : mnMaxQueue(nMaxQueue) {}
459 void push( std::function<
void()> aFunc )
461 std::unique_lock<std::mutex>
lock(maMutex);
463 while (maQueue.size() >= mnMaxQueue)
466 FutureType
f = std::async(std::launch::async, aFunc);
467 maQueue.push(std::move(f));
475 std::unique_lock<std::mutex>
lock(maMutex);
477 while (maQueue.empty())
480 FutureType ret = std::move(maQueue.front());
490 class ThreadScopedGuard
492 std::thread maThread;
494 ThreadScopedGuard(std::thread thread) : maThread(
std::move(thread)) {}
495 ThreadScopedGuard(ThreadScopedGuard&& other) : maThread(
std::move(other.maThread)) {}
497 ThreadScopedGuard(
const ThreadScopedGuard&) =
delete;
498 ThreadScopedGuard& operator= (
const ThreadScopedGuard&) =
delete;
514 InitDocData aDocData(rDoc);
520 MacroInterpretIncrementer aMacroInc(rDoc);
522 aDocData.mnStartRow = rRange.
aStart.
Row();
523 aDocData.mnEndRow = rRange.
aEnd.
Row();
536 mnRowCount = aDocData.mnEndRow - aDocData.mnStartRow;
539 SCCOL nCol1 = nStartCol, nCol2 = nEndCol;
540 SCROW nRow1 = aDocData.mnStartRow, nRow2 = aDocData.mnEndRow;
542 aDocData.mbTailEmptyRows = aDocData.mnEndRow > nRow2;
543 aDocData.mnEndRow = nRow2;
545 if (aDocData.mnEndRow <= aDocData.mnStartRow)
558 maFields.push_back(std::make_unique<Field>());
565 #if ENABLE_THREADED_PIVOT_CACHE
566 ThreadQueue aQueue(std::thread::hardware_concurrency());
568 auto aFuncLaunchFieldThreads = [&]()
570 for (sal_uInt16 nCol = nStartCol; nCol <= nEndCol; ++nCol)
572 size_t nDim = nCol - nStartCol;
573 InitColumnData& rColData = aColData[nDim];
576 auto func = [&aDocData,&rColData]()
578 initColumnFromDoc(aDocData, rColData);
581 aQueue.push(std::move(func));
587 std::thread
t(aFuncLaunchFieldThreads);
588 ThreadScopedGuard sg(std::move(t));
596 for (sal_uInt16 nCol = nStartCol; nCol <= nEndCol; ++nCol)
598 size_t nDim = nCol - nStartCol;
599 InitColumnData& rColData = aColData[nDim];
602 initColumnFromDoc(aDocData, rColData);
609 for (
const InitColumnData& rCol : aColData)
611 EmptyRowsType::const_segment_iterator it = rCol.maEmptyRows.begin_segment();
612 EmptyRowsType::const_segment_iterator ite = rCol.maEmptyRows.end_segment();
615 for (; it != ite; ++it)
619 pos =
maEmptyRows.insert(pos, it->start, it->end,
false).first;
637 maFields.push_back(std::make_unique<Field>());
642 std::vector<Bucket> aBuckets;
656 rDB.
getValue(nCol, aData, nFormatType);
657 aBuckets.emplace_back(aData, nRow);
669 processBuckets(aBuckets, rField);
697 std::vector<bool> aPassed(nEntryCount,
false);
710 if ( nQueryCol < rParam.
nCol1 )
711 nQueryCol = rParam.
nCol1;
712 if ( nQueryCol > rParam.
nCol2 )
713 nQueryCol = rParam.
nCol2;
714 SCCOL nSourceField = nQueryCol - rParam.
nCol1;
732 double nCellVal = pCellData->
GetValue();
737 bOk = ::rtl::math::approxEqual(nCellVal, rItem.
mfVal);
740 bOk = (nCellVal < rItem.
mfVal) && !::rtl::math::approxEqual(nCellVal, rItem.
mfVal);
743 bOk = (nCellVal > rItem.
mfVal) && !::rtl::math::approxEqual(nCellVal, rItem.
mfVal);
746 bOk = (nCellVal < rItem.
mfVal) || ::rtl::math::approxEqual(nCellVal, rItem.
mfVal);
749 bOk = (nCellVal > rItem.
mfVal) || ::rtl::math::approxEqual(nCellVal, rItem.
mfVal);
752 bOk = !::rtl::math::approxEqual(nCellVal, rItem.
mfVal);
764 OUString aCellStr = pCellData->
GetString();
768 if (bRealWildOrRegExp)
770 sal_Int32 nStart = 0;
771 sal_Int32 nEnd = aCellStr.getLength();
776 if (bMatch && bMatchWholeCell
777 && (nStart != 0 || nEnd != aCellStr.getLength()))
790 bOk = rTransliteration.
isEqual(aCellStr, aStr);
791 bool bHasStar =
false;
793 if (( nIndex = aStr.indexOf(
'*') ) != -1)
795 if (bHasStar && (nIndex>0))
797 for (sal_Int32 j=0;(j<nIndex) && (j< aCellStr.getLength()) ; j++)
799 if (aCellStr[j] == aStr[j])
814 css::uno::Sequence< sal_Int32 > xOff;
817 aCellStr, nLang, 0, aCellStr.getLength(), &xOff);
819 aQueryStr, nLang, 0, aQueryStr.getLength(), &xOff);
820 bOk = (aCell.indexOf( aQuer ) != -1);
832 bOk = (nCompare < 0);
835 bOk = (nCompare > 0);
838 bOk = (nCompare <= 0);
841 bOk = (nCompare >= 0);
844 OSL_FAIL(
"SC_NOT_EQUAL");
866 aPassed[nPos] = aPassed[nPos] && bOk;
877 aPassed[0] = aPassed[0] || aPassed[j];
879 bool bRet = aPassed[0];
906 if (nDim < nSourceCount)
907 return maFields[nDim]->mpGroup.get();
909 nDim -= nSourceCount;
918 OSL_ENSURE(nDim <
maLabelNames.size()-1 ,
"ScDPTableDataCache::GetDimensionName");
931 OSL_ENSURE(!
maFields.empty(),
"Cache not initialized!");
935 OSL_ENSURE(it !=
maEmptyRows.rend(),
"corrupt flat_segment_tree instance!");
938 OSL_ENSURE(it !=
maEmptyRows.rend(),
"buggy version of flat_segment_tree is used.");
941 SCROW nLastNonEmpty = it->first - 1;
942 if (nLastNonEmpty+1 < mnDataSize)
943 mnDataSize = nLastNonEmpty+1;
960 OSL_ENSURE(nDim <
mnColumnCount,
"ScDPTableDataCache::GetItemDataId ");
967 nRow = rField.
maData.size()-1;
971 return rField.
maItems.size()-1;
974 else if (bRepeatIfEmpty)
976 while (nRow > 0 && rField.
maItems[rField.
maData[nRow]].IsEmpty())
980 return rField.
maData[nRow];
985 if (nDim < 0 || nId < 0)
988 size_t nSourceCount =
maFields.size();
989 size_t nDimPos =
static_cast<size_t>(nDim);
990 size_t nItemId =
static_cast<size_t>(nId);
991 if (nDimPos < nSourceCount)
995 if (nItemId < rField.
maItems.size())
996 return &rField.
maItems[nItemId];
1001 nItemId -= rField.
maItems.size();
1003 if (nItemId >= rGI.size())
1006 return &rGI[nItemId];
1010 nDimPos -= nSourceCount;
1015 if (nItemId >= rGI.size())
1018 return &rGI[nItemId];
1052 OSL_ENSURE( nDim>=0 && nDim <
mnColumnCount ,
" nDim < mnColumnCount ");
1063 return maFields[nDim]->mnNumFormat;
1076 return (eType == SvNumFormatType::DATE) || (eType == SvNumFormatType::DATETIME);
1081 OSL_ENSURE( nDim>=0 && nDim <
mnColumnCount ,
" ScDPTableDataCache::GetDimMemberCount : out of bound ");
1082 return maFields[nDim]->maItems.size();
1090 return static_cast<SCCOL>(
i-1);
1131 for (
size_t i = 0, n = rItems.size();
i < n; ++
i)
1133 if (rItems[
i] == rItem)
1142 for (
size_t i = 0, n = rGI.size();
i < n; ++
i)
1144 if (rGI[
i] == rItem)
1145 return rItems.size() +
i;
1155 for (
size_t i = 0, n = rGI.size();
i < n; ++
i)
1157 if (rGI[
i] == rItem)
1172 switch (rFormatter.
GetType( nNumFormat))
1174 case SvNumFormatType::DATE:
1176 case SvNumFormatType::TIME:
1178 case SvNumFormatType::DATETIME:
1188 return rtl::math::doubleToUString( fValue, rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
'.',
true);
1200 const Color* pColor =
nullptr;
1218 if (bLocaleIndependent)
1222 const Color* pColor =
nullptr;
1234 double fStart = 0.0, fEnd = 0.0;
1276 if (nDim < nSourceCount)
1282 nDim -= nSourceCount;
1298 if (nDim < nSourceCount)
1306 nDim -= nSourceCount;
1310 rItems.push_back(rData);
1311 return rItems.size()-1;
1323 if (nDim < nSourceCount)
1328 size_t nOffset =
maFields[nDim]->maItems.size();
1330 for (
size_t i = 0, n = rGI.size();
i < n; ++
i)
1331 rIds.push_back(static_cast<SCROW>(
i + nOffset));
1336 nDim -= nSourceCount;
1340 for (
size_t i = 0, n = rGI.size();
i < n; ++
i)
1341 rIds.push_back(static_cast<SCROW>(
i));
1347 struct ClearGroupItems
1349 void operator() (
const std::unique_ptr<ScDPCache::Field>& r)
const
1374 if (nDim < nSourceCount)
1379 return &
maFields[nDim]->mpGroup->maInfo;
1382 nDim -= nSourceCount;
1395 if (nDim < nSourceCount)
1400 return maFields[nDim]->mpGroup->mnGroupType;
1403 nDim -= nSourceCount;
1410 #if DUMP_PIVOT_TABLE
1416 for (
size_t i = 0;
i < rItems.size(); ++
i)
1422 for (
const auto& rIndex : rArray)
1426 const char* getGroupTypeName(sal_Int32
nType)
1428 static const char* pNames[] = {
1429 "",
"years",
"quarters",
"months",
"days",
"hours",
"minutes",
"seconds"
1434 case sheet::DataPilotFieldGroupBy::YEARS:
return pNames[1];
1435 case sheet::DataPilotFieldGroupBy::QUARTERS:
return pNames[2];
1436 case sheet::DataPilotFieldGroupBy::MONTHS:
return pNames[3];
1437 case sheet::DataPilotFieldGroupBy::DAYS:
return pNames[4];
1438 case sheet::DataPilotFieldGroupBy::HOURS:
return pNames[5];
1439 case sheet::DataPilotFieldGroupBy::MINUTES:
return pNames[6];
1440 case sheet::DataPilotFieldGroupBy::SECONDS:
return pNames[7];
1453 bool bDumpItems =
false;
1454 bool bDumpSourceData =
false;
1456 cout <<
"--- pivot cache dump" <<
endl;
1459 for (
const auto& rxField :
maFields)
1461 const Field& fld = *rxField;
1462 cout <<
"* source dimension: " <<
GetDimensionName(i) <<
" (ID = " << i <<
")" << endl;
1463 cout <<
" item count: " << fld.maItems.size() << endl;
1465 dumpItems(*
this, i, fld.maItems, 0);
1468 cout <<
" group item count: " << fld.mpGroup->maItems.size() << endl;
1469 cout <<
" group type: " << getGroupTypeName(fld.mpGroup->mnGroupType) << endl;
1471 dumpItems(*
this, i, fld.mpGroup->maItems, fld.maItems.size());
1474 if (bDumpSourceData)
1476 cout <<
" source data (re-constructed):" << endl;
1477 dumpSourceData(*
this, i, fld.maItems, fld.maData);
1485 size_t i = maFields.size();
1488 const GroupItems& gi = *rxGroupField;
1489 cout <<
"* group dimension: (unnamed) (ID = " << i <<
")" << endl;
1490 cout <<
" item count: " << gi.maItems.size() << endl;
1491 cout <<
" group type: " << getGroupTypeName(gi.mnGroupType) << endl;
1493 dumpItems(*
this, i, gi.maItems, 0);
1500 cout <<
"* empty rows: " << endl;
1501 mdds::flat_segment_tree<SCROW, bool>::const_iterator it =
maEmptyRows.begin(), itEnd =
maEmptyRows.end();
1504 aRange.start = it->first;
1505 aRange.empty = it->second;
1507 for (++it; it != itEnd; ++it)
1509 aRange.end = it->first-1;
1510 cout <<
" rows " << aRange.start <<
"-" << aRange.end <<
": " << (aRange.empty ?
"empty" :
"not-empty") << endl;
1511 aRange.start = it->first;
1512 aRange.empty = it->second;
1517 cout <<
"---" << endl;
void SetValue(double fVal)
size_t GetGroupFieldCount() const
static sal_uInt32 GetLocaleIndependentFormat(SvNumberFormatter &rFormatter, sal_uInt32 nNumFormat)
OUString getString() const
OUString GetFormattedString(tools::Long nDim, const ScDPItemData &rItem, bool bLocaleIndependent) const
EmptyRowsType maEmptyRows
sal_Int32 compareString(const OUString &s1, const OUString &s2) const
OUString ScResId(TranslateId aId)
tools::Long GetDimMemberCount(tools::Long nDim) const
OUString GetDimensionName(std::vector< OUString >::size_type nDim) const
static OUString GetLocaleIndependentFormattedString(double fValue, SvNumberFormatter &rFormatter, sal_uInt32 nNumFormat)
#define LANGUAGE_ENGLISH_US
OUString getRawString(const ScDocument &rDoc) const
Retrieve a string value without modifying the states of any objects in the referenced document store...
std::vector< StringSetType > maStringPools
const Item & GetQueryItem() const
size_t GetFieldCount() const
std::optional< sc::ColumnIterator > GetColumnIterator(SCTAB nTab, SCCOL nCol, SCROW nRow1, SCROW nRow2) const
SCROW SetGroupItem(tools::Long nDim, const ScDPItemData &rData)
ScDocument & GetDoc() const
SCROW GetIdByItemData(tools::Long nDim, const ScDPItemData &rItem) const
ScDPCache(const ScDPCache &)=delete
const GroupItems * GetGroupItems(tools::Long nDim) const
static OUString getNumGroupName(double fValue, const ScDPNumGroupInfo &rInfo, sal_Unicode cDecSep, SvNumberFormatter *pFormatter)
SC_DLLPUBLIC ScDPCollection * GetDPCollection()
rtl_uString * InternString(size_t nDim, const OUString &rStr)
static std::optional< SvtSysLocale > oSysLocale
bool IsQueryByEmpty() const
const ScDPItemDataVec & GetDimMemberValues(SCCOL nDim) const
This is very similar to ScCellValue, except that it references the original value instead of copying ...
This class represents the cached data part of the datapilot cache table implementation.
void InitFromDoc(ScDocument &rDoc, const ScRange &rRange)
SCROW GetItemDataId(sal_uInt16 nDim, SCROW nRow, bool bRepeatIfEmpty) const
SCCOL GetDimensionIndex(std::u16string_view sName) const
std::unordered_set< OUString > StringSetType
static SC_DLLPUBLIC const LocaleDataWrapper & getLocaleData()
bool IsRowEmpty(SCROW nRow) const
static SC_DLLPUBLIC OUString getDateGroupName(sal_Int32 nDatePart, sal_Int32 nValue, SvNumberFormatter *pFormatter, double fStart, double fEnd)
size_t SCSIZE
size_t typedef to be able to find places where code was changed from USHORT to size_t and is used to ...
sal_Int32 GetGroupType(tools::Long nDim) const
Return a group type identifier.
tools::Long AppendGroupField()
SCROW GetRowCount() const
Row count is the number of records plus any trailing empty rows in case the source data is sheet and ...
SC_DLLPUBLIC SCSIZE GetEntryCount() const
SC_DLLPUBLIC OUString GetString(SCCOL nCol, SCROW nRow, SCTAB nTab, const ScInterpreterContext *pContext=nullptr) const
const ScDPItemData * GetItemDataById(tools::Long nDim, SCROW nId) const
SC_DLLPUBLIC const ScQueryEntry & GetEntry(SCSIZE n) const
void AddReference(ScDPObject *pObj) const
virtual OUString getColumnLabel(tools::Long nCol) const =0
void SetStringInterned(rtl_uString *pS)
const ScDPNumGroupInfo * GetNumGroupInfo(tools::Long nDim) const
ScDPObjectSet maRefObjects
All pivot table objects that references this cache.
utl::TextSearch * GetSearchTextPtr(utl::SearchParam::SearchType eSearchType, bool bCaseSens, bool bWildMatchSel) const
creates pSearchParam and pSearchText if necessary
std::unique_ptr< GroupItems > mpGroup
Optional items for grouped field.
constexpr OUStringLiteral aData
bool IsMatchWholeCell() const
bool SearchForward(const OUString &rStr, sal_Int32 *pStart, sal_Int32 *pEnd, css::util::SearchResult *pRes=nullptr)
std::vector< OUString > maLabelNames
SC_DLLPUBLIC const ScDocOptions & GetDocOptions() const
Interface for connecting to database source.
const OUString & getNumDecimalSep() const
double getRawValue() const
Retrieve a numeric value without modifying the states of any objects in the referenced document store...
SC_DLLPUBLIC SvNumberFormatter * GetFormatTable() const
When assigning a string value, you can also assign an interned string whose life-cycle is managed by ...
bool IsQueryByNonEmpty() const
void ResetGroupItems(tools::Long nDim, const ScDPNumGroupInfo &rNumInfo, sal_Int32 nGroupType)
static SC_DLLPUBLIC const CharClass & getCharClass()
SCROW GetDataSize() const
Data size is the number of records without any trailing empty rows for sheet source data...
ScSheetLimits & GetSheetLimits() const
SvNumberFormatter * GetNumberFormatter() const
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
void SetErrorStringInterned(rtl_uString *pS)
std::vector< ScDPItemData > ScDPItemDataVec
tools::Long GetColumnCount() const
bool isEqual(const OUString &rStr1, const OUString &rStr2) const
GroupValueAttr GetGroupValue() const
bool ShrinkToDataArea(SCTAB nTab, SCCOL &rStartCol, SCROW &rStartRow, SCCOL &rEndCol, SCROW &rEndRow) const
Shrink a range to only include data area.
const_iterator end() const
#define SV_COUNTRY_LANGUAGE_OFFSET
OUString lowercase(const OUString &rStr, sal_Int32 nPos, sal_Int32 nCount) const
svl::SharedString maString
enumrange< T >::Iterator end(enumrange< T >)
GroupFieldsType maGroupFields
void RemoveCache(const ScDPCache *pCache)
Only to be called from ScDPCache::RemoveReference().
const_iterator begin() const
IndexArrayType maData
Original source data represented as indices to the unique value list.
const IndexArrayType * GetFieldIndexArray(size_t nDim) const
SC_DLLPUBLIC bool EnsureFormulaCellResults(const ScRange &rRange, bool bSkipRunning=false)
Make sure all of the formula cells in the specified range have been fully calculated.
bool InitFromDataBase(DBConnector &rDB)
ScDPItemDataVec maItems
Unique values in the field, stored in ascending order.
static OUString GetLocaleIndependentFormattedNumberString(double fValue)
void RemoveReference(ScDPObject *pObj) const
static SC_DLLPUBLIC CollatorWrapper & GetCollator()
case-insensitive collator
bool IsDateDimension(tools::Long nDim) const
SvStream & endl(SvStream &rStr)
OUString transliterate(const OUString &rStr, sal_Int32 nStart, sal_Int32 nLen) const
if(aStr!=aBuf) UpdateName_Impl(m_xFollowLb.get()
const ScDPObjectSet & GetAllReferences() const
sal_uInt32 GetNumberFormat(tools::Long nDim) const
bool HasStringData() const
NF_DATETIME_ISO_YYYYMMDD_HHMMSS
virtual tools::Long getColumnCount() const =0
FILE * init(int, char **)
std::vector< SCROW > IndexArrayType
bool ValidRow(SCROW nRow, SCROW nMaxRow)
void(* f)(TrueTypeTable *)
OUString GetString() const
virtual void getValue(tools::Long nCol, ScDPItemData &rData, SvNumFormatType &rNumType) const =0
std::vector< NoInitInt8 > maData
static SC_DLLPUBLIC::utl::TransliterationWrapper & GetTransliteration()
bool IsCaseInsEqual(const ScDPItemData &r) const
std::pair< const_iterator, bool > insert(Value &&x)
void GetGroupDimMemberIds(tools::Long nDim, std::vector< SCROW > &rIds) const
void parallelSort(const RandItr aBegin, const RandItr aEnd, Compare aComp=Compare())
mdds::flat_segment_tree< SCROW, bool > EmptyRowsType
std::shared_ptr< osl::Mutex > const & lock()
Each instance of this struct represents a single filtering criteria.
utl::SearchParam::SearchType eSearchType
size_type erase(const Value &x)
SC_DLLPUBLIC sal_uInt32 GetNumberFormat(SCCOL nCol, SCROW nRow, SCTAB nTab) const
bool ValidQuery(SCROW nRow, const ScQueryParam &rQueryParam) const
bool m_bDetectedRangeSegmentation false