diff options
Diffstat (limited to 'i18npool')
-rw-r--r-- | i18npool/source/localedata/LocaleNode.cxx | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/i18npool/source/localedata/LocaleNode.cxx b/i18npool/source/localedata/LocaleNode.cxx index 9f778e48cd98..b411e38b8f57 100644 --- a/i18npool/source/localedata/LocaleNode.cxx +++ b/i18npool/source/localedata/LocaleNode.cxx @@ -22,6 +22,7 @@ #include <string.h> #include <algorithm> #include <iostream> +#include <memory> #include <set> #include <vector> @@ -1621,11 +1622,11 @@ void LCCalendarNode::generateCode (const OFileWriter &of) const } sal_Int16 nbOfCalendars = sal::static_int_cast<sal_Int16>( getNumberOfChildren() ); OUString str; - sal_Int16 * nbOfDays = new sal_Int16[nbOfCalendars]; - sal_Int16 * nbOfMonths = new sal_Int16[nbOfCalendars]; - sal_Int16 * nbOfGenitiveMonths = new sal_Int16[nbOfCalendars]; - sal_Int16 * nbOfPartitiveMonths = new sal_Int16[nbOfCalendars]; - sal_Int16 * nbOfEras = new sal_Int16[nbOfCalendars]; + std::unique_ptr<sal_Int16[]> nbOfDays( new sal_Int16[nbOfCalendars] ); + std::unique_ptr<sal_Int16[]> nbOfMonths( new sal_Int16[nbOfCalendars] ); + std::unique_ptr<sal_Int16[]> nbOfGenitiveMonths( new sal_Int16[nbOfCalendars] ); + std::unique_ptr<sal_Int16[]> nbOfPartitiveMonths( new sal_Int16[nbOfCalendars] ); + std::unique_ptr<sal_Int16[]> nbOfEras( new sal_Int16[nbOfCalendars] ); sal_Int16 j; sal_Int16 i; bool bHasGregorian = false; @@ -1914,12 +1915,6 @@ void LCCalendarNode::generateCode (const OFileWriter &of) const of.writeAsciiString("};\n\n"); of.writeFunction("getAllCalendars_", "calendarsCount", "calendars"); - - delete []nbOfDays; - delete []nbOfMonths; - delete []nbOfGenitiveMonths; - delete []nbOfPartitiveMonths; - delete []nbOfEras; } bool isIso4217( const OUString& rStr ) |