From 4998b04122f98ce689ce8af7f3b32fe03f9b771a Mon Sep 17 00:00:00 2001 From: Brad Sowden Date: Thu, 29 Dec 2011 22:29:34 +1300 Subject: 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) --- svx/inc/svx/numfmtsh.hxx | 80 ++++++++++++++++++++---------------------------- 1 file changed, 34 insertions(+), 46 deletions(-) (limited to 'svx/inc') diff --git a/svx/inc/svx/numfmtsh.hxx b/svx/inc/svx/numfmtsh.hxx index 89e9686bb042..5c7ce26c8f9a 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& rFmtEntries, + String& rPrevString, + Color*& rpPrevColor ); - void CategoryChanged( sal_uInt16 nCatLbPos, - short& rFmtSelPos, - SvStrings& rFmtEntries ); + void CategoryChanged( sal_uInt16 nCatLbPos, + short& rFmtSelPos, + std::vector& rFmtEntries ); - void LanguageChanged( LanguageType eLangType, - short& rFmtSelPos, - SvStrings& rFmtEntries ); + void LanguageChanged( LanguageType eLangType, + short& rFmtSelPos, + std::vector& 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& 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& rFmtEntries ); void MakeFormat( String& rFormat, bool bThousand, @@ -229,31 +219,29 @@ private: NfCurrencyEntry* pCurCurrencyEntry; bool bBankingSymbol; sal_uInt16 nCurCurrencyEntryPos; - SvStrings aCurrencyFormatList; + std::vector 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& rList ); + SVX_DLLPRIVATE void FillEListWithStd_Impl( std::vector& rList,sal_uInt16 aPrivCat, short &Pos); + SVX_DLLPRIVATE short FillEListWithFormats_Impl( std::vector& rList,short nSelPos, NfIndexTableOffset eOffsetStart, NfIndexTableOffset eOffsetEnd); + SVX_DLLPRIVATE short FillEListWithDateTime_Impl( std::vector& rList,short nSelPos); + SVX_DLLPRIVATE short FillEListWithCurrency_Impl( std::vector& rList,short nSelPos); + SVX_DLLPRIVATE short FillEListWithSysCurrencys( std::vector& rList,short nSelPos); + SVX_DLLPRIVATE short FillEListWithUserCurrencys( std::vector& rList,short nSelPos); + SVX_DLLPRIVATE short FillEListWithUsD_Impl( std::vector& 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::iterator GetRemoved_Impl( size_t nKey ); SVX_DLLPRIVATE bool IsRemoved_Impl( size_t nKey ); SVX_DLLPRIVATE ::std::vector::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 }; -- cgit