]> granicus.if.org Git - icu/commitdiff
ICU-8718 Fix missing fLeapMonthPatterns when using copy constructor
authorMichael Ow <mow@svn.icu-project.org>
Mon, 12 Dec 2011 19:29:27 +0000 (19:29 +0000)
committerMichael Ow <mow@svn.icu-project.org>
Mon, 12 Dec 2011 19:29:27 +0000 (19:29 +0000)
X-SVN-Rev: 31098

icu4c/source/i18n/dtfmtsym.cpp

index f4ac0fcb9aec55d498c6d2c6bd5315e718f6063e..3795c62add09b0222ccc09a0fb2971a5e4d46328 100644 (file)
@@ -335,6 +335,7 @@ DateFormatSymbols::copyData(const DateFormatSymbols& other) {
     assignArray(fShortQuarters, fShortQuartersCount, other.fShortQuarters, other.fShortQuartersCount);
     assignArray(fStandaloneQuarters, fStandaloneQuartersCount, other.fStandaloneQuarters, other.fStandaloneQuartersCount);
     assignArray(fStandaloneShortQuarters, fStandaloneShortQuartersCount, other.fStandaloneShortQuarters, other.fStandaloneShortQuartersCount);
+    assignArray(fLeapMonthPatterns, fLeapMonthPatternsCount, other.fLeapMonthPatterns, other.fLeapMonthPatternsCount);
     fGmtZero = other.fGmtZero;
     fGmtFormat = other.fGmtFormat;
     assignArray(fGmtHourFormats, fGmtHourFormatsCount, other.fGmtHourFormats, other.fGmtHourFormatsCount);
@@ -395,8 +396,8 @@ void DateFormatSymbols::dispose()
     if (fShortQuarters)            delete[] fShortQuarters;
     if (fStandaloneQuarters)       delete[] fStandaloneQuarters;
     if (fStandaloneShortQuarters)  delete[] fStandaloneShortQuarters;
-    if (fGmtHourFormats)           delete[] fGmtHourFormats;
     if (fLeapMonthPatterns)        delete[] fLeapMonthPatterns;
+    if (fGmtHourFormats)           delete[] fGmtHourFormats;
 
     disposeZoneStrings();
 }
@@ -463,6 +464,7 @@ DateFormatSymbols::operator==(const DateFormatSymbols& other) const
         fShortQuartersCount == other.fShortQuartersCount &&
         fStandaloneQuartersCount == other.fStandaloneQuartersCount &&
         fStandaloneShortQuartersCount == other.fStandaloneShortQuartersCount &&
+        fLeapMonthPatternsCount == other.fLeapMonthPatternsCount &&
         fGmtHourFormatsCount == other.fGmtHourFormatsCount &&
         fGmtZero == other.fGmtZero &&
         fGmtFormat == other.fGmtFormat)
@@ -488,6 +490,7 @@ DateFormatSymbols::operator==(const DateFormatSymbols& other) const
             arrayCompare(fShortQuarters, other.fShortQuarters, fShortQuartersCount) &&
             arrayCompare(fStandaloneQuarters, other.fStandaloneQuarters, fStandaloneQuartersCount) &&
             arrayCompare(fStandaloneShortQuarters, other.fStandaloneShortQuarters, fStandaloneShortQuartersCount) &&
+            arrayCompare(fLeapMonthPatterns, other.fLeapMonthPatterns, fLeapMonthPatternsCount) &&
             arrayCompare(fGmtHourFormats, other.fGmtHourFormats, fGmtHourFormatsCount))
         {
             // Compare the contents of fZoneStrings