summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authornpcdoom <venccsralph@gmail.com>2011-02-27 22:22:17 -0430
committerLuboš Luňák <l.lunak@suse.cz>2011-03-04 12:10:56 +0100
commit1299e87202fdbc44d7bce849a0fa031e4470ddc9 (patch)
tree354ee5f79a61455d179b2f1672099d5c83b0a479 /svx
parentbc25156521ee3f636ad702b5ae2d5972323a8a7b (diff)
Remove deprecated List container in gallery1.
Signed-off-by: Luboš Luňák <l.lunak@suse.cz>
Diffstat (limited to 'svx')
-rw-r--r--svx/inc/svx/gallery1.hxx7
-rw-r--r--svx/source/gallery2/gallery1.cxx27
2 files changed, 18 insertions, 16 deletions
diff --git a/svx/inc/svx/gallery1.hxx b/svx/inc/svx/gallery1.hxx
index 907813bb5e51..f946f9626b33 100644
--- a/svx/inc/svx/gallery1.hxx
+++ b/svx/inc/svx/gallery1.hxx
@@ -31,12 +31,10 @@
#include <tools/string.hxx>
#include <tools/urlobj.hxx>
-#include <tools/list.hxx>
#include <svl/brdcst.hxx>
#include "svx/svxdllapi.h"
#include <cstdio>
-#include <list>
#include <vector>
// ---------------------
@@ -120,6 +118,7 @@ SvStream& operator>>( SvStream& rIn, GalleryImportThemeEntry& rEntry );
class SfxListener;
class GalleryTheme;
+class GalleryThemeCacheEntry;
class Gallery : public SfxBroadcaster
{
@@ -127,11 +126,13 @@ class Gallery : public SfxBroadcaster
friend Gallery* createGallery( const rtl::OUString& );
friend void disposeGallery( Gallery* );
+ typedef std::vector<GalleryThemeCacheEntry*> GalleryCacheThemeList;
+
private:
GalleryThemeList aThemeList;
GalleryImportThemeList aImportList;
- List aThemeCache;
+ GalleryCacheThemeList aThemeCache;
INetURLObject aRelURL;
INetURLObject aUserURL;
rtl_TextEncoding nReadTextEncoding;
diff --git a/svx/source/gallery2/gallery1.cxx b/svx/source/gallery2/gallery1.cxx
index d3044f27c2c5..7c0c9605019d 100644
--- a/svx/source/gallery2/gallery1.cxx
+++ b/svx/source/gallery2/gallery1.cxx
@@ -838,11 +838,14 @@ GalleryTheme* Gallery::ImplGetCachedTheme( const GalleryThemeEntry* pThemeEntry
if( pThemeEntry )
{
- GalleryThemeCacheEntry* pEntry;
-
- for( pEntry = (GalleryThemeCacheEntry*) aThemeCache.First(); pEntry && !pTheme; pEntry = (GalleryThemeCacheEntry*) aThemeCache.Next() )
- if( pThemeEntry == pEntry->GetThemeEntry() )
- pTheme = pEntry->GetTheme();
+ for (GalleryCacheThemeList::const_iterator it = aThemeCache.begin(); it != aThemeCache.end(); ++it)
+ {
+ if (pThemeEntry == (*it)->GetThemeEntry())
+ {
+ pTheme = (*it)->GetTheme();
+ break;
+ }
+ }
if( !pTheme )
{
@@ -874,7 +877,7 @@ GalleryTheme* Gallery::ImplGetCachedTheme( const GalleryThemeEntry* pThemeEntry
}
if( pTheme )
- aThemeCache.Insert( new GalleryThemeCacheEntry( pThemeEntry, pTheme ), LIST_APPEND );
+ aThemeCache.push_back( new GalleryThemeCacheEntry( pThemeEntry, pTheme ));
}
}
@@ -885,15 +888,13 @@ GalleryTheme* Gallery::ImplGetCachedTheme( const GalleryThemeEntry* pThemeEntry
void Gallery::ImplDeleteCachedTheme( GalleryTheme* pTheme )
{
- GalleryThemeCacheEntry* pEntry;
- BOOL bDone = FALSE;
-
- for( pEntry = (GalleryThemeCacheEntry*) aThemeCache.First(); pEntry && !bDone; pEntry = (GalleryThemeCacheEntry*) aThemeCache.Next() )
+ for (GalleryCacheThemeList::iterator it = aThemeCache.begin(); it != aThemeCache.end(); ++it)
{
- if( pTheme == pEntry->GetTheme() )
+ if (pTheme == (*it)->GetTheme())
{
- delete (GalleryThemeCacheEntry*) aThemeCache.Remove( pEntry );
- bDone = TRUE;
+ delete *it;
+ aThemeCache.erase(it);
+ break;
}
}
}