summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2014-08-28 11:21:59 +0900
committerDavid Tardon <dtardon@redhat.com>2014-09-01 08:19:05 -0500
commite62ec6d0499e6c517713e7d5b1855a9b2c518219 (patch)
tree4cb7d2825eca478a30582d99a9f25523c8fb4912
parentedf7c73d457f01831ba1ad2fb4aca1a35d7c2549 (diff)
fdo#75757: remove inheritance to std::vector
from SwLayCacheImpl. Change-Id: I77520495aab1d6a572b25433396202b11e478636 Reviewed-on: https://gerrit.libreoffice.org/11158 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
-rw-r--r--sw/source/core/layout/laycache.cxx6
-rw-r--r--sw/source/core/layout/layhelp.hxx10
2 files changed, 10 insertions, 6 deletions
diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx
index 7a5ae59a3385..14fe203e37dd 100644
--- a/sw/source/core/layout/laycache.cxx
+++ b/sw/source/core/layout/laycache.cxx
@@ -73,7 +73,7 @@ void SwLayoutCache::Read( SvStream &rStream )
void SwLayCacheImpl::Insert( sal_uInt16 nType, sal_uLong nIndex, sal_Int32 nOffset )
{
aType.push_back( nType );
- std::vector<sal_uLong>::push_back( nIndex );
+ mIndices.push_back( nIndex );
aOffset.push_back( nOffset );
}
@@ -486,7 +486,7 @@ SwLayHelper::SwLayHelper( SwDoc *pD, SwFrm* &rpF, SwFrm* &rpP, SwPageFrm* &rpPg,
->GetIndex();
nNodeIndex -= nStartOfContent;
nIndex = 0;
- while( nIndex < pImpl->size() && (*pImpl)[ nIndex ] < nNodeIndex )
+ while( nIndex < pImpl->size() && pImpl->GetBreakIndex( nIndex ) < nNodeIndex )
{
++nIndex;
}
@@ -881,7 +881,7 @@ bool SwLayHelper::CheckInsert( sal_uLong nNodeIndex )
}
}
} while( bLongTab || ( pImpl && nIndex < pImpl->size() &&
- (*pImpl)[ nIndex ] == nNodeIndex ) );
+ pImpl->GetBreakIndex( nIndex ) == nNodeIndex ) );
}
bFirst = false;
return bRet;
diff --git a/sw/source/core/layout/layhelp.hxx b/sw/source/core/layout/layhelp.hxx
index 493e40962450..306147fc4f5a 100644
--- a/sw/source/core/layout/layhelp.hxx
+++ b/sw/source/core/layout/layhelp.hxx
@@ -49,8 +49,9 @@ class SvStream;
class SwFlyCache;
typedef boost::ptr_vector<SwFlyCache> SwPageFlyCache;
-class SwLayCacheImpl : public std::vector<sal_uLong>
+class SwLayCacheImpl
{
+ std::vector<sal_uLong> mIndices;
std::deque<sal_Int32> aOffset;
std::vector<sal_uInt16> aType;
SwPageFlyCache aFlyCache;
@@ -58,10 +59,13 @@ class SwLayCacheImpl : public std::vector<sal_uLong>
void Insert( sal_uInt16 nType, sal_uLong nIndex, sal_Int32 nOffset );
public:
- SwLayCacheImpl() : bUseFlyCache(false) {}
+ SwLayCacheImpl() : mIndices(), aOffset(), aType(), aFlyCache(), bUseFlyCache(false) {}
+
+ size_t size() const { return mIndices.size(); }
+
bool Read( SvStream& rStream );
- sal_uLong GetBreakIndex( sal_uInt16 nIdx ) const { return std::vector<sal_uLong>::operator[]( nIdx ); }
+ sal_uLong GetBreakIndex( sal_uInt16 nIdx ) const { return mIndices[ nIdx ]; }
sal_Int32 GetBreakOfst( size_t nIdx ) const { return aOffset[ nIdx ]; }
sal_uInt16 GetBreakType( sal_uInt16 nIdx ) const { return aType[ nIdx ]; }