summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2017-09-06 22:24:13 +0200
committerJulien Nabet <serval2412@yahoo.fr>2017-09-06 23:43:01 +0200
commitdf34535d0a835ac8f7cd19e011965a8790e0c7ae (patch)
treebc4857106455c82c67a7a59fa974cde193fd7f1c /svtools
parent758f021601c25251f9cc5475570153022e140ee0 (diff)
Replace some lists by vectors in svtools
Change-Id: Ibd0bf4a4045fa079827e211b2f5668900c8188ef Reviewed-on: https://gerrit.libreoffice.org/42029 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/graphic/grfcache.cxx22
-rw-r--r--svtools/source/graphic/grfcache.hxx10
2 files changed, 16 insertions, 16 deletions
diff --git a/svtools/source/graphic/grfcache.cxx b/svtools/source/graphic/grfcache.cxx
index c5995a141b22..1f99b841cea8 100644
--- a/svtools/source/graphic/grfcache.cxx
+++ b/svtools/source/graphic/grfcache.cxx
@@ -863,7 +863,7 @@ void GraphicCache::AddGraphicObject(
&& !maGraphicCache.empty()
)
{
- GraphicCacheEntryList::iterator it = maGraphicCache.begin();
+ GraphicCacheEntryVector::iterator it = maGraphicCache.begin();
while( !bInserted
&& ( it != maGraphicCache.end() )
)
@@ -882,7 +882,7 @@ void GraphicCache::AddGraphicObject(
if( !bInserted )
{
- GraphicCacheEntryList::iterator it = maGraphicCache.begin();
+ GraphicCacheEntryVector::iterator it = maGraphicCache.begin();
std::unique_ptr< GraphicID > apID;
if( !pID )
@@ -905,7 +905,7 @@ void GraphicCache::AddGraphicObject(
// since pEntry->TryToSwapIn can modify our current list, we have to
// iterate from beginning to add a reference to the appropriate
// CacheEntry object; after this, quickly jump out of the outer iteration
- for( GraphicCacheEntryList::iterator jt = maGraphicCache.begin();
+ for( GraphicCacheEntryVector::iterator jt = maGraphicCache.begin();
!bInserted && jt != maGraphicCache.end();
++jt
)
@@ -949,7 +949,7 @@ void GraphicCache::ReleaseGraphicObject( const GraphicObject& rObj )
{
// Release cached object
bool bRemoved = false;
- GraphicCacheEntryList::iterator it = maGraphicCache.begin();
+ GraphicCacheEntryVector::iterator it = maGraphicCache.begin();
while (!bRemoved && it != maGraphicCache.end())
{
bRemoved = (*it)->ReleaseGraphicObjectReference( rObj );
@@ -958,7 +958,7 @@ void GraphicCache::ReleaseGraphicObject( const GraphicObject& rObj )
{
// if graphic cache entry has no more references,
// the corresponding display cache object can be removed
- GraphicDisplayCacheEntryList::iterator it2 = maDisplayCache.begin();
+ GraphicDisplayCacheEntryVector::iterator it2 = maDisplayCache.begin();
while( it2 != maDisplayCache.end() )
{
GraphicDisplayCacheEntry* pDisplayEntry = *it2;
@@ -1029,7 +1029,7 @@ void GraphicCache::SetCacheTimeout( sal_uLong nTimeoutSeconds )
aReleaseTime.addTime( ::salhelper::TTimeValue( nTimeoutSeconds, 0 ) );
}
- for( GraphicDisplayCacheEntryList::const_iterator it = maDisplayCache.begin();
+ for( GraphicDisplayCacheEntryVector::const_iterator it = maDisplayCache.begin();
it != maDisplayCache.end(); ++it )
{
(*it)->SetReleaseTime( aReleaseTime );
@@ -1054,7 +1054,7 @@ bool GraphicCache::IsInDisplayCache( OutputDevice const * pOut, const Point& rPt
if( pCacheEntry )
{
- for( GraphicDisplayCacheEntryList::const_iterator it = maDisplayCache.begin();
+ for( GraphicDisplayCacheEntryVector::const_iterator it = maDisplayCache.begin();
!bFound && ( it != maDisplayCache.end() ); ++it )
{
if( (*it)->Matches( pOut, aPtPixel, aSzPixel, pCacheEntry, rAttr ) )
@@ -1155,7 +1155,7 @@ bool GraphicCache::DrawDisplayCacheObj( OutputDevice* pOut, const Point& rPt, co
const Size aSzPixel( pOut->LogicToPixel( rSz ) );
const GraphicCacheEntry* pCacheEntry = ImplGetCacheEntry( rObj );
GraphicDisplayCacheEntry* pDisplayCacheEntry = nullptr;
- GraphicDisplayCacheEntryList::iterator it = maDisplayCache.begin();
+ GraphicDisplayCacheEntryVector::iterator it = maDisplayCache.begin();
bool bRet = false;
while( !bRet && it != maDisplayCache.end() )
@@ -1194,7 +1194,7 @@ bool GraphicCache::ImplFreeDisplayCacheSpace( sal_uLong nSizeToFree )
if( nSizeToFree )
{
- GraphicDisplayCacheEntryList::iterator it = maDisplayCache.begin();
+ GraphicDisplayCacheEntryVector::iterator it = maDisplayCache.begin();
if( nSizeToFree > mnUsedDisplaySize )
nSizeToFree = mnUsedDisplaySize;
@@ -1221,7 +1221,7 @@ GraphicCacheEntry* GraphicCache::ImplGetCacheEntry( const GraphicObject& rObj )
GraphicCacheEntry* pRet = nullptr;
for(
- GraphicCacheEntryList::iterator it = maGraphicCache.begin();
+ GraphicCacheEntryVector::iterator it = maGraphicCache.begin();
!pRet && it != maGraphicCache.end();
++it
) {
@@ -1238,7 +1238,7 @@ IMPL_LINK( GraphicCache, ReleaseTimeoutHdl, Timer*, pTimer, void )
pTimer->Stop();
::salhelper::TTimeValue aCurTime;
- GraphicDisplayCacheEntryList::iterator it = maDisplayCache.begin();
+ GraphicDisplayCacheEntryVector::iterator it = maDisplayCache.begin();
osl_getSystemTime( &aCurTime );
diff --git a/svtools/source/graphic/grfcache.hxx b/svtools/source/graphic/grfcache.hxx
index 48c2624521bd..7287192e4d54 100644
--- a/svtools/source/graphic/grfcache.hxx
+++ b/svtools/source/graphic/grfcache.hxx
@@ -22,7 +22,7 @@
#include <vcl/graph.hxx>
#include <vcl/timer.hxx>
-#include <list>
+#include <vector>
class GraphicAttr;
@@ -33,12 +33,12 @@ class GraphicObject;
class GraphicCache
{
private:
- typedef std::list< GraphicCacheEntry* > GraphicCacheEntryList;
- typedef std::list< GraphicDisplayCacheEntry* > GraphicDisplayCacheEntryList;
+ typedef std::vector< GraphicCacheEntry* > GraphicCacheEntryVector;
+ typedef std::vector< GraphicDisplayCacheEntry* > GraphicDisplayCacheEntryVector;
Timer maReleaseTimer;
- GraphicCacheEntryList maGraphicCache;
- GraphicDisplayCacheEntryList maDisplayCache;
+ GraphicCacheEntryVector maGraphicCache;
+ GraphicDisplayCacheEntryVector maDisplayCache;
sal_uLong mnReleaseTimeoutSeconds;
sal_uLong mnMaxDisplaySize;
sal_uLong mnMaxObjDisplaySize;