diff options
author | Krisztian Pinter <pin.terminator@gmail.com> | 2014-07-30 19:45:37 +0200 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2014-09-17 10:19:52 +0200 |
commit | b39f15cfcc28266c5c680d19eaa394960cb7c0ff (patch) | |
tree | b3f644fdf65301e43f8d847a31f2f63e7d2b7111 /svx/source/tbxctrls | |
parent | 1bf3b9f2da8fe6e79e1e20d57784b55958ee3db4 (diff) |
Change vector<Palette*> to ptr_vector<Palette>
Change-Id: I1f2832235e8d2ea3517efdce809970ed5f1c6769
Diffstat (limited to 'svx/source/tbxctrls')
-rw-r--r-- | svx/source/tbxctrls/PaletteManager.cxx | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/svx/source/tbxctrls/PaletteManager.cxx b/svx/source/tbxctrls/PaletteManager.cxx index da80f23db37d..98ae0b2dea29 100644 --- a/svx/source/tbxctrls/PaletteManager.cxx +++ b/svx/source/tbxctrls/PaletteManager.cxx @@ -41,20 +41,14 @@ PaletteManager::PaletteManager() : PaletteManager::~PaletteManager() { - for( std::vector<Palette*>::iterator it = maPalettes.begin(); - it != maPalettes.end(); - ++it) - { - delete *it; - } } void PaletteManager::LoadPalettes() { + maPalettes.clear(); OUString aPalPath = SvtPathOptions().GetPalettePath(); osl::Directory aDir(aPalPath); - maPalettes.clear(); osl::DirectoryItem aDirItem; osl::FileStatus aFileStat( osl_FileStatus_Mask_FileName | osl_FileStatus_Mask_FileURL | @@ -116,7 +110,7 @@ void PaletteManager::ReloadColorSet(SvxColorValueSet &rColorSet) } else { - maPalettes[mnCurrentPalette-1]->LoadColorSet( rColorSet ); + maPalettes[mnCurrentPalette-1].LoadColorSet( rColorSet ); mnColorCount = rColorSet.GetItemCount(); } } @@ -127,11 +121,11 @@ std::vector<OUString> PaletteManager::GetPaletteList() aPaletteNames.push_back( STR_DEFAULT_PAL ); - for( std::vector<Palette*>::iterator it = maPalettes.begin(); + for( boost::ptr_vector<Palette>::iterator it = maPalettes.begin(); it != maPalettes.end(); ++it) { - aPaletteNames.push_back( (*it)->GetName() ); + aPaletteNames.push_back( (*it).GetName() ); } aPaletteNames.push_back( STR_DOC_COLORS ); @@ -161,7 +155,7 @@ OUString PaletteManager::GetPaletteName() else if( mnCurrentPalette == mnNumOfPalettes - 1 ) return OUString( STR_DOC_COLORS ); else - return maPalettes[mnCurrentPalette - 1]->GetName(); + return maPalettes[mnCurrentPalette - 1].GetName(); } const Color& PaletteManager::GetLastColor() |