diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-10-14 14:29:51 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-10-17 10:39:11 +0200 |
commit | 425255567eafffba3a5817fb96050663d1db8e2f (patch) | |
tree | d4f78a9103c34367b2aa29feb31faf4e6871d01e /xmlscript | |
parent | 6125be0aa10113d840a1fdbe33cf3174d5896fcb (diff) |
use more string_view
Change-Id: Ie826234aa9064b08b8f0647738b57c47ac0ed91a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141369
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmlscript')
-rw-r--r-- | xmlscript/source/xmldlg_imexp/imp_share.hxx | 8 | ||||
-rw-r--r-- | xmlscript/source/xmllib_imexp/imp_share.hxx | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/xmlscript/source/xmldlg_imexp/imp_share.hxx b/xmlscript/source/xmldlg_imexp/imp_share.hxx index ef418446998a..c05460ddf274 100644 --- a/xmlscript/source/xmldlg_imexp/imp_share.hxx +++ b/xmlscript/source/xmldlg_imexp/imp_share.hxx @@ -44,13 +44,13 @@ namespace xmlscript { -inline sal_Int32 toInt32( OUString const & rStr ) +inline sal_Int32 toInt32( std::u16string_view rStr ) { sal_Int32 nVal; - if (rStr.getLength() > 2 && rStr[ 0 ] == '0' && rStr[ 1 ] == 'x') - nVal = o3tl::toUInt32(rStr.subView( 2 ), 16); + if (rStr.size() > 2 && rStr[ 0 ] == '0' && rStr[ 1 ] == 'x') + nVal = o3tl::toUInt32(rStr.substr( 2 ), 16); else - nVal = rStr.toInt32(); + nVal = o3tl::toInt32(rStr); return nVal; } diff --git a/xmlscript/source/xmllib_imexp/imp_share.hxx b/xmlscript/source/xmllib_imexp/imp_share.hxx index 5798c13b92b6..f88474907922 100644 --- a/xmlscript/source/xmllib_imexp/imp_share.hxx +++ b/xmlscript/source/xmllib_imexp/imp_share.hxx @@ -32,16 +32,16 @@ namespace xmlscript { -inline sal_Int32 toInt32( OUString const & rStr ) +inline sal_Int32 toInt32( std::u16string_view rStr ) { sal_Int32 nVal; - if (rStr.getLength() > 2 && rStr[ 0 ] == '0' && rStr[ 1 ] == 'x') + if (rStr.size() > 2 && rStr[ 0 ] == '0' && rStr[ 1 ] == 'x') { - nVal = o3tl::toUInt32(rStr.subView( 2 ), 16); + nVal = o3tl::toUInt32(rStr.substr( 2 ), 16); } else { - nVal = rStr.toInt32(); + nVal = o3tl::toInt32(rStr); } return nVal; } |