diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-11 22:24:20 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-12 12:42:15 +0200 |
commit | cbaf1fbaa6e707d939f815eda360fad68a492aca (patch) | |
tree | 20b3dfeac257130afb01572b2c117b7840d07007 /sd | |
parent | f751417b77e6573a0c639778e76ec943449f4573 (diff) |
loplugin:stringview more o3tl conversion
look for call sequences that can use string_view and the new o3tl
functions in o3tl/string_view.hxx
Also add a few more wrappers to said #include file
Change-Id: I05d8752cc67a7b55b0b57e8eed803bd06bfcd9ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132840
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/export-tests-ooxml2.cxx | 3 | ||||
-rw-r--r-- | sd/source/filter/ppt/pptinanimations.cxx | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index 5fac35ea1833..9cf7968fbbba 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -26,6 +26,7 @@ #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> #include <rtl/character.hxx> +#include <o3tl/string_view.hxx> using namespace css; using namespace css::animations; @@ -709,7 +710,7 @@ void SdOOXMLExportTest2::testPresetShapesExport() size_t i = 0; while(i < SAL_N_ELEMENTS( sShapeTypeAndValues )) { OString sType( sShapeTypeAndValues[ i++ ] ); - for ( size_t j = 1 ; i < SAL_N_ELEMENTS( sShapeTypeAndValues ) && OString(sShapeTypeAndValues[i]).startsWith("adj") ; ++j ) { + for ( size_t j = 1 ; i < SAL_N_ELEMENTS( sShapeTypeAndValues ) && o3tl::starts_with(sShapeTypeAndValues[i], "adj") ; ++j ) { OString sXPath= sPattern.replaceFirst( sT, sType).replaceFirst( sN, OString::number(j) ); assertXPath(pXmlDocCT, sXPath, sPropertyName , OUString::createFromAscii(sShapeTypeAndValues[ i++ ]) ); assertXPath(pXmlDocCT, sXPath, sPropertyFmla , OUString::createFromAscii(sShapeTypeAndValues[ i++ ]) ); diff --git a/sd/source/filter/ppt/pptinanimations.cxx b/sd/source/filter/ppt/pptinanimations.cxx index 3b80cacc985a..45af5f0e8f95 100644 --- a/sd/source/filter/ppt/pptinanimations.cxx +++ b/sd/source/filter/ppt/pptinanimations.cxx @@ -59,6 +59,7 @@ #include <sal/log.hxx> #include <tools/debug.hxx> #include <osl/diagnose.h> +#include <o3tl/string_view.hxx> #include <svx/svdotext.hxx> #include <editeng/outlobj.hxx> @@ -859,8 +860,8 @@ void AnimationImporter::fillNode( Reference< XAnimationNode > const & xNode, con sal_Int32 nPos = aToken.indexOf( ',' ); if( nPos >= 0 ) { - pValues->Time = aToken.copy( 0, nPos ).toDouble(); - pValues->Progress = aToken.copy( nPos+1 ).toDouble(); + pValues->Time = o3tl::toDouble(aToken.subView( 0, nPos )); + pValues->Progress = o3tl::toDouble(aToken.subView( nPos+1 )); } pValues++; } |