diff options
author | Matúš Kukan <matus.kukan@gmail.com> | 2012-08-10 22:50:25 +0200 |
---|---|---|
committer | Matúš Kukan <matus.kukan@gmail.com> | 2012-08-10 23:08:44 +0200 |
commit | 07090cac4251e254b21676b77742c07f28cccaf4 (patch) | |
tree | a40a7a3125ebdc682dbf81e0ef3001949cac14c0 /sc | |
parent | 9b85b65fb5367b4a5d1c2bd1eed14e3bafe45405 (diff) |
sc: this appears to be unused
Change-Id: I22a759ef55a46dc560ebe5f802c937f1d47bf645
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/compressedarray.hxx | 185 | ||||
-rw-r--r-- | sc/source/core/data/compressedarray.cxx | 27 |
2 files changed, 0 insertions, 212 deletions
diff --git a/sc/inc/compressedarray.hxx b/sc/inc/compressedarray.hxx index eb38a3d10d71..a20963d281b6 100644 --- a/sc/inc/compressedarray.hxx +++ b/sc/inc/compressedarray.hxx @@ -36,8 +36,6 @@ const size_t nScCompressedArrayDelta = 4; -template< typename A, typename D > class ScCompressedArrayIterator; - /** Compressed array of row (or column) entries, e.g. heights, flags, ... The array stores ranges of values such that consecutive values occupy only @@ -102,13 +100,8 @@ public: // methods public for the coupled array sum methods /** Obtain index into entries for nPos */ SC_DLLPUBLIC size_t Search( A nPos ) const; - /** Get number of entries */ - size_t GetEntryCount() const; protected: - -friend class ScCompressedArrayIterator<A,D>; - size_t nCount; size_t nLimit; size_t nDelta; @@ -165,184 +158,6 @@ const D& ScCompressedArray<A,D>::GetNextValue( size_t& nIndex, A& nEnd ) const return pData[nEntry].aValue; } - -template< typename A, typename D > -size_t ScCompressedArray<A,D>::GetEntryCount() const -{ - return nCount; -} - - -// === ScCompressedArrayIterator ============================================= - -/** Iterator for ScCompressedArray. - - @ATTENTION: the iterator is not persistant if the underlying - ScCompressedArray happens to be changed by any means, for example by - setting new values or adding or removing or combining entries. If you do - such things inside a loop you MUST resynchronize the iterator by calling - <method>Resync()</method> with the row where resynchronization should - start. After doing so, <method>GetRangeStart()</method> and - <method>GetRangeEnd()</method> may not point to the previous access points - anymore. Use with care. - */ - -template< typename A, typename D > class ScCompressedArrayIterator -{ -public: - ScCompressedArrayIterator( - const ScCompressedArray<A,D> & rArray, - A nStart, A nEnd ); - /// Set new start and end, position on start. - void NewLimits( A nStart, A nEnd ); - A GetIterStart() const; - A GetIterEnd() const; - /// Advance by a single access point (e.g. row). - bool operator ++(); - A GetPos() const; - operator bool() const; - const D& operator *() const; - /// Advance an entire range, one entry of the array. - bool NextRange(); - A GetRangeStart() const; - A GetRangeEnd() const; - /// Resync to underlying array, calling Search(). - void Resync( A nPos ); - /** Set position without resyncing, avoid calling Search() if possible. - Position obtained from steering coupled iterator is NOT checked for - iterator bounds. */ - template< typename X > - void Follow( const ScCompressedArrayIterator<A,X>& ); - -private: - const ScCompressedArray<A,D> & rArray; - size_t nIndex; - A nIterStart; - A nIterEnd; - A nCurrent; - bool bEnd; -}; - - -template< typename A, typename D > -ScCompressedArrayIterator<A,D>::ScCompressedArrayIterator( - const ScCompressedArray<A,D> & rArrayP, A nStart, A nEnd ) - : rArray( rArrayP ) - // other values set in NewLimits() -{ - NewLimits( nStart, nEnd); -} - - -template< typename A, typename D > -void ScCompressedArrayIterator<A,D>::NewLimits( A nStart, A nEnd ) -{ - nIterStart = nStart; - nIterEnd = nEnd; - nIndex = rArray.Search( nStart); - nCurrent = GetRangeStart(); - bEnd = (nIterEnd < nIterStart); -} - - -template< typename A, typename D > -A ScCompressedArrayIterator<A,D>::GetIterStart() const -{ - return nIterStart; -} - - -template< typename A, typename D > -A ScCompressedArrayIterator<A,D>::GetIterEnd() const -{ - return nIterEnd; -} - - -template< typename A, typename D > -bool ScCompressedArrayIterator<A,D>::operator++() -{ - if (nCurrent < GetRangeEnd()) - { - ++nCurrent; - return true; - } - else - return NextRange(); -} - - -template< typename A, typename D > -A ScCompressedArrayIterator<A,D>::GetPos() const -{ - return nCurrent; -} - - -template< typename A, typename D > -bool ScCompressedArrayIterator<A,D>::NextRange() -{ - if (!operator bool()) - return false; - - if (rArray.pData[nIndex].nEnd >= nIterEnd) - bEnd = true; - else if (++nIndex >= rArray.GetEntryCount()) - { - nIndex = rArray.GetEntryCount() - 1; - bEnd = true; - } - nCurrent = bEnd ? nIterEnd : GetRangeStart(); - return operator bool(); -} - - -template< typename A, typename D > -ScCompressedArrayIterator<A,D>::operator bool() const -{ - return !bEnd; -} - - -template< typename A, typename D > -const D& ScCompressedArrayIterator<A,D>::operator*() const -{ - return rArray.pData[nIndex].aValue; -} - - -template< typename A, typename D > -A ScCompressedArrayIterator<A,D>::GetRangeStart() const -{ - if (nIndex == 0) - return nIterStart > 0 ? nIterStart : 0; - else - return nIterStart > rArray.pData[nIndex-1].nEnd ? nIterStart : - rArray.pData[nIndex-1].nEnd + 1; -} - - -template< typename A, typename D > -A ScCompressedArrayIterator<A,D>::GetRangeEnd() const -{ - return nIterEnd < rArray.pData[nIndex].nEnd ? nIterEnd : - rArray.pData[nIndex].nEnd; -} - - -template< typename A, typename D > -void ScCompressedArrayIterator<A,D>::Resync( A nPos ) -{ - if (nPos < nIterStart) - nPos = nIterStart; - else if (nPos > nIterEnd) - nPos = nIterEnd; - nCurrent = nPos; - bEnd = (nIterEnd < nIterStart); - nIndex = rArray.Search( nPos); -} - - // === ScBitMaskCompressedArray ============================================== /** The data type represents bits, managable by bitwise operations. diff --git a/sc/source/core/data/compressedarray.cxx b/sc/source/core/data/compressedarray.cxx index 27388097349e..baa8a8267c9b 100644 --- a/sc/source/core/data/compressedarray.cxx +++ b/sc/source/core/data/compressedarray.cxx @@ -456,35 +456,8 @@ A ScBitMaskCompressedArray<A,D>::GetLastAnyBitAccess( A nStart, return nEnd; } - -// === ScCompressedArrayIterator ============================================= - -template< typename A, typename D > -template< typename X > -void ScCompressedArrayIterator<A,D>::Follow( - const ScCompressedArrayIterator<A,X>& rIter ) -{ - nCurrent = rIter.GetPos(); - if (GetRangeStart() <= nCurrent && nCurrent <= GetRangeEnd()) - ; // nothing - else if (nCurrent > GetRangeEnd()) - { - A nPos = nCurrent; // nCurrent gets changed in NextRange() - bool bAdv; - do - { - bAdv = NextRange(); - } while (bAdv && GetRangeEnd() < nPos); - nCurrent = nPos; - } - else - nIndex = rArray.Search( nCurrent); -} - - // === Force instantiation of specializations ================================ -template class ScCompressedArray< SCROW, sal_uInt16>; // heights, base class template class ScCompressedArray< SCROW, sal_uInt8>; // flags, base class template class ScBitMaskCompressedArray< SCROW, sal_uInt8>; // flags |