diff options
author | Noel Grandin <noel@peralex.com> | 2013-10-23 13:29:32 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-11-04 08:06:10 +0200 |
commit | 0e6a2601b39cbadaff7f7506ba9e804f108060db (patch) | |
tree | ffd6bb4970f689d20087b721eb8dfd4bc86cd53f /sc | |
parent | 457b349edbaf6d9dc747f3a631fee70e0c035bae (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 'sc')
-rw-r--r-- | sc/source/core/data/column3.cxx | 4 | ||||
-rw-r--r-- | sc/source/core/tool/chgtrack.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/tool/formulaopt.cxx | 4 | ||||
-rw-r--r-- | sc/source/filter/excel/xehelper.cxx | 4 | ||||
-rw-r--r-- | sc/source/filter/excel/xeroot.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/excel/xistream.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/excel/xltools.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/app/inputhdl.cxx | 14 | ||||
-rw-r--r-- | sc/source/ui/optdlg/tpformula.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/output2.cxx | 2 |
10 files changed, 19 insertions, 19 deletions
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index 685a8df95206..991039c1e19b 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -1596,8 +1596,8 @@ bool ScColumn::ParseString( if (rDecSep.getLength() != 1 || rGroupSep.getLength() != 1) break; - sal_Unicode dsep = rDecSep.getStr()[0]; - sal_Unicode gsep = rGroupSep.getStr()[0]; + sal_Unicode dsep = rDecSep[0]; + sal_Unicode gsep = rGroupSep[0]; if (!ScStringUtil::parseSimpleNumber(rString, dsep, gsep, nVal)) break; diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx index fa0e0aab5c09..b5a2e3c38093 100644 --- a/sc/source/core/tool/chgtrack.cxx +++ b/sc/source/core/tool/chgtrack.cxx @@ -1421,7 +1421,7 @@ void ScChangeActionContent::SetValueString( OUString& rValue, ScCellValue& rCell, const OUString& rStr, ScDocument* pDoc ) { rCell.clear(); - if ( rStr.getLength() > 1 && rStr.getStr()[0] == '=' ) + if ( rStr.getLength() > 1 && rStr[0] == '=' ) { rValue = EMPTY_OUSTRING; rCell.meType = CELLTYPE_FORMULA; diff --git a/sc/source/core/tool/formulaopt.cxx b/sc/source/core/tool/formulaopt.cxx index 5580c23df13b..16ad17f1ff32 100644 --- a/sc/source/core/tool/formulaopt.cxx +++ b/sc/source/core/tool/formulaopt.cxx @@ -86,8 +86,8 @@ void ScFormulaOptions::GetDefaultFormulaSeparators( // Something is wrong. Stick with the default separators. return; - sal_Unicode cDecSep = rDecSep.getStr()[0]; - sal_Unicode cListSep = rListSep.getStr()[0]; + sal_Unicode cDecSep = rDecSep[0]; + sal_Unicode cListSep = rListSep[0]; // Excel by default uses system's list separator as the parameter // separator, which in English locales is a comma. However, OOo's list diff --git a/sc/source/filter/excel/xehelper.cxx b/sc/source/filter/excel/xehelper.cxx index b53700951a06..fd2fad955cab 100644 --- a/sc/source/filter/excel/xehelper.cxx +++ b/sc/source/filter/excel/xehelper.cxx @@ -904,8 +904,8 @@ OUString lclEncodeDosUrl( else if ( aOldUrl.getLength() > 2 && aOldUrl.copy(1,2) == ":\\" ) { // drive letter - sal_Unicode cThisDrive = rBase.isEmpty() ? ' ' : rBase.getStr()[0]; - sal_Unicode cDrive = aOldUrl.getStr()[0]; + sal_Unicode cThisDrive = rBase.isEmpty() ? ' ' : rBase[0]; + sal_Unicode cDrive = aOldUrl[0]; if (cThisDrive == cDrive) // This document and the referenced document are under the same drive. aBuf.append(EXC_URL_DRIVEROOT); diff --git a/sc/source/filter/excel/xeroot.cxx b/sc/source/filter/excel/xeroot.cxx index 9042cbaae8ce..be02afc9b425 100644 --- a/sc/source/filter/excel/xeroot.cxx +++ b/sc/source/filter/excel/xeroot.cxx @@ -321,7 +321,7 @@ uno::Sequence< beans::NamedValue > XclExpRoot::GenerateEncryptionData( const OUS sal_uInt16 pnPasswd[16]; memset( pnPasswd, 0, sizeof( pnPasswd ) ); for (xub_StrLen nChar = 0; nChar < aPass.getLength(); ++nChar ) - pnPasswd[nChar] = aPass.getStr()[nChar]; + pnPasswd[nChar] = aPass[nChar]; ::msfilter::MSCodec_Std97 aCodec; aCodec.InitKey( pnPasswd, pnDocId ); diff --git a/sc/source/filter/excel/xistream.cxx b/sc/source/filter/excel/xistream.cxx index d4cb870ebf42..5dd944ee3556 100644 --- a/sc/source/filter/excel/xistream.cxx +++ b/sc/source/filter/excel/xistream.cxx @@ -150,7 +150,7 @@ uno::Sequence< beans::NamedValue > XclImpBiff5Decrypter::OnVerifyPassword( const ::std::vector< sal_uInt16 > aPassVect( 16 ); ::std::vector< sal_uInt16 >::iterator aIt = aPassVect.begin(); for( sal_Int32 nInd = 0; nInd < nLen; ++nInd, ++aIt ) - *aIt = static_cast< sal_uInt16 >( rPassword.getStr()[nInd] ); + *aIt = static_cast< sal_uInt16 >( rPassword[nInd] ); uno::Sequence< sal_Int8 > aDocId = ::comphelper::DocPasswordHelper::GenerateRandomByteSequence( 16 ); OSL_ENSURE( aDocId.getLength() == 16, "Unexpected length of the senquence!" ); diff --git a/sc/source/filter/excel/xltools.cxx b/sc/source/filter/excel/xltools.cxx index 51b4278a14cd..e0713e4902b0 100644 --- a/sc/source/filter/excel/xltools.cxx +++ b/sc/source/filter/excel/xltools.cxx @@ -513,7 +513,7 @@ sal_Unicode XclTools::GetBuiltInDefNameIndex( const OUString& rDefName ) { // name can be followed by underline or space character xub_StrLen nNextCharPos = nPrefixLen + nBuiltInLen; - sal_Unicode cNextChar = (rDefName.getLength() > nNextCharPos) ? rDefName.getStr()[nNextCharPos] : '\0'; + sal_Unicode cNextChar = (rDefName.getLength() > nNextCharPos) ? rDefName[nNextCharPos] : '\0'; if( (cNextChar == '\0') || (cNextChar == ' ') || (cNextChar == '_') ) return cBuiltIn; } diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index eaa05a1de713..7aef609897b5 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -876,7 +876,7 @@ void ScInputHandler::ShowTipCursor() { for (sal_Int32 i = 0; i < aNew.getLength(); ++i) { - sal_Unicode cNext = aNew.getStr()[i]; + sal_Unicode cNext = aNew[i]; if( cNext == '(' ) { nStartPosition = i+1; @@ -888,7 +888,7 @@ void ScInputHandler::ShowTipCursor() sal_uInt16 nCount = 0; for (sal_Int32 i = 0; i < aNew.getLength(); ++i) { - sal_Unicode cNext = aNew.getStr()[i]; + sal_Unicode cNext = aNew[i]; if( cNext == '(' ) { nStartPosition = i+1; @@ -910,7 +910,7 @@ void ScInputHandler::ShowTipCursor() sal_uInt16 nCount = 0; for (sal_Int32 i = 0; i < aNew.getLength(); ++i) { - sal_Unicode cNext = aNew.getStr()[i]; + sal_Unicode cNext = aNew[i]; if( cNext == '(' ) { nStartPosition = i+1; @@ -1128,7 +1128,7 @@ void ScInputHandler::UseFormulaData() { for (sal_Int32 i = 0; i < aNew.getLength(); ++i) { - sal_Unicode cNext = aNew.getStr()[i]; + sal_Unicode cNext = aNew[i]; if( cNext == '(' ) { nStartPosition = i+1; @@ -1140,7 +1140,7 @@ void ScInputHandler::UseFormulaData() sal_uInt16 nCount = 0; for (sal_Int32 i = 0; i < aNew.getLength(); ++i) { - sal_Unicode cNext = aNew.getStr()[i]; + sal_Unicode cNext = aNew[i]; if( cNext == '(' ) { nStartPosition = i+1; @@ -1162,7 +1162,7 @@ void ScInputHandler::UseFormulaData() sal_uInt16 nCount = 0; for (sal_Int32 i = 0; i < aNew.getLength(); ++i) { - sal_Unicode cNext = aNew.getStr()[i]; + sal_Unicode cNext = aNew[i]; if( cNext == '(' ) { nStartPosition = i+1; @@ -2746,7 +2746,7 @@ void ScInputHandler::EnterHandler( sal_uInt8 nBlockMode ) { // keine typographische Anfuehrungszeichen in Formeln - if (aString.getStr()[0] == '=') + if (aString[0] == '=') { SvxAutoCorrect* pAuto = SvxAutoCorrCfg::Get().GetAutoCorrect(); if ( pAuto ) diff --git a/sc/source/ui/optdlg/tpformula.cxx b/sc/source/ui/optdlg/tpformula.cxx index 8e9961c5d53f..084060ba1313 100644 --- a/sc/source/ui/optdlg/tpformula.cxx +++ b/sc/source/ui/optdlg/tpformula.cxx @@ -143,7 +143,7 @@ bool ScTpFormulaOptions::IsValidSeparator(const OUString& rSep) const if (rSep.compareToAscii("A") >= 0 && rSep.compareToAscii("Z") <= 0) return false; - sal_Unicode c = rSep.getStr()[0]; + sal_Unicode c = rSep[0]; switch (c) { case '+': diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index cf0a8295818e..d1333050b685 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -626,7 +626,7 @@ void ScDrawStringsVars::SetTextToWidthOrHash( ScRefCellValue& rCell, long nWidth } sal_uInt8 nSignCount = 0, nDecimalCount = 0, nExpCount = 0; sal_Int32 nLen = aString.getLength(); - sal_Unicode cDecSep = ScGlobal::GetpLocaleData()->getLocaleItem().decimalSeparator.getStr()[0]; + sal_Unicode cDecSep = ScGlobal::GetpLocaleData()->getLocaleItem().decimalSeparator[0]; for (xub_StrLen i = 0; i < nLen; ++i) { sal_Unicode c = aString[i]; |