summaryrefslogtreecommitdiff
path: root/sw/source/filter/xml
diff options
context:
space:
mode:
authorNoel <noel.grandin@collabora.co.uk>2020-12-21 09:39:48 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-12-21 11:34:17 +0100
commit917338c6a81fa5c793d7e4c14f2f031219e64b84 (patch)
tree7a14dbc0570d2f76084fe11af62c8bb2d1c5dfb1 /sw/source/filter/xml
parent39ef79abd0b598cc010261aa6d1eaeabd8a52e95 (diff)
use std::u16string_view in SvXMLTokenEnumerator
Change-Id: I1194441063047637adc20c8e37bb717fdb787714 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108073 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/filter/xml')
-rw-r--r--sw/source/filter/xml/xmlimpit.cxx10
-rw-r--r--sw/source/filter/xml/xmlithlp.cxx6
-rw-r--r--sw/source/filter/xml/xmlithlp.hxx2
3 files changed, 9 insertions, 9 deletions
diff --git a/sw/source/filter/xml/xmlimpit.cxx b/sw/source/filter/xml/xmlimpit.cxx
index 1a0978bc9bbd..f41cec7cd206 100644
--- a/sw/source/filter/xml/xmlimpit.cxx
+++ b/sw/source/filter/xml/xmlimpit.cxx
@@ -417,7 +417,7 @@ bool SvXMLImportItemMapper::PutXMLValue(
Color aColor( 128,128, 128 );
rShadow.SetLocation( SvxShadowLocation::BottomRight );
- OUString aToken;
+ std::u16string_view aToken;
while( aTokenEnum.getNextToken( aToken ) )
{
if( IsXMLToken( aToken, XML_NONE ) )
@@ -425,7 +425,7 @@ bool SvXMLImportItemMapper::PutXMLValue(
rShadow.SetLocation( SvxShadowLocation::NONE );
bOk = true;
}
- else if( !bColorFound && aToken.startsWith("#") )
+ else if( !bColorFound && aToken.substr(0,1) == u"#" )
{
bOk = ::sax::Converter::convertColor( aColor, aToken );
if( !bOk )
@@ -576,7 +576,7 @@ bool SvXMLImportItemMapper::PutXMLValue(
sal_Int32 nInWidth, nDistance, nOutWidth;
- OUString aToken;
+ std::u16string_view aToken;
if( !aTokenEnum.getNextToken( aToken ) )
return false;
@@ -732,7 +732,7 @@ bool SvXMLImportItemMapper::PutXMLValue(
SvxGraphicPosition ePos = GPOS_NONE, eTmp;
SvxGraphicPosition nTmp;
SvXMLTokenEnumerator aTokenEnum( rValue );
- OUString aToken;
+ std::u16string_view aToken;
bool bHori = false, bVert = false;
bOk = true;
while( bOk && aTokenEnum.getNextToken( aToken ) )
@@ -741,7 +741,7 @@ bool SvXMLImportItemMapper::PutXMLValue(
{
bOk = false;
}
- else if( -1 != aToken.indexOf( '%' ) )
+ else if( std::u16string_view::npos != aToken.find( '%' ) )
{
sal_Int32 nPrc = 50;
if (::sax::Converter::convertPercent(nPrc, aToken))
diff --git a/sw/source/filter/xml/xmlithlp.cxx b/sw/source/filter/xml/xmlithlp.cxx
index eb2bd25dbad4..552170949d91 100644
--- a/sw/source/filter/xml/xmlithlp.cxx
+++ b/sw/source/filter/xml/xmlithlp.cxx
@@ -74,14 +74,14 @@ const sal_uInt16 aBorderWidths[] =
DEF_LINE_WIDTH_1,
};
-bool sw_frmitems_parseXMLBorder( const OUString& rValue,
+bool sw_frmitems_parseXMLBorder( std::u16string_view rValue,
const SvXMLUnitConverter& rUnitConverter,
bool& rHasStyle, sal_uInt16& rStyle,
bool& rHasWidth, sal_uInt16& rWidth,
sal_uInt16& rNamedWidth,
bool& rHasColor, Color& rColor )
{
- OUString aToken;
+ std::u16string_view aToken;
SvXMLTokenEnumerator aTokens( rValue );
rHasStyle = false;
@@ -93,7 +93,7 @@ bool sw_frmitems_parseXMLBorder( const OUString& rValue,
rNamedWidth = USHRT_MAX;
sal_Int32 nTemp;
- while( aTokens.getNextToken( aToken ) && !aToken.isEmpty() )
+ while( aTokens.getNextToken( aToken ) && !aToken.empty() )
{
if( !rHasWidth &&
SvXMLUnitConverter::convertEnum( rNamedWidth, aToken,
diff --git a/sw/source/filter/xml/xmlithlp.hxx b/sw/source/filter/xml/xmlithlp.hxx
index 57d688feffe5..99d3acd21dec 100644
--- a/sw/source/filter/xml/xmlithlp.hxx
+++ b/sw/source/filter/xml/xmlithlp.hxx
@@ -32,7 +32,7 @@ class Color;
/** Define various helper variables and functions for xmlimpit.cxx and
* xmlexpit.cxx. */
-bool sw_frmitems_parseXMLBorder( const OUString& rValue,
+bool sw_frmitems_parseXMLBorder( std::u16string_view rValue,
const SvXMLUnitConverter& rUnitConverter,
bool& rHasStyle, sal_uInt16& rStyle,
bool& rHasWidth, sal_uInt16& rWidth,