summaryrefslogtreecommitdiff
path: root/i18npool
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-11-05 14:39:55 +0200
committerNoel Grandin <noel@peralex.com>2013-11-11 12:58:13 +0200
commitfcd1637d5101b9142e6808edfb77b01122857901 (patch)
tree5fd09f97de80cf2a9481bd55a798015db35f1d0c /i18npool
parentef90021abe3735fba57145598fd7c3d359d2718e (diff)
convert OUString compareToAscii == 0 to equalsAscii
Convert code like aStr.compareToAscii("XXX") == 0 to aStr.equalsAscii("XXX") which is both easier to read and faster. Change-Id: I448abf58f2fa0e7715dba53f8e8825ca0587c83f
Diffstat (limited to 'i18npool')
-rw-r--r--i18npool/source/breakiterator/breakiteratorImpl.cxx6
-rw-r--r--i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx2
-rw-r--r--i18npool/source/indexentry/indexentrysupplier.cxx2
-rw-r--r--i18npool/source/indexentry/indexentrysupplier_common.cxx2
-rw-r--r--i18npool/source/localedata/LocaleNode.cxx10
-rw-r--r--i18npool/source/nativenumber/nativenumbersupplier.cxx2
-rw-r--r--i18npool/source/transliteration/transliterationImpl.cxx2
7 files changed, 13 insertions, 13 deletions
diff --git a/i18npool/source/breakiterator/breakiteratorImpl.cxx b/i18npool/source/breakiterator/breakiteratorImpl.cxx
index b5e4331768cb..0123583b0ad9 100644
--- a/i18npool/source/breakiterator/breakiteratorImpl.cxx
+++ b/i18npool/source/breakiterator/breakiteratorImpl.cxx
@@ -587,9 +587,9 @@ BreakIteratorImpl::getLocaleSpecificBreakIterator(const Locale& rLocale) throw (
// load service with name <base>_<lang>_<country>
createLocaleSpecificBreakIterator(aBuf.append(rLocale.Language).append(under).append(
rLocale.Country).makeStringAndClear())) ||
- (l > 0 && c > 0 && rLocale.Language.compareToAscii("zh") == 0 &&
- (rLocale.Country.compareToAscii("HK") == 0 ||
- rLocale.Country.compareToAscii("MO") == 0) &&
+ (l > 0 && c > 0 && rLocale.Language.equalsAscii("zh") &&
+ (rLocale.Country.equalsAscii("HK") ||
+ rLocale.Country.equalsAscii("MO") ) &&
// if the country code is HK or MO, one more step to try TW.
createLocaleSpecificBreakIterator(aBuf.append(rLocale.Language).append(under).appendAscii(
"TW").makeStringAndClear())) ||
diff --git a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
index a4060d4c6f7e..bd926d1a8df7 100644
--- a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
+++ b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
@@ -525,7 +525,7 @@ static
int should_ignore( OUString s )
{
// return true if blank or null
- return s.compareToAscii(" ")==0 || (!s.isEmpty() && s[0]==0);
+ return s.equalsAscii(" ") || (!s.isEmpty() && s[0]==0);
}
static
diff --git a/i18npool/source/indexentry/indexentrysupplier.cxx b/i18npool/source/indexentry/indexentrysupplier.cxx
index 6a4ef3b4b4ff..4f274935c2c2 100644
--- a/i18npool/source/indexentry/indexentrysupplier.cxx
+++ b/i18npool/source/indexentry/indexentrysupplier.cxx
@@ -184,7 +184,7 @@ IndexEntrySupplier::getImplementationName() throw( RuntimeException )
sal_Bool SAL_CALL
IndexEntrySupplier::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
- return rServiceName.compareToAscii(implementationName) == 0;
+ return rServiceName.equalsAscii(implementationName);
}
Sequence< OUString > SAL_CALL
diff --git a/i18npool/source/indexentry/indexentrysupplier_common.cxx b/i18npool/source/indexentry/indexentrysupplier_common.cxx
index e4dba3822821..cdaf612ea876 100644
--- a/i18npool/source/indexentry/indexentrysupplier_common.cxx
+++ b/i18npool/source/indexentry/indexentrysupplier_common.cxx
@@ -126,7 +126,7 @@ IndexEntrySupplier_Common::getImplementationName() throw( RuntimeException )
sal_Bool SAL_CALL
IndexEntrySupplier_Common::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
- return rServiceName.compareToAscii(implementationName) == 0;
+ return rServiceName.equalsAscii(implementationName);
}
Sequence< OUString > SAL_CALL
diff --git a/i18npool/source/localedata/LocaleNode.cxx b/i18npool/source/localedata/LocaleNode.cxx
index 46696770d5e0..ff4ce9784fdd 100644
--- a/i18npool/source/localedata/LocaleNode.cxx
+++ b/i18npool/source/localedata/LocaleNode.cxx
@@ -1297,7 +1297,7 @@ void LCCollationNode::generateCode (const OFileWriter &of) const
for ( j = 0; j < getNumberOfChildren(); j++ ) {
LocaleNode * currNode = getChildAt (j);
- if( currNode->getName().compareToAscii("Collator") == 0 )
+ if( currNode->getName().equalsAscii("Collator") )
{
OUString str;
str = currNode->getAttr().getValueByName("unoid");
@@ -1310,7 +1310,7 @@ void LCCollationNode::generateCode (const OFileWriter &of) const
nbOfCollations++;
}
- if( currNode->getName().compareToAscii("CollationOptions") == 0 )
+ if( currNode->getName().equalsAscii("CollationOptions") )
{
LocaleNode* pCollationOptions = currNode;
nbOfCollationOptions = sal::static_int_cast<sal_Int16>( pCollationOptions->getNumberOfChildren() );
@@ -1411,7 +1411,7 @@ void LCIndexNode::generateCode (const OFileWriter &of) const
sal_Int16 i;
for (i = 0; i< getNumberOfChildren();i++) {
LocaleNode * currNode = getChildAt (i);
- if( currNode->getName().compareToAscii("IndexKey") == 0 )
+ if( currNode->getName().equalsAscii("IndexKey") )
{
OUString str;
str = currNode->getAttr().getValueByName("unoid");
@@ -1428,13 +1428,13 @@ void LCIndexNode::generateCode (const OFileWriter &of) const
nbOfIndexs++;
}
- if( currNode->getName().compareToAscii("UnicodeScript") == 0 )
+ if( currNode->getName().equalsAscii("UnicodeScript") )
{
of.writeParameter("unicodeScript", currNode->getValue(), nbOfUnicodeScripts );
nbOfUnicodeScripts++;
}
- if( currNode->getName().compareToAscii("FollowPageWord") == 0 )
+ if( currNode->getName().equalsAscii("FollowPageWord") )
{
of.writeParameter("followPageWord", currNode->getValue(), nbOfPageWords);
nbOfPageWords++;
diff --git a/i18npool/source/nativenumber/nativenumbersupplier.cxx b/i18npool/source/nativenumber/nativenumbersupplier.cxx
index bf2ff1100b4c..38e7905031af 100644
--- a/i18npool/source/nativenumber/nativenumbersupplier.cxx
+++ b/i18npool/source/nativenumber/nativenumbersupplier.cxx
@@ -898,7 +898,7 @@ OUString SAL_CALL NativeNumberSupplier::getImplementationName() throw( RuntimeEx
sal_Bool SAL_CALL
NativeNumberSupplier::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
- return rServiceName.compareToAscii(implementationName) == 0;
+ return rServiceName.equalsAscii(implementationName);
}
Sequence< OUString > SAL_CALL
diff --git a/i18npool/source/transliteration/transliterationImpl.cxx b/i18npool/source/transliteration/transliterationImpl.cxx
index 2af62a742269..d700646dcfe2 100644
--- a/i18npool/source/transliteration/transliterationImpl.cxx
+++ b/i18npool/source/transliteration/transliterationImpl.cxx
@@ -613,7 +613,7 @@ TransliterationImpl::loadModuleByName( const OUString& implName,
// if the module is ignore case/kana/width, load caseignore for equals/compareString mothed
for (sal_Int16 i = 0; i < 3; i++) {
- if (implName.compareToAscii(TMlist[i].implName) == 0) {
+ if (implName.equalsAscii(TMlist[i].implName)) {
if (i == 0) // current module is caseignore
body->loadModule(TMlist[0].tm, rLocale); // caseingore need to setup module name
if (! caseignore.is()) {