summaryrefslogtreecommitdiff
path: root/i18npool
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-10-23 13:29:32 +0200
committerNoel Grandin <noel@peralex.com>2013-11-04 08:06:10 +0200
commit0e6a2601b39cbadaff7f7506ba9e804f108060db (patch)
treeffd6bb4970f689d20087b721eb8dfd4bc86cd53f /i18npool
parent457b349edbaf6d9dc747f3a631fee70e0c035bae (diff)
Convert code that calls OUString::getStr()[] to use the [] operator
This also means that this code now gets bounds checked in debug builds. Change-Id: Id777f85eaee6a737bbcb84625e6e110abe0e0f27
Diffstat (limited to 'i18npool')
-rw-r--r--i18npool/qa/cppunit/test_breakiterator.cxx4
-rw-r--r--i18npool/source/characterclassification/cclass_unicode_parser.cxx4
-rw-r--r--i18npool/source/localedata/LocaleNode.cxx6
3 files changed, 7 insertions, 7 deletions
diff --git a/i18npool/qa/cppunit/test_breakiterator.cxx b/i18npool/qa/cppunit/test_breakiterator.cxx
index 6e8b288174de..59b6d4cf68af 100644
--- a/i18npool/qa/cppunit/test_breakiterator.cxx
+++ b/i18npool/qa/cppunit/test_breakiterator.cxx
@@ -739,7 +739,7 @@ void TestBreakIterator::testWeak()
sal_Int16 nScript = m_xBreak->getScriptType(aWeaks, i);
OStringBuffer aMsg;
aMsg.append(RTL_CONSTASCII_STRINGPARAM("Char 0x"));
- aMsg.append(static_cast<sal_Int32>(aWeaks.getStr()[i]), 16);
+ aMsg.append(static_cast<sal_Int32>(aWeaks[i]), 16);
aMsg.append(RTL_CONSTASCII_STRINGPARAM(" should have been weak"));
CPPUNIT_ASSERT_MESSAGE(aMsg.getStr(),
nScript == i18n::ScriptType::WEAK);
@@ -778,7 +778,7 @@ void TestBreakIterator::testAsian()
sal_Int16 nScript = m_xBreak->getScriptType(aAsians, i);
OStringBuffer aMsg;
aMsg.append(RTL_CONSTASCII_STRINGPARAM("Char 0x"));
- aMsg.append(static_cast<sal_Int32>(aAsians.getStr()[i]), 16);
+ aMsg.append(static_cast<sal_Int32>(aAsians[i]), 16);
aMsg.append(RTL_CONSTASCII_STRINGPARAM(" should have been asian"));
CPPUNIT_ASSERT_MESSAGE(aMsg.getStr(),
nScript == i18n::ScriptType::ASIAN);
diff --git a/i18npool/source/characterclassification/cclass_unicode_parser.cxx b/i18npool/source/characterclassification/cclass_unicode_parser.cxx
index adf9737a09b6..2c372eb01f80 100644
--- a/i18npool/source/characterclassification/cclass_unicode_parser.cxx
+++ b/i18npool/source/characterclassification/cclass_unicode_parser.cxx
@@ -458,8 +458,8 @@ void cclass_Unicode::initParserTable( const Locale& rLocale, sal_Int32 startChar
mxLocaleData->getLocaleItem( aParserLocale );
//!TODO: theoretically separators may be a string, adjustment would have to be
//! done here and in parsing and in ::rtl::math::stringToDouble()
- cGroupSep = aItem.thousandSeparator.getStr()[0];
- cDecimalSep = aItem.decimalSeparator.getStr()[0];
+ cGroupSep = aItem.thousandSeparator[0];
+ cDecimalSep = aItem.decimalSeparator[0];
}
if ( cGroupSep < nDefCnt )
diff --git a/i18npool/source/localedata/LocaleNode.cxx b/i18npool/source/localedata/LocaleNode.cxx
index 2b1fed680665..46696770d5e0 100644
--- a/i18npool/source/localedata/LocaleNode.cxx
+++ b/i18npool/source/localedata/LocaleNode.cxx
@@ -419,14 +419,14 @@ void LCCTYPENode::generateCode (const OFileWriter &of) const
sepNode = findNode("LongDateDayOfWeekSeparator");
aLDS = sepNode->getValue();
of.writeParameter("LongDateDayOfWeekSeparator", aLDS);
- if (aLDS.getLength() == 1 && aLDS.getStr()[0] == ',')
+ if (aLDS == ",")
fprintf( stderr, "Warning: %s\n",
"LongDateDayOfWeekSeparator is only a comma not followed by a space. Usually this is not the case and may lead to concatenated display names like \"Wednesday,May 9, 2007\".");
sepNode = findNode("LongDateDaySeparator");
aLDS = sepNode->getValue();
of.writeParameter("LongDateDaySeparator", aLDS);
- if (aLDS.getLength() == 1 && (aLDS.getStr()[0] == ',' || aLDS.getStr()[0] == '.'))
+ if (aLDS == "," || aLDS == ".")
fprintf( stderr, "Warning: %s\n",
"LongDateDaySeparator is only a comma or dot not followed by a space. Usually this is not the case and may lead to concatenated display names like \"Wednesday, May 9,2007\".");
@@ -459,7 +459,7 @@ void LCCTYPENode::generateCode (const OFileWriter &of) const
if (aListSep == aThoSep)
fprintf( stderr, "Warning: %s\n",
"ListSeparator equals ThousandSeparator.");
- if (aListSep.getLength() != 1 || aListSep.getStr()[0] != ';')
+ if (aListSep.getLength() != 1 || aListSep[0] != ';')
{
incError( "ListSeparator not ';' semicolon. Strongly recommended. Currently required.");
++nSavErr; // format codes not affected