summaryrefslogtreecommitdiff
path: root/sw
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 /sw
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 'sw')
-rw-r--r--sw/source/core/access/accpara.cxx2
-rw-r--r--sw/source/core/access/accportions.cxx2
-rw-r--r--sw/source/core/unocore/unoobj.cxx20
-rw-r--r--sw/source/ui/lingu/hhcwrp.cxx2
4 files changed, 13 insertions, 13 deletions
diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx
index 6070f3040a3a..33e782b6c80d 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -1140,7 +1140,7 @@ sal_Unicode SwAccessibleParagraph::getCharacter( sal_Int32 nIndex )
// return character (if valid)
if( IsValidChar(nIndex, sText.getLength() ) )
{
- return sText.getStr()[nIndex];
+ return sText[nIndex];
}
else
throw lang::IndexOutOfBoundsException();
diff --git a/sw/source/core/access/accportions.cxx b/sw/source/core/access/accportions.cxx
index d6fc8e4ade16..4bedfca89b60 100644
--- a/sw/source/core/access/accportions.cxx
+++ b/sw/source/core/access/accportions.cxx
@@ -584,7 +584,7 @@ sal_uInt16 SwAccessiblePortionData::FillSpecialPos(
// if we have anything except plain text, compute nExtend + nRefPos
if( (nModelEndPos - nModelPos == 1) &&
- (pTxtNode->GetTxt()[nModelPos] != sAccessibleString.getStr()[nPos]))
+ (pTxtNode->GetTxt()[nModelPos] != sAccessibleString[nPos]))
{
// case 1: a one-character, non-text portion
// reference position is the first accessibilty for our
diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx
index 7644261ba126..0b07b547430b 100644
--- a/sw/source/core/unocore/unoobj.cxx
+++ b/sw/source/core/unocore/unoobj.cxx
@@ -2795,12 +2795,12 @@ sal_Bool SwUnoCursorHelper::ConvertSortProperties(
bRet = sal_False;
}
}
- else if (rPropName.matchAsciiL("CollatorAlgorithm", 17) &&
+ else if (rPropName.startsWith("CollatorAlgorithm") &&
rPropName.getLength() == 18 &&
- (rPropName.getStr()[17] >= '0' && rPropName.getStr()[17] <= '9'))
+ (rPropName[17] >= '0' && rPropName[17] <= '9'))
{
bOldSortdescriptor = sal_True;
- sal_uInt16 nIndex = rPropName.getStr()[17];
+ sal_uInt16 nIndex = rPropName[17];
nIndex -= '0';
OUString aTxt;
if ((aValue >>= aTxt) && nIndex < 3)
@@ -2812,12 +2812,12 @@ sal_Bool SwUnoCursorHelper::ConvertSortProperties(
bRet = sal_False;
}
}
- else if (rPropName.matchAsciiL("SortRowOrColumnNo", 17) &&
+ else if (rPropName.startsWith("SortRowOrColumnNo") &&
rPropName.getLength() == 18 &&
- (rPropName.getStr()[17] >= '0' && rPropName.getStr()[17] <= '9'))
+ (rPropName[17] >= '0' && rPropName[17] <= '9'))
{
bOldSortdescriptor = sal_True;
- sal_uInt16 nIndex = rPropName.getStr()[17];
+ sal_uInt16 nIndex = rPropName[17];
nIndex -= '0';
sal_Int16 nCol = -1;
if (aValue.getValueType() == ::getCppuType((const sal_Int16*)0)
@@ -2836,10 +2836,10 @@ sal_Bool SwUnoCursorHelper::ConvertSortProperties(
}
else if (rPropName.startsWith("IsSortNumeric") &&
rPropName.getLength() == 14 &&
- (rPropName.getStr()[13] >= '0' && rPropName.getStr()[13] <= '9'))
+ (rPropName[13] >= '0' && rPropName[13] <= '9'))
{
bOldSortdescriptor = sal_True;
- sal_uInt16 nIndex = rPropName.getStr()[13];
+ sal_uInt16 nIndex = rPropName[13];
nIndex = nIndex - '0';
if (aValue.getValueType() == ::getBooleanCppuType() && nIndex < 3)
{
@@ -2853,10 +2853,10 @@ sal_Bool SwUnoCursorHelper::ConvertSortProperties(
}
else if (rPropName.startsWith("IsSortAscending") &&
rPropName.getLength() == 16 &&
- (rPropName.getStr()[15] >= '0' && rPropName.getStr()[15] <= '9'))
+ (rPropName[15] >= '0' && rPropName[15] <= '9'))
{
bOldSortdescriptor = sal_True;
- sal_uInt16 nIndex = rPropName.getStr()[15];
+ sal_uInt16 nIndex = rPropName[15];
nIndex -= '0';
if (aValue.getValueType() == ::getBooleanCppuType() && nIndex < 3)
{
diff --git a/sw/source/ui/lingu/hhcwrp.cxx b/sw/source/ui/lingu/hhcwrp.cxx
index 4f5de524200a..042f3b31f9c5 100644
--- a/sw/source/ui/lingu/hhcwrp.cxx
+++ b/sw/source/ui/lingu/hhcwrp.cxx
@@ -272,7 +272,7 @@ void SwHHCWrapper::ChangeText( const OUString &rNewText,
nIndex = static_cast< xub_StrLen >( rOrigText.getLength() );
}
- if (rOrigText.getStr()[nIndex] == rNewText[nPos] ||
+ if (rOrigText[nIndex] == rNewText[nPos] ||
nPos == nConvTextLen /* end of string also terminates non-matching char sequence */)
{
// substring that needs to be replaced found?