Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: source/i18n/rulebasedcollator.cpp

Issue 1621843002: ICU 56 update step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@561
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « source/i18n/repattrn.cpp ('k') | source/i18n/scientificformathelper.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 ******************************************************************************* 2 *******************************************************************************
3 * Copyright (C) 1996-2014, International Business Machines 3 * Copyright (C) 1996-2015, International Business Machines
4 * Corporation and others. All Rights Reserved. 4 * Corporation and others. All Rights Reserved.
5 ******************************************************************************* 5 *******************************************************************************
6 * rulebasedcollator.cpp 6 * rulebasedcollator.cpp
7 * 7 *
8 * (replaced the former tblcoll.cpp) 8 * (replaced the former tblcoll.cpp)
9 * 9 *
10 * created on: 2012feb14 with new and old collation code 10 * created on: 2012feb14 with new and old collation code
11 * created by: Markus W. Scherer 11 * created by: Markus W. Scherer
12 */ 12 */
13 13
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 return; 666 return;
667 } 667 }
668 const CollationSettings &defaultSettings = getDefaultSettings(); 668 const CollationSettings &defaultSettings = getDefaultSettings();
669 if(length == 1 && reorderCodes[0] == UCOL_REORDER_CODE_DEFAULT) { 669 if(length == 1 && reorderCodes[0] == UCOL_REORDER_CODE_DEFAULT) {
670 if(settings != &defaultSettings) { 670 if(settings != &defaultSettings) {
671 CollationSettings *ownedSettings = SharedObject::copyOnWrite(setting s); 671 CollationSettings *ownedSettings = SharedObject::copyOnWrite(setting s);
672 if(ownedSettings == NULL) { 672 if(ownedSettings == NULL) {
673 errorCode = U_MEMORY_ALLOCATION_ERROR; 673 errorCode = U_MEMORY_ALLOCATION_ERROR;
674 return; 674 return;
675 } 675 }
676 ownedSettings->aliasReordering(defaultSettings.reorderCodes, 676 ownedSettings->copyReorderingFrom(defaultSettings, errorCode);
677 defaultSettings.reorderCodesLength,
678 defaultSettings.reorderTable);
679 setFastLatinOptions(*ownedSettings); 677 setFastLatinOptions(*ownedSettings);
680 } 678 }
681 return; 679 return;
682 } 680 }
683 CollationSettings *ownedSettings = SharedObject::copyOnWrite(settings); 681 CollationSettings *ownedSettings = SharedObject::copyOnWrite(settings);
684 if(ownedSettings == NULL) { 682 if(ownedSettings == NULL) {
685 errorCode = U_MEMORY_ALLOCATION_ERROR; 683 errorCode = U_MEMORY_ALLOCATION_ERROR;
686 return; 684 return;
687 } 685 }
688 if(length == 0) { 686 ownedSettings->setReordering(*data, reorderCodes, length, errorCode);
689 ownedSettings->resetReordering();
690 } else {
691 uint8_t reorderTable[256];
692 data->makeReorderTable(reorderCodes, length, reorderTable, errorCode);
693 if(U_FAILURE(errorCode)) { return; }
694 if(!ownedSettings->setReordering(reorderCodes, length, reorderTable)) {
695 errorCode = U_MEMORY_ALLOCATION_ERROR;
696 return;
697 }
698 }
699 setFastLatinOptions(*ownedSettings); 687 setFastLatinOptions(*ownedSettings);
700 } 688 }
701 689
702 void 690 void
703 RuleBasedCollator::setFastLatinOptions(CollationSettings &ownedSettings) const { 691 RuleBasedCollator::setFastLatinOptions(CollationSettings &ownedSettings) const {
704 ownedSettings.fastLatinOptions = CollationFastLatin::getOptions( 692 ownedSettings.fastLatinOptions = CollationFastLatin::getOptions(
705 data, ownedSettings, 693 data, ownedSettings,
706 ownedSettings.fastLatinPrimaries, UPRV_LENGTHOF(ownedSettings.fastLa tinPrimaries)); 694 ownedSettings.fastLatinPrimaries, UPRV_LENGTHOF(ownedSettings.fastLa tinPrimaries));
707 } 695 }
708 696
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after
1659 int32_t 1647 int32_t
1660 RuleBasedCollator::getMaxExpansion(int32_t order) const { 1648 RuleBasedCollator::getMaxExpansion(int32_t order) const {
1661 UErrorCode errorCode = U_ZERO_ERROR; 1649 UErrorCode errorCode = U_ZERO_ERROR;
1662 (void)initMaxExpansions(errorCode); 1650 (void)initMaxExpansions(errorCode);
1663 return CollationElementIterator::getMaxExpansion(tailoring->maxExpansions, o rder); 1651 return CollationElementIterator::getMaxExpansion(tailoring->maxExpansions, o rder);
1664 } 1652 }
1665 1653
1666 U_NAMESPACE_END 1654 U_NAMESPACE_END
1667 1655
1668 #endif // !UCONFIG_NO_COLLATION 1656 #endif // !UCONFIG_NO_COLLATION
OLDNEW
« no previous file with comments | « source/i18n/repattrn.cpp ('k') | source/i18n/scientificformathelper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698