summaryrefslogtreecommitdiff
path: root/xmloff
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 /xmloff
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 'xmloff')
-rw-r--r--xmloff/source/core/xmlexp.cxx2
-rw-r--r--xmloff/source/forms/elementimport.cxx6
-rw-r--r--xmloff/source/text/txtfldi.cxx2
-rw-r--r--xmloff/source/xforms/XFormsBindContext.cxx2
4 files changed, 5 insertions, 7 deletions
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index 43c3d4dd2576..5d4fc0d9a325 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -2211,7 +2211,7 @@ OUString SvXMLExport::GetRelativeReference(const OUString& rValue)
// #i65474# handling of fragment URLs ("#....") is undefined
// they are stored 'as is'
uno::Reference< uri::XUriReference > xUriRef;
- if(!sValue.isEmpty() && sValue.getStr()[0] != '#')
+ if(!sValue.isEmpty() && sValue[0] != '#')
{
try
{
diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx
index 4aa64f3d6dcd..834da3d6fdd8 100644
--- a/xmloff/source/forms/elementimport.cxx
+++ b/xmloff/source/forms/elementimport.cxx
@@ -1225,7 +1225,7 @@ namespace xmloff
OSL_ENSURE(_rValue.getLength() == 1, "OPasswordImport::handleAttribute: invalid echo char attribute!");
// we ourself should not have written values other than of length 1
if (_rValue.getLength() >= 1)
- aEchoChar.Value <<= (sal_Int16)_rValue.getStr()[0];
+ aEchoChar.Value <<= (sal_Int16)_rValue[0];
else
aEchoChar.Value <<= (sal_Int16)0;
implPushBackPropertyValue(aEchoChar);
@@ -2015,9 +2015,7 @@ namespace xmloff
nElementLength = sElement.getLength();
// when writing the sequence, we quoted the single elements with " characters
- OSL_ENSURE( (nElementLength >= 2)
- && (sElement.getStr()[0] == '"')
- && (sElement.getStr()[nElementLength - 1] == '"'),
+ OSL_ENSURE( sElement.startsWith("\"") && sElement.endsWith("\""),
"OFormImport::implTranslateStringListProperty: invalid quoted element name.");
sElement = sElement.copy(1, nElementLength - 2);
diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx
index 74bcc18dcde0..bcfc3db5a3b8 100644
--- a/xmloff/source/text/txtfldi.cxx
+++ b/xmloff/source/text/txtfldi.cxx
@@ -3826,7 +3826,7 @@ void XMLAnnotationImportContext::PrepareField(
if ( sBuffer.getLength() )
{
// delete last paragraph mark (if necessary)
- if (sal_Char(0x0a) == sBuffer.getStr()[sBuffer.getLength()-1])
+ if (sal_Char(0x0a) == sBuffer[sBuffer.getLength()-1])
sBuffer = sBuffer.copy(0, sBuffer.getLength()-1);
xPropertySet->setPropertyValue(sPropertyContent, makeAny(sBuffer));
}
diff --git a/xmloff/source/xforms/XFormsBindContext.cxx b/xmloff/source/xforms/XFormsBindContext.cxx
index 1236cadb1d81..2a9f0213092e 100644
--- a/xmloff/source/xforms/XFormsBindContext.cxx
+++ b/xmloff/source/xforms/XFormsBindContext.cxx
@@ -162,7 +162,7 @@ static void lcl_fillNamespaceContainer(
// as a hack, we will ignore our own 'default' namespaces
DBG_ASSERT( !sPrefix.isEmpty(), "no prefix?" );
- if( sPrefix.getStr()[0] != sal_Unicode( '_' ) &&
+ if( !sPrefix.startsWith("_") &&
nKeyIter >= XML_OLD_NAMESPACE_META_IDX )
{
// insert prefix (use replace if already known)