diff options
author | Rafael Dominguez <venccsralph@gmail.com> | 2011-05-06 23:11:46 -0430 |
---|---|---|
committer | Joseph Powers <jpowers27@cox.net> | 2011-05-07 22:42:32 -0700 |
commit | 3236c2c3af9355157c62f68fcbd429498f7f747b (patch) | |
tree | 7ebb125e6b11b955f7d7fe6d6f2010f490df8edb /cui/source/tabpages/tpline.cxx | |
parent | 161b666fd1b22ed797db8735e4a06c76f7e80aa9 (diff) |
Remove deprecated List in SvxLineTabPage for std::vector<String>.
Diffstat (limited to 'cui/source/tabpages/tpline.cxx')
-rw-r--r-- | cui/source/tabpages/tpline.cxx | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx index b2e10d6210a2..2b5e57e5d8bd 100644 --- a/cui/source/tabpages/tpline.cxx +++ b/cui/source/tabpages/tpline.cxx @@ -266,12 +266,6 @@ SvxLineTabPage::~SvxLineTabPage() if(pSymbolList) delete aSymbolMB.GetPopupMenu()->GetPopupMenu( MN_SYMBOLS ); - String* pStr = (String*)aGrfNames.First(); - while( pStr ) - { - delete pStr; - pStr = (String*)aGrfNames.Next(); - } SvxBmpItemInfo* pInfo = (SvxBmpItemInfo*)aGrfBrushItems.First(); while( pInfo ) { @@ -1474,19 +1468,18 @@ IMPL_LINK( SvxLineTabPage, MenuCreateHdl_Impl, MenuButton *, pButton ) PopupMenu* pPopup = new PopupMenu; String aEmptyStr; - - nNumMenuGalleryItems=aGrfNames.Count(); - for(long i = 0; i < nNumMenuGalleryItems; i++) + const String *pUIName = NULL; + sal_uInt32 i = 0; + for(std::vector<String>::iterator it = aGrfNames.begin(); it != aGrfNames.end(); ++it, ++i) { - const String* pGrfName = (const String*)aGrfNames.GetObject(i); - const String* pUIName = pGrfName; + pUIName = &(*it); // convert URL encodings to UI characters (eg %20 for spaces) String aPhysicalName; - if( ::utl::LocalFileHelper::ConvertURLToPhysicalName( *pGrfName, aPhysicalName )) + if( ::utl::LocalFileHelper::ConvertURLToPhysicalName( *it, aPhysicalName )) pUIName = &aPhysicalName; - SvxBrushItem* pBrushItem = new SvxBrushItem(*pGrfName, aEmptyStr, GPOS_AREA, SID_ATTR_BRUSH); + SvxBrushItem* pBrushItem = new SvxBrushItem(*it, aEmptyStr, GPOS_AREA, SID_ATTR_BRUSH); pBrushItem->SetDoneLink(STATIC_LINK(this, SvxLineTabPage, GraphicArrivedHdl_Impl)); SvxBmpItemInfo* pInfo = new SvxBmpItemInfo(); @@ -1519,7 +1512,8 @@ IMPL_LINK( SvxLineTabPage, MenuCreateHdl_Impl, MenuButton *, pButton ) } } aSymbolMB.GetPopupMenu()->SetPopupMenu( MN_GALLERY, pPopup ); - if(!aGrfNames.Count()) + + if(aGrfNames.empty()) aSymbolMB.GetPopupMenu()->EnableItem(MN_GALLERY, sal_False); } @@ -1546,8 +1540,7 @@ IMPL_LINK( SvxLineTabPage, MenuCreateHdl_Impl, MenuButton *, pButton ) if(pObj==NULL) break; pObj=pObj->Clone(); - String *pStr=new String(); - aGrfNames.Insert(pStr,LIST_APPEND); + aGrfNames.push_back(aEmptyStr); pPage->NbcInsertObject(pObj); pView->MarkObj(pObj,pPageView); if(pSymbolAttr) @@ -1583,10 +1576,11 @@ IMPL_LINK( SvxLineTabPage, MenuCreateHdl_Impl, MenuButton *, pButton ) aBitmap.Scale(nScale, nScale); } Image aImage(aBitmap); - pPopup->InsertItem(pInfo->nItemId,*pStr,aImage); + pPopup->InsertItem(pInfo->nItemId,aEmptyStr,aImage); } aSymbolMB.GetPopupMenu()->SetPopupMenu( MN_SYMBOLS, pPopup ); - if(!aGrfNames.Count()) + + if(aGrfNames.empty()) aSymbolMB.GetPopupMenu()->EnableItem(MN_SYMBOLS, sal_False); delete pView; |