summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNigel Hawkins <n.hawkins@gmx.com>2011-06-17 15:20:07 +0100
committerNigel Hawkins <n.hawkins@gmx.com>2011-07-06 08:08:07 +0100
commit9ddf56a34ba170c4ef600084584420814cf80b07 (patch)
tree5643f1ceb224eaf66ee0411fd39fc66b19db48db
parent7a4607b29ba874124bf57384b389caf96de3c236 (diff)
Replace SvULongs with vector in laycache.cxx and layhelp.hxx. LGPL3+/MPL1.1
-rw-r--r--sw/source/core/layout/laycache.cxx18
-rw-r--r--sw/source/core/layout/layhelp.hxx7
2 files changed, 12 insertions, 13 deletions
diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx
index 71abd9639b..9b07744edc 100644
--- a/sw/source/core/layout/laycache.cxx
+++ b/sw/source/core/layout/laycache.cxx
@@ -103,7 +103,7 @@ void SwLayoutCache::Read( SvStream &rStream )
void SwLayCacheImpl::Insert( sal_uInt16 nType, sal_uLong nIndex, xub_StrLen nOffset )
{
aType.Insert( nType, aType.Count() );
- SvULongs::Insert( nIndex, SvULongs::Count() );
+ std::vector<sal_uLong>::push_back( nIndex );
aOffset.push_back( nOffset );
}
@@ -525,9 +525,9 @@ SwLayHelper::SwLayHelper( SwDoc *pD, SwFrm* &rpF, SwFrm* &rpP, SwPageFrm* &rpPg,
nNodeIndex -= nStartOfContent;
nIndex = 0;
nFlyIdx = 0;
- while( nIndex < pImpl->Count() && (*pImpl)[ nIndex ] < nNodeIndex )
+ while( nIndex < pImpl->size() && (*pImpl)[ nIndex ] < nNodeIndex )
++nIndex;
- if( nIndex >= pImpl->Count() )
+ if( nIndex >= pImpl->size() )
{
pDoc->GetLayoutCache()->UnlockImpl();
pImpl = NULL;
@@ -562,7 +562,7 @@ sal_uLong SwLayHelper::CalcPageCount()
pDoc->GetLayoutCache()->LockImpl() : NULL;
if( pCache )
{
- nPgCount = pCache->Count() + 1;
+ nPgCount = pCache->size() + 1;
pDoc->GetLayoutCache()->UnlockImpl();
}
else
@@ -804,10 +804,10 @@ sal_Bool SwLayHelper::CheckInsert( sal_uLong nNodeIndex )
}
else
++nParagraphCnt;
- if( bFirst && pImpl && nIndex < pImpl->Count() &&
+ if( bFirst && pImpl && nIndex < pImpl->size() &&
pImpl->GetBreakIndex( nIndex ) == nNodeIndex &&
( pImpl->GetBreakOfst( nIndex ) < STRING_LEN ||
- ( ++nIndex < pImpl->Count() &&
+ ( ++nIndex < pImpl->size() &&
pImpl->GetBreakIndex( nIndex ) == nNodeIndex ) ) )
bFirst = sal_False;
#if OSL_DEBUG_LEVEL > 1
@@ -839,10 +839,10 @@ sal_Bool SwLayHelper::CheckInsert( sal_uLong nNodeIndex )
}
else
{
- while( nIndex < pImpl->Count() &&
+ while( nIndex < pImpl->size() &&
pImpl->GetBreakIndex(nIndex) < nNodeIndex)
++nIndex;
- if( nIndex < pImpl->Count() &&
+ if( nIndex < pImpl->size() &&
pImpl->GetBreakIndex(nIndex) == nNodeIndex )
{
nType = pImpl->GetBreakType( nIndex );
@@ -982,7 +982,7 @@ sal_Bool SwLayHelper::CheckInsert( sal_uLong nNodeIndex )
rpLay = rpLay->GetNextLayoutLeaf();
}
}
- } while( bLongTab || ( pImpl && nIndex < pImpl->Count() &&
+ } while( bLongTab || ( pImpl && nIndex < pImpl->size() &&
(*pImpl)[ nIndex ] == nNodeIndex ) );
}
bFirst = sal_False;
diff --git a/sw/source/core/layout/layhelp.hxx b/sw/source/core/layout/layhelp.hxx
index 10195f68e1..88257362bb 100644
--- a/sw/source/core/layout/layhelp.hxx
+++ b/sw/source/core/layout/layhelp.hxx
@@ -29,7 +29,6 @@
#define _LAYHELP_HXX
#ifndef _SVSTDARR_HXX
#define _SVSTDARR_USHORTS
-#define _SVSTDARR_ULONGS
#define _SVSTDARR_XUB_STRLEN
#include <svl/svstdarr.hxx>
#endif
@@ -63,7 +62,7 @@ class SwFlyCache;
typedef SwFlyCache* SwFlyCachePtr;
SV_DECL_PTRARR_DEL( SwPageFlyCache, SwFlyCachePtr, 0, 4 )
-class SwLayCacheImpl : public SvULongs
+class SwLayCacheImpl : public std::vector<sal_uLong>
{
SvXub_StrLens aOffset;
SvUShorts aType;
@@ -72,10 +71,10 @@ class SwLayCacheImpl : public SvULongs
void Insert( sal_uInt16 nType, sal_uLong nIndex, xub_StrLen nOffset );
public:
- SwLayCacheImpl() : SvULongs( 20, 10 ), aType( 20, 10 ) {}
+ SwLayCacheImpl() : aType( 20, 10 ) {}
sal_Bool Read( SvStream& rStream );
- sal_uLong GetBreakIndex( sal_uInt16 nIdx ) const { return GetObject( nIdx ); }
+ sal_uLong GetBreakIndex( sal_uInt16 nIdx ) const { return std::vector<sal_uLong>::operator[]( nIdx ); }
xub_StrLen GetBreakOfst( size_t nIdx ) const { return aOffset[ nIdx ]; }
sal_uInt16 GetBreakType( sal_uInt16 nIdx ) const { return aType[ nIdx ]; }