diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-14 14:36:52 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-17 07:23:22 +0200 |
commit | db3860062ebf4109f48139c2556ff4041aff5d6e (patch) | |
tree | b6ab4df909c8922e48a9c4eefa9a8f0f6a47c41f /svl | |
parent | 846f557fd591626931a9dadb38180786e090104c (diff) |
extend loplugin useuniqueptr to OUString pointers
Change-Id: Ieb5bab3895e1edaff497c4a1a88303ccac097edc
Reviewed-on: https://gerrit.libreoffice.org/39948
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/numbers/zforfind.cxx | 40 | ||||
-rw-r--r-- | svl/source/numbers/zforfind.hxx | 17 |
2 files changed, 25 insertions, 32 deletions
diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx index ddf0f9983f80..f2d6a25b8828 100644 --- a/svl/source/numbers/zforfind.cxx +++ b/svl/source/numbers/zforfind.cxx @@ -95,14 +95,6 @@ ImpSvNumberInputScan::~ImpSvNumberInputScan() { Reset(); delete pNullDate; - delete [] pUpperMonthText; - delete [] pUpperAbbrevMonthText; - delete [] pUpperGenitiveMonthText; - delete [] pUpperGenitiveAbbrevMonthText; - delete [] pUpperPartitiveMonthText; - delete [] pUpperPartitiveAbbrevMonthText; - delete [] pUpperDayText; - delete [] pUpperAbbrevDayText; } @@ -3380,25 +3372,25 @@ void ImpSvNumberInputScan::InitText() const CharClass* pChrCls = pFormatter->GetCharClass(); const CalendarWrapper* pCal = pFormatter->GetCalendar(); - delete [] pUpperMonthText; - delete [] pUpperAbbrevMonthText; + pUpperMonthText.reset(); + pUpperAbbrevMonthText.reset(); css::uno::Sequence< css::i18n::CalendarItem2 > xElems = pCal->getMonths(); nElems = xElems.getLength(); - pUpperMonthText = new OUString[nElems]; - pUpperAbbrevMonthText = new OUString[nElems]; + pUpperMonthText.reset( new OUString[nElems] ); + pUpperAbbrevMonthText.reset( new OUString[nElems] ); for ( j = 0; j < nElems; j++ ) { pUpperMonthText[j] = pChrCls->uppercase( xElems[j].FullName ); pUpperAbbrevMonthText[j] = pChrCls->uppercase( xElems[j].AbbrevName ); } - delete [] pUpperGenitiveMonthText; - delete [] pUpperGenitiveAbbrevMonthText; + pUpperGenitiveMonthText.reset(); + pUpperGenitiveAbbrevMonthText.reset(); xElems = pCal->getGenitiveMonths(); bScanGenitiveMonths = (nElems != xElems.getLength()); nElems = xElems.getLength(); - pUpperGenitiveMonthText = new OUString[nElems]; - pUpperGenitiveAbbrevMonthText = new OUString[nElems]; + pUpperGenitiveMonthText.reset( new OUString[nElems] ); + pUpperGenitiveAbbrevMonthText.reset( new OUString[nElems] ); for ( j = 0; j < nElems; j++ ) { pUpperGenitiveMonthText[j] = pChrCls->uppercase( xElems[j].FullName ); @@ -3411,13 +3403,13 @@ void ImpSvNumberInputScan::InitText() } } - delete [] pUpperPartitiveMonthText; - delete [] pUpperPartitiveAbbrevMonthText; + pUpperPartitiveMonthText.reset(); + pUpperPartitiveAbbrevMonthText.reset(); xElems = pCal->getPartitiveMonths(); bScanPartitiveMonths = (nElems != xElems.getLength()); nElems = xElems.getLength(); - pUpperPartitiveMonthText = new OUString[nElems]; - pUpperPartitiveAbbrevMonthText = new OUString[nElems]; + pUpperPartitiveMonthText.reset( new OUString[nElems] ); + pUpperPartitiveAbbrevMonthText.reset( new OUString[nElems] ); for ( j = 0; j < nElems; j++ ) { pUpperPartitiveMonthText[j] = pChrCls->uppercase( xElems[j].FullName ); @@ -3430,12 +3422,12 @@ void ImpSvNumberInputScan::InitText() } } - delete [] pUpperDayText; - delete [] pUpperAbbrevDayText; + pUpperDayText.reset(); + pUpperAbbrevDayText.reset(); xElems = pCal->getDays(); nElems = xElems.getLength(); - pUpperDayText = new OUString[nElems]; - pUpperAbbrevDayText = new OUString[nElems]; + pUpperDayText.reset( new OUString[nElems] ); + pUpperAbbrevDayText.reset( new OUString[nElems] ); for ( j = 0; j < nElems; j++ ) { pUpperDayText[j] = pChrCls->uppercase( xElems[j].FullName ); diff --git a/svl/source/numbers/zforfind.hxx b/svl/source/numbers/zforfind.hxx index 6f95d4c6e6b3..9c4c50044816 100644 --- a/svl/source/numbers/zforfind.hxx +++ b/svl/source/numbers/zforfind.hxx @@ -22,6 +22,7 @@ #include <com/sun/star/uno/Sequence.hxx> #include <rtl/ustring.hxx> +#include <memory> class Date; class SvNumberformat; @@ -74,14 +75,14 @@ public: private: SvNumberFormatter* pFormatter; - OUString* pUpperMonthText; //* Array of month names, uppercase - OUString* pUpperAbbrevMonthText; //* Array of month names, abbreviated, uppercase - OUString* pUpperGenitiveMonthText; //* Array of genitive month names, uppercase - OUString* pUpperGenitiveAbbrevMonthText; //* Array of genitive month names, abbreviated, uppercase - OUString* pUpperPartitiveMonthText; //* Array of partitive month names, uppercase - OUString* pUpperPartitiveAbbrevMonthText; //* Array of partitive month names, abbreviated, uppercase - OUString* pUpperDayText; //* Array of day of week names, uppercase - OUString* pUpperAbbrevDayText; //* Array of day of week names, abbreviated, uppercase + std::unique_ptr<OUString[]> pUpperMonthText; //* Array of month names, uppercase + std::unique_ptr<OUString[]> pUpperAbbrevMonthText; //* Array of month names, abbreviated, uppercase + std::unique_ptr<OUString[]> pUpperGenitiveMonthText; //* Array of genitive month names, uppercase + std::unique_ptr<OUString[]> pUpperGenitiveAbbrevMonthText; //* Array of genitive month names, abbreviated, uppercase + std::unique_ptr<OUString[]> pUpperPartitiveMonthText; //* Array of partitive month names, uppercase + std::unique_ptr<OUString[]> pUpperPartitiveAbbrevMonthText;//* Array of partitive month names, abbreviated, uppercase + std::unique_ptr<OUString[]> pUpperDayText; //* Array of day of week names, uppercase + std::unique_ptr<OUString[]> pUpperAbbrevDayText; //* Array of day of week names, abbreviated, uppercase OUString aUpperCurrSymbol; //* Currency symbol, uppercase bool bTextInitialized; //* Whether days and months are initialized bool bScanGenitiveMonths; //* Whether to scan an input for genitive months |