diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-29 11:06:33 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-01 08:30:18 +0200 |
commit | 5200a73627d13e2997f81b53f61e143e77e328ee (patch) | |
tree | f95c8346d061ecd0ad33d574895d18e169662785 /sd/source/ui/unoidl/unopage.cxx | |
parent | b90d3d316dd9c720c83180b31f6bbd7003fead78 (diff) |
use more string_view in various
found by examining uses of OUString::copy() for likely places
Change-Id: I6ff20e7b273ad6005410b82719183c1122f8c018
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133617
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/source/ui/unoidl/unopage.cxx')
-rw-r--r-- | sd/source/ui/unoidl/unopage.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index bc042babe8d5..a2adb7a7f75d 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -74,6 +74,7 @@ #include <vcl/dibtools.hxx> #include <tools/debug.hxx> #include <tools/stream.hxx> +#include <o3tl/string_view.hxx> using ::com::sun::star::animations::XAnimationNode; using ::com::sun::star::animations::XAnimationNodeSupplier; @@ -2172,16 +2173,15 @@ OUString getUiNameFromPageApiNameImpl( const OUString& rApiName ) const OUString aDefPageName( sEmptyPageName ); if( rApiName.startsWith( aDefPageName ) ) { - OUString aNumber( rApiName.copy( aDefPageName.getLength() ) ); + std::u16string_view aNumber( rApiName.subView( aDefPageName.getLength() ) ); // create the page number - sal_Int32 nPageNumber = aNumber.toInt32(); + sal_Int32 nPageNumber = o3tl::toInt32(aNumber); // check if there are non number characters in the number part - const sal_Int32 nChars = aNumber.getLength(); - const sal_Unicode* pString = aNumber.getStr(); - sal_Int32 nChar; - for( nChar = 0; nChar < nChars; nChar++, pString++ ) + const size_t nChars = aNumber.size(); + const sal_Unicode* pString = aNumber.data(); + for( size_t nChar = 0; nChar < nChars; nChar++, pString++ ) { if((*pString < '0') || (*pString > '9')) { |