basctl/source/basicide/basides1.cxx | 2 cui/source/inc/numfmt.hxx | 5 - cui/source/tabpages/numfmt.cxx | 74 ++++++++---------- sc/source/ui/inc/formula.hxx | 6 - sc/source/ui/inc/funcpage.hxx | 6 - sc/source/ui/inc/parawin.hxx | 8 - sc/source/ui/inc/undotab.hxx | 7 - sc/source/ui/inc/viewfunc.hxx | 6 - sc/source/ui/view/viewfun2.cxx | 1 sfx2/inc/sfx2/frmdescr.hxx | 3 sfx2/source/appl/appcfg.cxx | 4 sfx2/source/appl/appdata.cxx | 4 sfx2/source/inc/appdata.hxx | 2 svl/inc/svl/svarray.hxx | 2 svl/inc/svl/svstdarr.hxx | 8 - svl/source/items/style.cxx | 1 svl/source/memtools/svarray.cxx | 2 svx/inc/svx/numfmtsh.hxx | 85 ++++++++------------ svx/source/items/numfmtsh.cxx | 146 ++++++++++++++++-------------------- sw/source/core/doc/docdde.cxx | 2 sw/source/core/unocore/unotbl.cxx | 19 +--- sw/source/filter/basflt/fltini.cxx | 2 sw/source/filter/html/swhtml.cxx | 2 sw/source/ui/uno/unoatxt.cxx | 2 unusedcode.easy | 1 25 files changed, 149 insertions(+), 251 deletions(-)
New commits: commit 2004a9920e1cef4ac208f14453c1bc8ad80b7c77 Author: Brad Sowden <c...@sowden.org> Date: Thu Dec 29 22:31:12 2011 +1300 Easyhack fdo#38831 remove SvStrings Remove SvStrings definition and obsolete #defines. diff --git a/basctl/source/basicide/basides1.cxx b/basctl/source/basicide/basides1.cxx index 5de3788..bcf4006 100644 --- a/basctl/source/basicide/basides1.cxx +++ b/basctl/source/basicide/basides1.cxx @@ -27,8 +27,6 @@ ************************************************************************/ -#define _SVSTDARR_STRINGS - #include "ide_pch.hxx" #define _SOLAR__PRIVATE 1 diff --git a/sc/source/ui/inc/formula.hxx b/sc/source/ui/inc/formula.hxx index 306aaa5..e9e0b34 100644 --- a/sc/source/ui/inc/formula.hxx +++ b/sc/source/ui/inc/formula.hxx @@ -37,12 +37,6 @@ #include <svtools/svmedit.hxx> #include <vcl/tabpage.hxx> -#ifndef _SVSTDARR_STRINGS - -#define _SVSTDARR_STRINGS -#include <svl/svstdarr.hxx> - -#endif #include "compiler.hxx" #include "cell.hxx" diff --git a/sc/source/ui/inc/funcpage.hxx b/sc/source/ui/inc/funcpage.hxx index ca24748..79f8185 100644 --- a/sc/source/ui/inc/funcpage.hxx +++ b/sc/source/ui/inc/funcpage.hxx @@ -37,12 +37,6 @@ #include <svtools/svmedit.hxx> #include <vcl/tabpage.hxx> -#ifndef _SVSTDARR_STRINGS - -#define _SVSTDARR_STRINGS -#include <svl/svstdarr.hxx> - -#endif #include <vcl/tabctrl.hxx> #include "parawin.hxx" #include <svtools/svtreebx.hxx> diff --git a/sc/source/ui/inc/undotab.hxx b/sc/source/ui/inc/undotab.hxx index c6b7409..d2dfedf 100644 --- a/sc/source/ui/inc/undotab.hxx +++ b/sc/source/ui/inc/undotab.hxx @@ -34,13 +34,6 @@ #include <tools/color.hxx> #include "tabbgcolor.hxx" -#ifndef _SVSTDARR_STRINGS - -#define _SVSTDARR_STRINGS -#include <svl/svstdarr.hxx> - -#endif - #include <com/sun/star/uno/Sequence.hxx> #include <boost/shared_ptr.hpp> diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx index 29e10f3..f1273cf 100644 --- a/sc/source/ui/inc/viewfunc.hxx +++ b/sc/source/ui/inc/viewfunc.hxx @@ -32,12 +32,6 @@ #include "tabbgcolor.hxx" -#ifndef _SVSTDARR_STRINGS - -#define _SVSTDARR_STRINGS -#include <svl/svstdarr.hxx> - -#endif #include <com/sun/star/embed/XEmbeddedObject.hpp> #include <com/sun/star/embed/Aspects.hpp> #include <vector> diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index e2c950c..400d1cb 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -33,7 +33,6 @@ #include <editeng/eeitem.hxx> #include <sfx2/app.hxx> -#define _SVSTDARR_STRINGS #include <editeng/boxitem.hxx> #include <editeng/fontitem.hxx> #include <editeng/scripttypeitem.hxx> diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx index 85e5374..868a07c 100644 --- a/sfx2/source/appl/appcfg.cxx +++ b/sfx2/source/appl/appcfg.cxx @@ -47,8 +47,6 @@ #include <svl/szitem.hxx> #include <svl/undo.hxx> -#define _SVSTDARR_STRINGS -#include <svl/svstdarr.hxx> #include <sfx2/sfxsids.hrc> #include <sot/exchange.hxx> diff --git a/svl/inc/svl/svarray.hxx b/svl/inc/svl/svarray.hxx index 4c8d077..47b8063 100644 --- a/svl/inc/svl/svarray.hxx +++ b/svl/inc/svl/svarray.hxx @@ -81,7 +81,7 @@ * Sortierung mit Hilfe der Object-operatoren "<" und "==" * * JP 09.10.96: vordefinierte Arrays: -* PtrArr: SvStrings, SvStringsDtor +* PtrArr: SvStringsDtor * SortArr: SvStringsSort, SvStringsSortDtor, * SvStringsISort, SvStringsISortDtor ***********************************************************************/ diff --git a/svl/inc/svl/svstdarr.hxx b/svl/inc/svl/svstdarr.hxx index 54f6d2a..1d1b6e8 100644 --- a/svl/inc/svl/svstdarr.hxx +++ b/svl/inc/svl/svstdarr.hxx @@ -32,7 +32,7 @@ * (die defines setzen sich aus "_SVSTDARR_" und dem Namen des Array * ohne "Sv" zusammen) * -* PtrArr: SvStrings, SvStringsDtor +* PtrArr: SvStringsDtor * SortArr: SvStringsSort, SvStringsSortDtor, * SvStringsISort, SvStringsISortDtor, ***********************************************************************/ @@ -45,12 +45,6 @@ typedef String* StringPtr; - -#ifndef _SVSTDARR_STRINGS_DECL -SV_DECL_PTRARR_VISIBILITY( SvStrings, StringPtr, 1, 1, SVL_DLLPUBLIC ) -#define _SVSTDARR_STRINGS_DECL -#endif - #ifndef _SVSTDARR_STRINGSDTOR_DECL SV_DECL_PTRARR_DEL_VISIBILITY( SvStringsDtor, StringPtr, 1, 1, SVL_DLLPUBLIC ) #define _SVSTDARR_STRINGSDTOR_DECL diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx index 75cbdd6..337af7c 100644 --- a/svl/source/items/style.cxx +++ b/svl/source/items/style.cxx @@ -29,7 +29,6 @@ #include <com/sun/star/lang/XComponent.hpp> -#define _SVSTDARR_STRINGS #define _SVSTDARR_STRINGSSORTDTOR #define _SVSTDARR_BYTESTRINGS #define _SVSTDARR_BYTESTRINGSSORTDTOR diff --git a/svl/source/memtools/svarray.cxx b/svl/source/memtools/svarray.cxx index 89f6ab1..3302321 100644 --- a/svl/source/memtools/svarray.cxx +++ b/svl/source/memtools/svarray.cxx @@ -30,7 +30,6 @@ #define _SVARRAY_CXX #define _SVSTDARR_sal_uInt16S -#define _SVSTDARR_STRINGS #define _SVSTDARR_STRINGSDTOR #define _SVSTDARR_STRINGSSORT #define _SVSTDARR_STRINGSSORTDTOR @@ -59,7 +58,6 @@ sal_uInt16 SvPtrarr::GetPos( const VoidPtr& aElement ) const return ( n >= nA ? USHRT_MAX : n ); } -SV_IMPL_PTRARR( SvStrings, StringPtr ) SV_IMPL_PTRARR( SvStringsDtor, StringPtr ) // ---------------- strings ------------------------------------- diff --git a/svx/inc/svx/numfmtsh.hxx b/svx/inc/svx/numfmtsh.hxx index 5c7ce26..a2425a4 100644 --- a/svx/inc/svx/numfmtsh.hxx +++ b/svx/inc/svx/numfmtsh.hxx @@ -33,9 +33,6 @@ #include <tools/string.hxx> #include <i18npool/lang.h> -#ifndef _SVSTDARR_STRINGS -#define _SVSTDARR_STRINGS -#endif #include "svx/svxdllapi.h" #include <svl/svstdarr.hxx> diff --git a/sw/source/core/doc/docdde.cxx b/sw/source/core/doc/docdde.cxx index 2d37606..151840b 100644 --- a/sw/source/core/doc/docdde.cxx +++ b/sw/source/core/doc/docdde.cxx @@ -34,8 +34,6 @@ #include <vcl/svapp.hxx> #include <tools/urlobj.hxx> -#define _SVSTDARR_STRINGS -#include <svl/svstdarr.hxx> #include <sfx2/linkmgr.hxx> // LinkManager #include <unotools/charclass.hxx> #include <fmtcntnt.hxx> diff --git a/sw/source/filter/basflt/fltini.cxx b/sw/source/filter/basflt/fltini.cxx index b2da3f9..0babb76 100644 --- a/sw/source/filter/basflt/fltini.cxx +++ b/sw/source/filter/basflt/fltini.cxx @@ -26,8 +26,6 @@ * ************************************************************************/ -#define _SVSTDARR_STRINGS - #include <string.h> #include <stdio.h> // sscanf #include <hintids.hxx> diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index 3dc5337..019c9dd 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -38,8 +38,6 @@ #endif #include <hintids.hxx> -#define _SVSTDARR_STRINGS -#include <svl/svstdarr.hxx> #include <svl/stritem.hxx> #include <svtools/imap.hxx> #include <svtools/htmltokn.h> diff --git a/sw/source/ui/uno/unoatxt.cxx b/sw/source/ui/uno/unoatxt.cxx index dba39b1..413bac6 100644 --- a/sw/source/ui/uno/unoatxt.cxx +++ b/sw/source/ui/uno/unoatxt.cxx @@ -28,8 +28,6 @@ -#define _SVSTDARR_STRINGS - #include <com/sun/star/beans/PropertyAttribute.hpp> #include <osl/mutex.hxx> #include <osl/diagnose.h> commit 9da30d99715466cf161da283caaf2faadfc7e5d9 Author: Brad Sowden <c...@sowden.org> Date: Thu Dec 29 22:30:13 2011 +1300 Easyhack fdo#38831 remove SvStrings Remove unused variables. diff --git a/sc/source/ui/inc/parawin.hxx b/sc/source/ui/inc/parawin.hxx index bacbc2c..a934419 100644 --- a/sc/source/ui/inc/parawin.hxx +++ b/sc/source/ui/inc/parawin.hxx @@ -36,13 +36,6 @@ #include <vcl/group.hxx> #include <svtools/svmedit.hxx> #include <vcl/tabpage.hxx> - -#ifndef _SVSTDARR_STRINGS - -#define _SVSTDARR_STRINGS -#include <svl/svstdarr.hxx> - -#endif #include <vcl/tabctrl.hxx> #include <vector> @@ -96,7 +89,6 @@ private: ArgInput aArgInput[4]; String aDefaultString; - SvStrings aParaArray; DECL_LINK( ScrollHdl, ScrollBar* ); DECL_LINK( ModifyHdl, ArgInput* ); DECL_LINK( GetEdFocusHdl, ArgInput* ); diff --git a/sfx2/inc/sfx2/frmdescr.hxx b/sfx2/inc/sfx2/frmdescr.hxx index ab268e1..beb4085 100644 --- a/sfx2/inc/sfx2/frmdescr.hxx +++ b/sfx2/inc/sfx2/frmdescr.hxx @@ -40,7 +40,6 @@ class SvStream; struct SfxFrameDescriptor_Impl; -class SvStrings; class SfxFrameDescriptor; class Wallpaper; typedef SfxFrameDescriptor* SfxFrameDescriptorPtr; @@ -96,8 +95,6 @@ class SFX2_DLLPUBLIC SfxFrameDescriptor sal_Bool bHasUI; sal_Bool bReadOnly; SfxFrameDescriptor_Impl* pImp; - SvStrings* pScripts; - SvStrings* pComments; public: SfxFrameDescriptor(); diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx index f035e02..85e5374 100644 --- a/sfx2/source/appl/appcfg.cxx +++ b/sfx2/source/appl/appcfg.cxx @@ -760,8 +760,6 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) // Secure-Referers if ( SFX_ITEM_SET == rSet.GetItemState(SID_SECURE_URL, sal_True, &pItem)) { - DELETEZ(pAppData_Impl->pSecureURLs); - DBG_ASSERT(pItem->ISA(SfxStringListItem), "StringListItem expected"); const std::vector<String> &aList = ((SfxStringListItem*)pItem)->GetList(); sal_uInt32 nCount = aList.size(); diff --git a/sfx2/source/appl/appdata.cxx b/sfx2/source/appl/appdata.cxx index 4d8e910..055f130 100644 --- a/sfx2/source/appl/appdata.cxx +++ b/sfx2/source/appl/appdata.cxx @@ -31,8 +31,6 @@ #include <svl/inetstrm.hxx> #include <svl/stritem.hxx> -#define _SVSTDARR_STRINGS -#include <svl/svstdarr.hxx> #include <osl/mutex.hxx> #include <vcl/menu.hxx> @@ -101,7 +99,6 @@ SfxAppData_Impl::SfxAppData_Impl( SfxApplication* ) , pTemplates( 0 ) , pPool(0) , pDisabledSlotList( 0 ) - , pSecureURLs(0) , pSaveOptions( 0 ) , pUndoOptions( 0 ) , pHelpOptions( 0 ) @@ -140,7 +137,6 @@ SfxAppData_Impl::~SfxAppData_Impl() { DeInitDDE(); delete pTopFrames; - delete pSecureURLs; delete pBasicManager; BasicManagerRepository::revokeCreationListener( *pBasMgrListener ); diff --git a/sfx2/source/inc/appdata.hxx b/sfx2/source/inc/appdata.hxx index 8783675..99baa53 100644 --- a/sfx2/source/inc/appdata.hxx +++ b/sfx2/source/inc/appdata.hxx @@ -41,7 +41,6 @@ #include <vector> class SfxApplication; -class SvStrings; class SfxProgress; class SfxChildWinFactArr_Impl; class SfxDdeDocTopics_Impl; @@ -125,7 +124,6 @@ public: // global pointers SfxItemPool* pPool; std::vector<sal_uInt16>* pDisabledSlotList; - SvStrings* pSecureURLs; SvtSaveOptions* pSaveOptions; SvtUndoOptions* pUndoOptions; SvtHelpOptions* pHelpOptions; commit 4998b04122f98ce689ce8af7f3b32fe03f9b771a Author: Brad Sowden <c...@sowden.org> Date: Thu Dec 29 22:29:34 2011 +1300 Easyhack fdo#38831 remove SvStrings ------ With the for loop below Insert(x,nPos) was previously applied but nPos is initialised to the end of vector and is always incremented in every loop iteration i.e. Insert(x,nPos) is effectively a push_back(x). Agree? In "short SvxNumberFormatShell::FillEListWithUserCurrencys(....)" Also get rid of SvxDelStrgs (variant of SvStrings) diff --git a/cui/source/inc/numfmt.hxx b/cui/source/inc/numfmt.hxx index 2fb233d..ccfea59 100644 --- a/cui/source/inc/numfmt.hxx +++ b/cui/source/inc/numfmt.hxx @@ -46,6 +46,7 @@ class SvxNumberFormatShell; class SvxNumberInfoItem; +class vector; //------------------------------------------------------------------------ @@ -147,10 +148,10 @@ private: #ifdef _SVX_NUMFMT_CXX void Init_Impl(); void FillCurrencyBox(); - void FillFormatListBox_Impl( SvxDelStrgs& rEntries ); + void FillFormatListBox_Impl( std::vector<String*>& rEntries ); void UpdateOptions_Impl( sal_Bool bCheckCatChange ); void UpdateFormatListBox_Impl( sal_uInt16 bCat, sal_Bool bUpdateEdit ); - void DeleteEntryList_Impl( SvxDelStrgs& rEntries ); + void DeleteEntryList_Impl( std::vector<String*>& rEntries ); void Obstructing(); void EnableBySourceFormat_Impl(); void SetCategory( sal_uInt16 nPos ); diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx index 5866cfc..17b2fbf 100644 --- a/cui/source/tabpages/numfmt.cxx +++ b/cui/source/tabpages/numfmt.cxx @@ -34,7 +34,6 @@ #include <unotools/localedatawrapper.hxx> #include <i18npool/lang.h> #include <svx/dialogs.hrc> -#define _SVSTDARR_STRINGS #define _SVSTDARR_STRINGSDTOR #include <svl/svstdarr.hxx> #include <svtools/colorcfg.hxx> @@ -53,6 +52,7 @@ #include <sfx2/app.hxx> #include <sfx2/basedlgs.hxx> #include "svx/flagsdef.hxx" +#include <vector> #define NUMKEY_UNDEFINED SAL_MAX_UINT32 @@ -399,7 +399,7 @@ void SvxNumberFormatTabPage::Reset( const SfxItemSet& rSet ) sal_uInt16 nCatLbSelPos = 0; sal_uInt16 nFmtLbSelPos = 0; LanguageType eLangType = LANGUAGE_DONTKNOW; - SvxDelStrgs aFmtEntryList; + std::vector<String*> aFmtEntryList; SvxNumberValueType eValType = SVX_VALUE_TYPE_UNDEFINED; double nValDouble = 0; String aValString; @@ -830,22 +830,21 @@ void SvxNumberFormatTabPage::SetInfoItem( const SvxNumberInfoItem& rItem ) } } -void SvxNumberFormatTabPage::FillFormatListBox_Impl( SvxDelStrgs& rEntries ) +void SvxNumberFormatTabPage::FillFormatListBox_Impl( std::vector<String*>& rEntries ) { String* pEntry; String aTmpString; String aTmpCatString; Font aFont=aLbCategory.GetFont(); - sal_uInt16 i = 0; + size_t i = 0; short nTmpCatPos; short aPrivCat; aLbFormat.Clear(); aLbFormat.SetUpdateMode( sal_False ); - sal_uInt16 nCount = rEntries.Count(); - - if(nCount<1) return; + if( rEntries.empty() ) + return; if(bOneAreaFlag) { @@ -878,10 +877,10 @@ void SvxNumberFormatTabPage::FillFormatListBox_Impl( SvxDelStrgs& rEntries ) if(pNumFmtShell!=NULL) { - for ( ; i < nCount; ++i ) + for ( ; i < rEntries.size(); ++i ) { pEntry = rEntries[i]; - aPrivCat=pNumFmtShell->GetCategory4Entry(i); + aPrivCat=pNumFmtShell->GetCategory4Entry( static_cast<sal_uInt16>(i) ); if(aPrivCat!=CAT_TEXT) { Color* pPreviewColor = NULL; @@ -900,21 +899,11 @@ void SvxNumberFormatTabPage::FillFormatListBox_Impl( SvxDelStrgs& rEntries ) } -/************************************************************************* -#* Methode: DeleteEntryList_Impl -#*------------------------------------------------------------------------ -#* -#* Klasse: SvxNumberFormatTabPage -#* Funktion: Loescht eine SvStrings- Liste -#* Input: String-liste -#* Output: --- -#* -#************************************************************************/ - -void SvxNumberFormatTabPage::DeleteEntryList_Impl( SvxDelStrgs& rEntries ) +void SvxNumberFormatTabPage::DeleteEntryList_Impl( std::vector<String*>& rEntries ) { - sal_uInt16 nCount = rEntries.Count(); - rEntries.DeleteAndDestroy(0,nCount); + for( std::vector<String*>::const_iterator it(rEntries.begin()); it != rEntries.end(); ++it ) + delete *it; + rEntries.clear(); } @@ -932,7 +921,6 @@ void SvxNumberFormatTabPage::DeleteEntryList_Impl( SvxDelStrgs& rEntries ) void SvxNumberFormatTabPage::UpdateOptions_Impl( sal_Bool bCheckCatChange /*= sal_False*/ ) { - SvxDelStrgs aEntryList; String theFormat = aEdFormat.GetText(); sal_uInt16 nCurCategory = aLbCategory.GetSelectEntryPos(); sal_uInt16 nCategory = nCurCategory; @@ -1050,9 +1038,9 @@ void SvxNumberFormatTabPage::UpdateFormatListBox_Impl sal_Bool bUpdateEdit // Format-Edit aktualisieren? ) { - SvxDelStrgs aEntryList; - short nFmtLbSelPos = 0; - short nTmpCatPos; + std::vector<String*> aEntryList; + short nFmtLbSelPos = 0; + short nTmpCatPos; if(bOneAreaFlag) { @@ -1093,7 +1081,7 @@ void SvxNumberFormatTabPage::UpdateFormatListBox_Impl REMOVE_DONTKNOW() // ggF. UI-Enable - if ( (aEntryList.Count() > 0) && (nFmtLbSelPos != SELPOS_NONE) ) + if ( (!aEntryList.empty()) && (nFmtLbSelPos != SELPOS_NONE) ) { if(bUpdateEdit) { @@ -1146,6 +1134,8 @@ void SvxNumberFormatTabPage::UpdateFormatListBox_Impl aWndPreview.NotifyChange( String() ); } } + + DeleteEntryList_Impl( aEntryList ); } @@ -1243,7 +1233,6 @@ IMPL_LINK( SvxNumberFormatTabPage, SelFormatHdl_Impl, void *, pLb ) sal_uInt16 nSelPos = (sal_uInt16) aLbFormat.GetSelectEntryPos(); String aFormat = aLbFormat.GetSelectEntry(); String aComment; - SvxDelStrgs aEntryList; short nFmtLbSelPos = nSelPos; @@ -1336,12 +1325,12 @@ IMPL_LINK( SvxNumberFormatTabPage, ClickHdl_Impl, ImageButton*, pIB) if(pIB==&aIbAdd) { // Also called from FillItemSet() if a temporary currency format has // to be added, not only if the Add button is enabled. - String aFormat = aEdFormat.GetText(); - SvxDelStrgs aEntryList; - SvxDelStrgs a2EntryList; - sal_uInt16 nCatLbSelPos = 0; - short nFmtLbSelPos = SELPOS_NONE; - xub_StrLen nErrPos=0; + String aFormat = aEdFormat.GetText(); + std::vector<String*> aEntryList; + std::vector<String*> a2EntryList; + sal_uInt16 nCatLbSelPos = 0; + short nFmtLbSelPos = SELPOS_NONE; + xub_StrLen nErrPos=0; pNumFmtShell->SetCurCurrencyEntry(NULL); bAdded = pNumFmtShell->AddFormat( aFormat, nErrPos, @@ -1418,13 +1407,16 @@ IMPL_LINK( SvxNumberFormatTabPage, ClickHdl_Impl, ImageButton*, pIB) } EditHdl_Impl( &aEdFormat ); nReturn = ((nReturn & nReturnOneArea) ? 0 : (nReturn & nReturnChanged)); + + DeleteEntryList_Impl( aEntryList ); + DeleteEntryList_Impl( a2EntryList ); } else if(pIB==&aIbRemove) { - String aFormat = aEdFormat.GetText(); - SvxDelStrgs aEntryList; - sal_uInt16 nCatLbSelPos = 0; - short nFmtLbSelPos = SELPOS_NONE; + String aFormat = aEdFormat.GetText(); + std::vector<String*> aEntryList; + sal_uInt16 nCatLbSelPos = 0; + short nFmtLbSelPos = SELPOS_NONE; bDeleted = pNumFmtShell->RemoveFormat( aFormat, nCatLbSelPos, @@ -1434,7 +1426,7 @@ IMPL_LINK( SvxNumberFormatTabPage, ClickHdl_Impl, ImageButton*, pIB) aEdComment.SetText(aLbCategory.GetEntry(1)); if ( bDeleted ) { - if(nFmtLbSelPos>=0 && nFmtLbSelPos<aEntryList.Count()) + if( nFmtLbSelPos>=0 && static_cast<size_t>(nFmtLbSelPos)<aEntryList.size() ) { aFormat = *aEntryList[nFmtLbSelPos]; } @@ -1460,6 +1452,8 @@ IMPL_LINK( SvxNumberFormatTabPage, ClickHdl_Impl, ImageButton*, pIB) } } EditHdl_Impl( &aEdFormat ); + + DeleteEntryList_Impl( aEntryList ); } else if(pIB==&aIbInfo) { diff --git a/svx/inc/svx/numfmtsh.hxx b/svx/inc/svx/numfmtsh.hxx index 89e9686..5c7ce26 100644 --- a/svx/inc/svx/numfmtsh.hxx +++ b/svx/inc/svx/numfmtsh.hxx @@ -47,7 +47,6 @@ class Color; class SvNumberFormatter; class SvNumberFormatTable; -class SvStrings; class SvStringsDtor; class NfCurrencyEntry; // enum ------------------------------------------------------------------ @@ -78,15 +77,6 @@ enum SvxNumberValueType #define NUMBERFORMAT_ENTRY_NEW_CURRENCY NUMBERFORMAT_ENTRY_NOT_FOUND-1 -class SvxDelStrgs: public SvStrings -{ - -public: - ~SvxDelStrgs() { DeleteAndDestroy(0,Count());} - -}; - -// class SvxNumberFormatShell -------------------------------------------- class SVX_DLLPUBLIC SvxNumberFormatShell { @@ -117,35 +107,35 @@ public: const String* pNumStr = NULL ); - void GetInitSettings( sal_uInt16& nCatLbPos, - LanguageType& rLangType, - sal_uInt16& nFmtLbSelPos, - SvStrings& rFmtEntries, - String& rPrevString, - Color*& rpPrevColor ); + void GetInitSettings( sal_uInt16& nCatLbPos, + LanguageType& rLangType, + sal_uInt16& nFmtLbSelPos, + std::vector<String*>& rFmtEntries, + String& rPrevString, + Color*& rpPrevColor ); - void CategoryChanged( sal_uInt16 nCatLbPos, - short& rFmtSelPos, - SvStrings& rFmtEntries ); + void CategoryChanged( sal_uInt16 nCatLbPos, + short& rFmtSelPos, + std::vector<String*>& rFmtEntries ); - void LanguageChanged( LanguageType eLangType, - short& rFmtSelPos, - SvStrings& rFmtEntries ); + void LanguageChanged( LanguageType eLangType, + short& rFmtSelPos, + std::vector<String*>& rFmtEntries ); void FormatChanged( sal_uInt16 nFmtLbPos, String& rPreviewStr, Color*& rpFontColor ); - bool AddFormat( String& rFormat, - xub_StrLen& rErrPos, - sal_uInt16& rCatLbSelPos, - short& rFmtSelPos, - SvStrings& rFmtEntries ); + bool AddFormat( String& rFormat, + xub_StrLen& rErrPos, + sal_uInt16& rCatLbSelPos, + short& rFmtSelPos, + std::vector<String*>& rFmtEntries ); - bool RemoveFormat( const String& rFormat, - sal_uInt16& rCatLbSelPos, - short& rFmtSelPos, - SvStrings& rFmtEntries ); + bool RemoveFormat( const String& rFormat, + sal_uInt16& rCatLbSelPos, + short& rFmtSelPos, + std::vector<String*>& rFmtEntries ); void MakeFormat( String& rFormat, bool bThousand, @@ -229,31 +219,29 @@ private: NfCurrencyEntry* pCurCurrencyEntry; bool bBankingSymbol; sal_uInt16 nCurCurrencyEntryPos; - SvStrings aCurrencyFormatList; + std::vector<String*> aCurrencyFormatList; #ifdef _SVX_NUMFMTSH_CXX - SVX_DLLPRIVATE short FillEntryList_Impl( SvStrings& rList ); - SVX_DLLPRIVATE void FillEListWithStd_Impl( SvStrings& rList,sal_uInt16 aPrivCat, short &Pos); - SVX_DLLPRIVATE short FillEListWithFormats_Impl( SvStrings& rList,short nSelPos, + SVX_DLLPRIVATE short FillEntryList_Impl( std::vector<String*>& rList ); + SVX_DLLPRIVATE void FillEListWithStd_Impl( std::vector<String*>& rList,sal_uInt16 aPrivCat, short &Pos); + SVX_DLLPRIVATE short FillEListWithFormats_Impl( std::vector<String*>& rList,short nSelPos, NfIndexTableOffset eOffsetStart, NfIndexTableOffset eOffsetEnd); + SVX_DLLPRIVATE short FillEListWithDateTime_Impl( std::vector<String*>& rList,short nSelPos); + SVX_DLLPRIVATE short FillEListWithCurrency_Impl( std::vector<String*>& rList,short nSelPos); + SVX_DLLPRIVATE short FillEListWithSysCurrencys( std::vector<String*>& rList,short nSelPos); + SVX_DLLPRIVATE short FillEListWithUserCurrencys( std::vector<String*>& rList,short nSelPos); + SVX_DLLPRIVATE short FillEListWithUsD_Impl( std::vector<String*>& rList, sal_uInt16 nPrivCat, short Pos ); - SVX_DLLPRIVATE short FillEListWithDateTime_Impl( SvStrings& rList,short nSelPos); - - SVX_DLLPRIVATE short FillEListWithCurrency_Impl( SvStrings& rList,short nSelPos); - SVX_DLLPRIVATE short FillEListWithSysCurrencys( SvStrings& rList,short nSelPos); - SVX_DLLPRIVATE short FillEListWithUserCurrencys( SvStrings& rList,short nSelPos); - - SVX_DLLPRIVATE short FillEListWithUsD_Impl( SvStrings& rList, sal_uInt16 nPrivCat, short Pos ); SVX_DLLPRIVATE ::std::vector<sal_uInt32>::iterator GetRemoved_Impl( size_t nKey ); SVX_DLLPRIVATE bool IsRemoved_Impl( size_t nKey ); SVX_DLLPRIVATE ::std::vector<sal_uInt32>::iterator GetAdded_Impl( size_t nKey ); SVX_DLLPRIVATE bool IsAdded_Impl( size_t nKey ); - SVX_DLLPRIVATE void GetPreviewString_Impl( String& rString, - Color*& rpColor ); - SVX_DLLPRIVATE void PosToCategory_Impl( sal_uInt16 nPos, short& rCategory ); - SVX_DLLPRIVATE void CategoryToPos_Impl( short nCategory, sal_uInt16& rPos ); + SVX_DLLPRIVATE void GetPreviewString_Impl( String& rString, + Color*& rpColor ); + SVX_DLLPRIVATE void PosToCategory_Impl( sal_uInt16 nPos, short& rCategory ); + SVX_DLLPRIVATE void CategoryToPos_Impl( short nCategory, sal_uInt16& rPos ); #endif }; diff --git a/svx/source/items/numfmtsh.cxx b/svx/source/items/numfmtsh.cxx index 9c0ba71..72b41fe 100644 --- a/svx/source/items/numfmtsh.cxx +++ b/svx/source/items/numfmtsh.cxx @@ -162,8 +162,9 @@ SvxNumberFormatShell::~SvxNumberFormatShell() pFormatter->DeleteEntry( *it ); } - if(aCurrencyFormatList.Count()>0) - aCurrencyFormatList.DeleteAndDestroy(0,aCurrencyFormatList.Count()); + for ( std::vector<String*>::const_iterator it(aCurrencyFormatList.begin()); + it != aCurrencyFormatList.end(); ++it ) + delete *it; } // ----------------------------------------------------------------------- @@ -188,9 +189,9 @@ void SvxNumberFormatShell::GetUpdateData( sal_uInt32* pDelArray, const sal_uInt3 // ----------------------------------------------------------------------- -void SvxNumberFormatShell::CategoryChanged( sal_uInt16 nCatLbPos, - short& rFmtSelPos, - SvStrings& rFmtEntries ) +void SvxNumberFormatShell::CategoryChanged( sal_uInt16 nCatLbPos, + short& rFmtSelPos, + std::vector<String*>& rFmtEntries ) { short nOldCategory = nCurCategory; PosToCategory_Impl( nCatLbPos, nCurCategory ); @@ -206,8 +207,8 @@ void SvxNumberFormatShell::CategoryChanged( sal_uInt16 nCatLbPos, // ----------------------------------------------------------------------- void SvxNumberFormatShell::LanguageChanged( LanguageType eLangType, - short& rFmtSelPos, - SvStrings& rFmtEntries ) + short& rFmtSelPos, + std::vector<String*>& rFmtEntries ) { eCurLanguage = eLangType; pCurFmtTable = &(pFormatter->ChangeCL( nCurCategory, @@ -232,7 +233,7 @@ void SvxNumberFormatShell::FormatChanged( sal_uInt16 nFmtLbPos, } else if( nCurCategory == NUMBERFORMAT_CURRENCY ) { - if(nFmtLbPos<aCurrencyFormatList.Count()) + if( static_cast<size_t>(nFmtLbPos) < aCurrencyFormatList.size() ) { MakePrevStringFromVal(*aCurrencyFormatList[nFmtLbPos], rPreviewStr,rpFontColor,nValNum); @@ -244,7 +245,7 @@ void SvxNumberFormatShell::FormatChanged( sal_uInt16 nFmtLbPos, bool SvxNumberFormatShell::AddFormat( String& rFormat, xub_StrLen& rErrPos, sal_uInt16& rCatLbSelPos, short& rFmtSelPos, - SvStrings& rFmtEntries ) + std::vector<String*>& rFmtEntries ) { bool bInserted = false; sal_uInt32 nAddKey = pFormatter->GetEntryKey( rFormat, eCurLanguage ); @@ -311,10 +312,10 @@ bool SvxNumberFormatShell::AddFormat( String& rFormat, xub_StrLen& rErrPos, // ----------------------------------------------------------------------- -bool SvxNumberFormatShell::RemoveFormat( const String& rFormat, - sal_uInt16& rCatLbSelPos, - short& rFmtSelPos, - SvStrings& rFmtEntries ) +bool SvxNumberFormatShell::RemoveFormat( const String& rFormat, + sal_uInt16& rCatLbSelPos, + short& rFmtSelPos, + std::vector<String*>& rFmtEntries ) { sal_uInt32 nDelKey = pFormatter->GetEntryKey( rFormat, eCurLanguage ); @@ -352,10 +353,10 @@ void SvxNumberFormatShell::MakeFormat( String& rFormat, sal_uInt16 nPrecision, sal_uInt16 nLeadingZeroes, sal_uInt16 nCurrencyPos) { - if(aCurrencyFormatList.Count()>nCurrencyPos) + if( aCurrencyFormatList.size() > static_cast<size_t>(nCurrencyPos) ) { xub_StrLen rErrPos=0; - SvStrings aFmtEList; + std::vector<String*> aFmtEList; sal_uInt32 nFound = pFormatter->TestNewString( *aCurrencyFormatList[nCurrencyPos], eCurLanguage ); @@ -374,7 +375,8 @@ void SvxNumberFormatShell::MakeFormat( String& rFormat, bThousand, bNegRed, nPrecision, nLeadingZeroes ); } - aFmtEList.DeleteAndDestroy(0,aFmtEList.Count()); + for ( std::vector<String*>::const_iterator it(aFmtEList.begin()); it != aFmtEList.end(); ++it ) + delete *it; } else { @@ -517,13 +519,12 @@ bool SvxNumberFormatShell::FindEntry( const String& rFmtString, sal_uInt32* pAt // ----------------------------------------------------------------------- -void SvxNumberFormatShell::GetInitSettings( - sal_uInt16& nCatLbPos, - LanguageType& rLangType, - sal_uInt16& nFmtLbSelPos, - SvStrings& rFmtEntries, - String& rPrevString, - Color*& rpPrevColor ) +void SvxNumberFormatShell::GetInitSettings( sal_uInt16& nCatLbPos, + LanguageType& rLangType, + sal_uInt16& nFmtLbSelPos, + std::vector<String*>& rFmtEntries, + String& rPrevString, + Color*& rpPrevColor ) { // ------------------------------------------------------------------- // Vorbedingung: Zahlenformatierer gefunden @@ -558,7 +559,7 @@ void SvxNumberFormatShell::GetInitSettings( // ----------------------------------------------------------------------- -short SvxNumberFormatShell::FillEntryList_Impl( SvStrings& rList ) +short SvxNumberFormatShell::FillEntryList_Impl( std::vector<String*>& rList ) { /* Erstellen einer aktuellen Liste von Format-Eintraegen. * Rueckgabewert ist die Listenposition des aktuellen Formates. @@ -595,7 +596,8 @@ short SvxNumberFormatShell::FillEntryList_Impl( SvStrings& rList ) return nSelPos; } -void SvxNumberFormatShell::FillEListWithStd_Impl( SvStrings& rList,sal_uInt16 nPrivCat,short &nSelPos ) +void SvxNumberFormatShell::FillEListWithStd_Impl( std::vector<String*>& rList, + sal_uInt16 nPrivCat,short &nSelPos ) { /* Erstellen einer aktuellen Liste von Format-Eintraegen. * Rueckgabewert ist die Listenposition des aktuellen Formates. @@ -604,8 +606,10 @@ void SvxNumberFormatShell::FillEListWithStd_Impl( SvStrings& rList,sal_uInt16 nP */ DBG_ASSERT( pCurFmtTable != NULL, "Unbekanntes Zahlenformat!" ); - if(aCurrencyFormatList.Count()>0) - aCurrencyFormatList.DeleteAndDestroy(0,aCurrencyFormatList.Count()); + for ( std::vector<String*>::const_iterator it(aCurrencyFormatList.begin()); + it != aCurrencyFormatList.end(); ++it ) + delete *it; + aCurrencyFormatList.clear(); if(nPrivCat==CAT_CURRENCY) { @@ -658,7 +662,8 @@ void SvxNumberFormatShell::FillEListWithStd_Impl( SvStrings& rList,sal_uInt16 nP } } -short SvxNumberFormatShell::FillEListWithFormats_Impl( SvStrings& rList,short nSelPos, +short SvxNumberFormatShell::FillEListWithFormats_Impl( std::vector<String*>& rList, + short nSelPos, NfIndexTableOffset eOffsetStart, NfIndexTableOffset eOffsetEnd) { @@ -702,14 +707,15 @@ short SvxNumberFormatShell::FillEListWithFormats_Impl( SvStrings& rList,short nS nSelPos = ( !IsRemoved_Impl( nNFEntry ) ) ? aCurEntryList.size() : SELPOS_NONE; } - rList.Insert( pStr,rList.Count()); + rList.push_back( pStr ); aCurEntryList.push_back( nNFEntry ); } return nSelPos; } -short SvxNumberFormatShell::FillEListWithDateTime_Impl( SvStrings& rList,short nSelPos) +short SvxNumberFormatShell::FillEListWithDateTime_Impl( std::vector<String*>& rList, + short nSelPos) { sal_uInt16 nMyType; @@ -745,7 +751,7 @@ short SvxNumberFormatShell::FillEListWithDateTime_Impl( SvStrings& rList,short n nSelPos = ( !IsRemoved_Impl( nNFEntry ) ) ? aCurEntryList.size() : SELPOS_NONE; } - rList.Insert( pStr,rList.Count()); + rList.push_back( pStr ); aCurEntryList.push_back( nNFEntry ); } } @@ -753,7 +759,8 @@ short SvxNumberFormatShell::FillEListWithDateTime_Impl( SvStrings& rList,short n return nSelPos; } -short SvxNumberFormatShell::FillEListWithCurrency_Impl( SvStrings& rList,short nSelPos) +short SvxNumberFormatShell::FillEListWithCurrency_Impl( std::vector<String*>& rList, + short nSelPos) { /* Erstellen einer aktuellen Liste von Format-Eintraegen. * Rueckgabewert ist die Listenposition des aktuellen Formates. @@ -786,7 +793,8 @@ short SvxNumberFormatShell::FillEListWithCurrency_Impl( SvStrings& rList,short n } -short SvxNumberFormatShell::FillEListWithSysCurrencys( SvStrings& rList,short nSelPos) +short SvxNumberFormatShell::FillEListWithSysCurrencys( std::vector<String*>& rList, + short nSelPos) { /* Erstellen einer aktuellen Liste von Format-Eintraegen. * Rueckgabewert ist die Listenposition des aktuellen Formates. @@ -832,7 +840,7 @@ short SvxNumberFormatShell::FillEListWithSysCurrencys( SvStrings& rList,short nS nSelPos = ( !IsRemoved_Impl( nNFEntry ) ) ? aCurEntryList.size() : SELPOS_NONE; } - rList.Insert( pStr,rList.Count()); + rList.push_back( pStr ); aCurEntryList.push_back( nNFEntry ); } @@ -868,7 +876,7 @@ short SvxNumberFormatShell::FillEListWithSysCurrencys( SvStrings& rList,short nS const StringPtr pStr = new String(aNewFormNInfo); if ( nKey == nCurFormatKey ) nSelPos =aCurEntryList.size(); - rList.Insert( pStr,rList.Count()); + rList.push_back( pStr ); aCurEntryList.push_back( nKey ); } } @@ -878,7 +886,8 @@ short SvxNumberFormatShell::FillEListWithSysCurrencys( SvStrings& rList,short nS return nSelPos; } -short SvxNumberFormatShell::FillEListWithUserCurrencys( SvStrings& rList,short nSelPos) +short SvxNumberFormatShell::FillEListWithUserCurrencys( std::vector<String*>& rList, + short nSelPos) { /* Erstellen einer aktuellen Liste von Format-Eintraegen. * Rueckgabewert ist die Listenposition des aktuellen Formates. @@ -900,7 +909,7 @@ short SvxNumberFormatShell::FillEListWithUserCurrencys( SvStrings& rList,short n XubString rSymbol; XubString rBankSymbol; - SvStrings aList; + std::vector<String*> aList; std::vector<sal_uInt32> aKeyList; pFormatter->GetNewCurrencySymbolString(nCurFormatKey,rSymbol, @@ -982,9 +991,7 @@ short SvxNumberFormatShell::FillEListWithUserCurrencys( SvStrings& rList,short n if(bInsFlag) { - const StringPtr pStr = new String(aNewFormNInfo); - - aList.Insert( pStr,aList.Count()); + aList.push_back( new String(aNewFormNInfo) ); aKeyList.push_back( nKey ); } } @@ -1020,14 +1027,14 @@ short SvxNumberFormatShell::FillEListWithUserCurrencys( SvStrings& rList,short n } } - size_t i,nPos; - size_t nOldListCount = rList.Count(); - for( i = 0, nPos = nOldListCount; i < aWSStringsDtor.Count(); ++i) + size_t nOldListCount = rList.size(); + for( size_t i = 0, nPos = nOldListCount; + i < static_cast<size_t>(aWSStringsDtor.Count()); ++i ) { bool bFlag = true; String aInsStr(*aWSStringsDtor[i]); size_t j; - for( j=0; j < aList.Count(); ++j ) + for( j=0; j < aList.size(); ++j ) { const StringPtr pTestStr=aList[j]; @@ -1039,30 +1046,30 @@ short SvxNumberFormatShell::FillEListWithUserCurrencys( SvStrings& rList,short n } if(bFlag) { - rList.Insert(new String(aInsStr),nPos); + rList.push_back( new String(aInsStr) ); aCurEntryList.insert( aCurEntryList.begin() + (nPos++), NUMBERFORMAT_ENTRY_NOT_FOUND); } else { - rList.Insert(aList[j],nPos); - aList.Remove(j); + rList.push_back( aList[j] ); + aList.erase( aList.begin()+j ); aCurEntryList.insert( aCurEntryList.begin() + (nPos++), aKeyList[j]); aKeyList.erase( aKeyList.begin()+j ); } } - for( i = 0; i < aKeyList.size(); ++i ) + for( size_t i = 0; i < aKeyList.size(); ++i ) { if( aKeyList[i] != NUMBERFORMAT_ENTRY_NOT_FOUND ) { - rList.Insert(aList[i],rList.Count()); + rList.push_back( aList[i] ); aCurEntryList.push_back( aKeyList[i] ); } } - for( i = nOldListCount; i < rList.Count(); ++i ) + for( size_t i = nOldListCount; i < rList.size(); ++i ) { - aCurrencyFormatList.Insert(new String(*rList[i]),aCurrencyFormatList.Count()); + aCurrencyFormatList.push_back( new String(*rList[i]) ); if ( nSelPos == SELPOS_NONE && bAdaptSelPos && aCurEntryList[i] == nCurFormatKey ) nSelPos = i; @@ -1075,7 +1082,8 @@ short SvxNumberFormatShell::FillEListWithUserCurrencys( SvStrings& rList,short n } -short SvxNumberFormatShell::FillEListWithUsD_Impl( SvStrings& rList, sal_uInt16 nPrivCat, short nSelPos) +short SvxNumberFormatShell::FillEListWithUsD_Impl( std::vector<String*>& rList, + sal_uInt16 nPrivCat, short nSelPos ) { /* Erstellen einer aktuellen Liste von Format-Eintraegen. * Rueckgabewert ist die Listenposition des aktuellen Formates. @@ -1122,7 +1130,7 @@ short SvxNumberFormatShell::FillEListWithUsD_Impl( SvStrings& rList, sal_uInt16 const StringPtr pStr = new String(aNewFormNInfo); if ( nKey == nCurFormatKey ) nSelPos = aCurEntryList.size(); - rList.Insert( pStr,rList.Count()); + rList.push_back( pStr ); aCurEntryList.push_back( nKey ); } } @@ -1344,7 +1352,7 @@ short SvxNumberFormatShell::GetCategory4Entry(short nEntry) } return 0; } - else if(aCurrencyFormatList.Count()>0) + else if( !aCurrencyFormatList.empty() ) { return CAT_CURRENCY; } @@ -1412,9 +1420,9 @@ String SvxNumberFormatShell::GetFormat4Entry(short nEntry) if(nEntry < 0) return String(); - if(aCurrencyFormatList.Count()>0) + if( !aCurrencyFormatList.empty() ) { - if(aCurrencyFormatList.Count()>nEntry) + if( aCurrencyFormatList.size() > static_cast<size_t>(nEntry) ) return *aCurrencyFormatList[nEntry]; } else @@ -1478,15 +1486,12 @@ short SvxNumberFormatShell::GetListPos4Entry( const String& rFmtString ) } else { - if(aCurrencyFormatList.Count()>0) + for( size_t i=0; i<aCurrencyFormatList.size(); i++ ) { - for(sal_uInt16 i=0;i<aCurrencyFormatList.Count();i++) + if (rFmtString==*aCurrencyFormatList[i]) { - if (rFmtString==*aCurrencyFormatList[i]) - { - nSelP=i; - break; - } + nSelP = static_cast<short>(i); + break; } } } commit 9ff11d8b1db565e5bb82d85b130c434f01fb06ad Author: Brad Sowden <c...@sowden.org> Date: Thu Dec 29 22:28:31 2011 +1300 Easyhack fdo#38831 remove SvStrings Remove a function contained in unusedcode.easy that includes SvStrings. diff --git a/svx/inc/svx/numfmtsh.hxx b/svx/inc/svx/numfmtsh.hxx index df2a42c..89e9686 100644 --- a/svx/inc/svx/numfmtsh.hxx +++ b/svx/inc/svx/numfmtsh.hxx @@ -209,8 +209,6 @@ public: sal_uInt16 FindCurrencyTableEntry( const String& rFmtString, bool &bTestBanking ); bool IsInTable(sal_uInt16 nPos,bool bTmpBanking,const String &rFmtString); - void GetCurrencyFormats(SvStrings& rList); - private: static const double DEFAULT_NUMVALUE; diff --git a/svx/source/items/numfmtsh.cxx b/svx/source/items/numfmtsh.cxx index 90c5f3a..9c0ba71 100644 --- a/svx/source/items/numfmtsh.cxx +++ b/svx/source/items/numfmtsh.cxx @@ -1622,21 +1622,6 @@ void SvxNumberFormatShell::GetCurrencySymbols( SvStringsDtor& rList, bool bFlag delete pLanguageTable; } -void SvxNumberFormatShell::GetCurrencyFormats(SvStrings& aListDtor) -{ - if(pCurCurrencyEntry!=NULL) - { - NfWSStringsDtor aWSStringsDtor; - /*sal_uInt16 nDefault = */pFormatter->GetCurrencyFormatStrings( aWSStringsDtor, - *pCurCurrencyEntry, bBankingSymbol ); - - for(sal_uInt16 i=0;i<aWSStringsDtor.Count();i++) - { - aListDtor.Insert(new String(*aWSStringsDtor[i]),aListDtor.Count()); - } - } -} - bool SvxNumberFormatShell::IsBankingSymbol(sal_uInt16 nPos) { const NfCurrencyTable& rCurrencyTable=SvNumberFormatter::GetTheCurrencyTable(); diff --git a/unusedcode.easy b/unusedcode.easy index fa8ca4a..1ed85f7 100644 --- a/unusedcode.easy +++ b/unusedcode.easy @@ -685,7 +685,6 @@ SvxMSDffShapeTxBxSort::Remove(SvxMSDffShapeOrder* const&, unsigned short) SvxMSDffShapeTxBxSort::Remove(unsigned short, unsigned short) SvxNumRule::SetLevel(unsigned short, SvxNumberFormat const*) SvxNumberFormatShell::GetCurCurrencyEntry() -SvxNumberFormatShell::GetCurrencyFormats(SvStrings&) SvxNumberFormatShell::IsBankingSymbol(unsigned short) SvxNumberInfoItem::SetDoubleValue(double const&) SvxNumberInfoItem::SetNumberFormatter(SvNumberFormatter*) commit 516a16c8d1c9366b51f1dfebcfcf918db8be9a71 Author: Brad Sowden <c...@sowden.org> Date: Thu Dec 29 22:27:34 2011 +1300 Easyhack fdo#38831 remove SvStrings diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index 5adc781..f6632ea 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -30,6 +30,7 @@ // STL includes #include <list> +#include <vector> #include <svx/svxids.hrc> #include <editeng/memberids.hrc> @@ -56,8 +57,6 @@ #include <cellatr.hxx> #include <fmtpdsc.hxx> #include <pagedesc.hxx> -#define _SVSTDARR_STRINGS -#include <svl/svstdarr.hxx> #include <viewsh.hxx> #include <tabfrm.hxx> #include <redline.hxx> @@ -562,7 +561,7 @@ SwXCell* lcl_CreateXCell(SwFrmFmt* pFmt, sal_Int32 nColumn, sal_Int32 nRow) return pXCell; } -void lcl_InspectLines(SwTableLines& rLines, SvStrings& rAllNames) +void lcl_InspectLines(SwTableLines& rLines, std::vector<String*>& rAllNames) { for( sal_uInt16 i = 0; i < rLines.Count(); i++ ) { @@ -572,7 +571,7 @@ void lcl_InspectLines(SwTableLines& rLines, SvStrings& rAllNames) { SwTableBox* pBox = rBoxes[j]; if(pBox->GetName().Len() && pBox->getRowSpan() > 0 ) - rAllNames.Insert(new String(pBox->GetName()), rAllNames.Count()); + rAllNames.push_back( new String(pBox->GetName()) ); SwTableLines& rBoxLines = pBox->GetTabLines(); if(rBoxLines.Count()) { @@ -2232,16 +2231,14 @@ uno::Sequence< OUString > SwXTextTable::getCellNames(void) throw( uno::RuntimeEx SwTable* pTable = SwTable::FindTable( pFmt ); // gibts an der Tabelle und an allen Boxen SwTableLines& rTblLines = pTable->GetTabLines(); - SvStrings aAllNames; + std::vector<String*> aAllNames; lcl_InspectLines(rTblLines, aAllNames); - uno::Sequence< OUString > aRet(aAllNames.Count()); + uno::Sequence< OUString > aRet( static_cast<sal_uInt16>(aAllNames.size()) ); OUString* pArray = aRet.getArray(); - for(sal_uInt16 i = aAllNames.Count(); i; i--) + for( size_t i = 0; i < aAllNames.size(); ++i) { - String* pObject = aAllNames.GetObject(i-1); - pArray[i - 1] = *pObject; - aAllNames.Remove(i - 1); - delete pObject; + pArray[i] = *aAllNames[i]; + delete aAllNames[i]; } return aRet; } _______________________________________________ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits