diff options
author | Rafael Dominguez <venccsralph@gmail.com> | 2011-05-06 22:45:19 -0430 |
---|---|---|
committer | Joseph Powers <jpowers27@cox.net> | 2011-05-07 22:41:47 -0700 |
commit | 3afc77ad7ff2bf5ecdd8f2c7067be66b4b9d22d4 (patch) | |
tree | 61fd752790085709672be857292460bf96c34c61 /cui | |
parent | 6119d4ef78f395dba8c72ee71fcad856791079f1 (diff) |
Remove deprecated List in SvxBitmapPickTabPage for std::vector<String>.
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/inc/numpages.hxx | 4 | ||||
-rw-r--r-- | cui/source/tabpages/numpages.cxx | 34 |
2 files changed, 17 insertions, 21 deletions
diff --git a/cui/source/inc/numpages.hxx b/cui/source/inc/numpages.hxx index 9604f22d7dde..c9108d510a76 100644 --- a/cui/source/inc/numpages.hxx +++ b/cui/source/inc/numpages.hxx @@ -30,6 +30,8 @@ // include --------------------------------------------------------------- +#include <vector> + #include <sfx2/tabdlg.hxx> #include <vcl/group.hxx> #include <vcl/fixed.hxx> @@ -206,7 +208,7 @@ class SvxBitmapPickTabPage : public SfxTabPage FixedText aErrorText; CheckBox aLinkedCB; - List aGrfNames; + std::vector<String> aGrfNames; String sNumCharFmtName; SvxNumRule* pActNum; diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx index 9f77a1a0f8c4..1200f4c2cb00 100644 --- a/cui/source/tabpages/numpages.cxx +++ b/cui/source/tabpages/numpages.cxx @@ -846,16 +846,20 @@ SvxBitmapPickTabPage::SvxBitmapPickTabPage(Window* pParent, // Grafiknamen ermitteln GalleryExplorer::FillObjList(GALLERY_THEME_BULLETS, aGrfNames); pExamplesVS->SetHelpId(HID_VALUESET_NUMBMP ); - for(sal_uInt16 i = 0; i < aGrfNames.Count(); i++) + + sal_uInt16 i = 0; + for(std::vector<String>::iterator it = aGrfNames.begin(); it != aGrfNames.end(); ++it, ++i) { pExamplesVS->InsertItem( i + 1, i); - String* pGrfNm = (String*) aGrfNames.GetObject(i); - INetURLObject aObj(*pGrfNm); + + INetURLObject aObj(*it); if(aObj.GetProtocol() == INET_PROT_FILE) - *pGrfNm = aObj.PathToFileName(); - pExamplesVS->SetItemText( i + 1, *pGrfNm ); + *it = aObj.PathToFileName(); + + pExamplesVS->SetItemText( i + 1, *it ); } - if(!aGrfNames.Count()) + + if(aGrfNames.empty()) { aErrorText.Show(); } @@ -870,12 +874,6 @@ SvxBitmapPickTabPage::SvxBitmapPickTabPage(Window* pParent, SvxBitmapPickTabPage::~SvxBitmapPickTabPage() { - String* pStr = (String*)aGrfNames.First(); - while( pStr ) - { - delete pStr; - pStr = (String*)aGrfNames.Next(); - } delete pExamplesVS; delete pActNum; delete pSaveNum; @@ -911,7 +909,7 @@ void SvxBitmapPickTabPage::ActivatePage(const SfxItemSet& rSet) pExamplesVS->SetNoSelection(); } // ersten Eintrag vorselektieren - if(aGrfNames.Count() && + if(!aGrfNames.empty() && (pActNum && (!lcl_IsNumFmtSet(pActNum, nActNumLvl) || bIsPreset))) { pExamplesVS->SelectItem(1); @@ -931,7 +929,7 @@ int SvxBitmapPickTabPage::DeactivatePage(SfxItemSet *_pSet) sal_Bool SvxBitmapPickTabPage::FillItemSet( SfxItemSet& rSet ) { - if ( !aGrfNames.Count() ) + if ( aGrfNames.empty() ) { return sal_False; } @@ -990,10 +988,6 @@ IMPL_LINK(SvxBitmapPickTabPage, NumSelectHdl_Impl, ValueSet*, EMPTYARG) bModified = sal_True; sal_uInt16 nIdx = pExamplesVS->GetSelectItemId() - 1; - String* pGrfName = 0; - if(aGrfNames.Count() > nIdx) - pGrfName = (String*)aGrfNames.GetObject(nIdx); - sal_uInt16 nMask = 1; String aEmptyStr; sal_uInt16 nSetNumberingType = SVX_NUM_BITMAP; @@ -1018,8 +1012,8 @@ IMPL_LINK(SvxBitmapPickTabPage, NumSelectHdl_Impl, ValueSet*, EMPTYARG) SvxBrushItem aBrush(aGraphic, GPOS_AREA, SID_ATTR_BRUSH ); aFmt.SetGraphicBrush( &aBrush, &aSize, &eOrient ); } - else if(pGrfName) - aFmt.SetGraphic( *pGrfName ); + else if(aGrfNames.size() > nIdx) + aFmt.SetGraphic( aGrfNames[nIdx] ); pActNum->SetLevel(i, aFmt); } nMask <<= 1 ; |