diff options
-rw-r--r-- | sc/inc/dpcache.hxx | 1 | ||||
-rw-r--r-- | sc/source/core/data/dpcache.cxx | 67 |
2 files changed, 0 insertions, 68 deletions
diff --git a/sc/inc/dpcache.hxx b/sc/inc/dpcache.hxx index 05574814b512..65669791cbe1 100644 --- a/sc/inc/dpcache.hxx +++ b/sc/inc/dpcache.hxx @@ -169,7 +169,6 @@ private: void PostInit(); void Clear(); void AddLabel(const rtl::OUString& rLabel); - bool AddData(long nDim, const ScDPItemData& rData, sal_uLong nNumFormat); const GroupItems* GetGroupItems(long nDim) const; }; diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx index 7a07ee270db0..140885e73e30 100644 --- a/sc/source/core/data/dpcache.cxx +++ b/sc/source/core/data/dpcache.cxx @@ -64,44 +64,6 @@ using ::com::sun::star::uno::UNO_QUERY_THROW; namespace { -/** - * Search for an item in the data array. If it's in the array, return its - * index to the caller. - * - * @param rArray dimension array - * @param rOrder global order (what's this?) - * @param item item to search for - * @param rIndex the index of the found item in the global order. - * - * @return true if the item is found, or false otherwise. - */ -bool hasItemInDimension(const ScDPCache::ItemsType& rArray, const ScDPCache::IndexArrayType& rOrder, const ScDPItemData& rItem, SCROW& rIndex) -{ - rIndex = rArray.size(); - bool bFound = false; - SCROW nLo = 0; - SCROW nHi = rArray.size() - 1; - long nCompare; - while (nLo <= nHi) - { - SCROW nIndex = (nLo + nHi) / 2; - nCompare = ScDPItemData::Compare(rArray[rOrder[nIndex]], rItem); - if (nCompare < 0) - nLo = nIndex + 1; - else - { - nHi = nIndex - 1; - if (nCompare == 0) - { - bFound = true; - nLo = nIndex; - } - } - } - rIndex = nLo; - return bFound; -} - void getItemValue( ScDPItemData& rData, const Reference<sdbc::XRow>& xRow, sal_Int32 nType, long nCol, const Date& rNullDate, short& rNumType) @@ -755,35 +717,6 @@ bool ScDPCache::IsRowEmpty(SCROW nRow) const return bEmpty; } -bool ScDPCache::AddData(long nDim, const ScDPItemData& rData, sal_uLong nNumFormat) -{ - OSL_ENSURE( nDim < mnColumnCount && nDim >=0 , "dimension out of bound" ); - - SCROW nIndex = 0; - Field& rField = maFields[nDim]; - if (!hasItemInDimension(rField.maItems, rField.maGlobalOrder, rData, nIndex)) - { - // This item doesn't exist in the dimension array yet. - rField.maItems.push_back(rData); - rField.maGlobalOrder.insert( - rField.maGlobalOrder.begin()+nIndex, rField.maItems.size()-1); - OSL_ENSURE(rField.maGlobalOrder[nIndex] == sal::static_int_cast<SCROW>(rField.maItems.size())-1, "ScDPTableDataCache::AddData "); - rField.maData.push_back(rField.maItems.size()-1); - } - else - rField.maData.push_back(rField.maGlobalOrder[nIndex]); - - size_t nCurRow = maFields[nDim].maData.size() - 1; - - if (!rData.IsEmpty()) - { - maEmptyRows.insert_back(nCurRow, nCurRow+1, false); - rField.mnNumFormat = nNumFormat; - } - - return true; -} - const ScDPCache::GroupItems* ScDPCache::GetGroupItems(long nDim) const { if (nDim < 0) |