diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-08 14:05:30 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-08 20:44:43 +0200 |
commit | 3e7679738413054c7e6ce973380eac501bf41cf2 (patch) | |
tree | ad80f5bd2f11020fa864488792b6cc0e98a00207 /xmloff | |
parent | 3bfac2a7fad9737f31443292699bd6fee6ac3a6f (diff) |
move comphelper::string::toInt32 to o3tl
so we can use it in places where we cannot include comphelper
Change-Id: Iba0ba3e4c0dcf0f9d1f09092a77c3b2010ec4f6d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132732
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/chart/SchXMLChartContext.cxx | 6 | ||||
-rw-r--r-- | xmloff/source/core/unointerfacetouniqueidentifiermapper.cxx | 4 | ||||
-rw-r--r-- | xmloff/source/core/xmlimp.cxx | 7 | ||||
-rw-r--r-- | xmloff/source/xforms/SchemaRestrictionContext.cxx | 8 |
4 files changed, 13 insertions, 12 deletions
diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx index b5aaf117cf45..31c48ba6ff9d 100644 --- a/xmloff/source/chart/SchXMLChartContext.cxx +++ b/xmloff/source/chart/SchXMLChartContext.cxx @@ -57,7 +57,7 @@ #include <com/sun/star/container/XChild.hpp> #include <com/sun/star/chart2/data/XDataReceiver.hpp> -#include <comphelper/string.hxx> +#include <o3tl/string_view.hxx> using namespace com::sun::star; using namespace ::xmloff::token; @@ -181,7 +181,7 @@ uno::Sequence< sal_Int32 > lcl_getNumberSequenceFromString( const OUString& rStr nPos = rStr.indexOf( aSpace, nLastPos ); if( nPos > nLastPos ) { - aVec.push_back( comphelper::string::toInt32(rStr.subView( nLastPos, (nPos - nLastPos) )) ); + aVec.push_back( o3tl::toInt32(rStr.subView( nLastPos, (nPos - nLastPos) )) ); } if( nPos != -1 ) nLastPos = nPos + 1; @@ -190,7 +190,7 @@ uno::Sequence< sal_Int32 > lcl_getNumberSequenceFromString( const OUString& rStr if( nLastPos != 0 && rStr.getLength() > nLastPos ) { - aVec.push_back( comphelper::string::toInt32(rStr.subView( nLastPos )) ); + aVec.push_back( o3tl::toInt32(rStr.subView( nLastPos )) ); } const sal_Int32 nVecSize = aVec.size(); diff --git a/xmloff/source/core/unointerfacetouniqueidentifiermapper.cxx b/xmloff/source/core/unointerfacetouniqueidentifiermapper.cxx index 1e61b1f52a58..e7e765132113 100644 --- a/xmloff/source/core/unointerfacetouniqueidentifiermapper.cxx +++ b/xmloff/source/core/unointerfacetouniqueidentifiermapper.cxx @@ -21,7 +21,7 @@ #include <o3tl/safeint.hxx> #include <xmloff/unointerfacetouniqueidentifiermapper.hxx> -#include <comphelper/string.hxx> +#include <o3tl/string_view.hxx> #include <algorithm> using namespace ::com::sun::star; @@ -95,7 +95,7 @@ bool UnoInterfaceToUniqueIdentifierMapper::registerReference( const OUString& rI // the identifier is a pure integer value // so we make sure we will never generate // an integer value like this one - sal_Int32 nId = comphelper::string::toInt32(rIdentifier.subView(2)); + sal_Int32 nId = o3tl::toInt32(rIdentifier.subView(2)); if (nId > 0 && mnNextId <= o3tl::make_unsigned(nId)) mnNextId = nId + 1; diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index e18769e9f6a4..38a6be15e6cb 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -73,6 +73,7 @@ #include <unotools/fontcvt.hxx> #include <fasttokenhandler.hxx> #include <vcl/GraphicExternalLink.hxx> +#include <o3tl/string_view.hxx> #include <com/sun/star/rdf/XMetadatable.hpp> #include <com/sun/star/rdf/XRepositorySupplier.hpp> @@ -1830,11 +1831,11 @@ bool SvXMLImport::getBuildIds( sal_Int32& rUPD, sal_Int32& rBuild ) const sal_Int32 nIndex = aBuildId.indexOf('$'); if (nIndex != -1) { - rUPD = comphelper::string::toInt32(aBuildId.subView( 0, nIndex )); + rUPD = o3tl::toInt32(aBuildId.subView( 0, nIndex )); sal_Int32 nIndexEnd = aBuildId.indexOf(';', nIndex); rBuild = (nIndexEnd == -1) - ? comphelper::string::toInt32(aBuildId.subView(nIndex + 1)) - : comphelper::string::toInt32(aBuildId.subView(nIndex + 1, nIndexEnd - nIndex - 1)); + ? o3tl::toInt32(aBuildId.subView(nIndex + 1)) + : o3tl::toInt32(aBuildId.subView(nIndex + 1, nIndexEnd - nIndex - 1)); bRet = true; } } diff --git a/xmloff/source/xforms/SchemaRestrictionContext.cxx b/xmloff/source/xforms/SchemaRestrictionContext.cxx index 68da0bdd95c9..2f44f1cd1f6e 100644 --- a/xmloff/source/xforms/SchemaRestrictionContext.cxx +++ b/xmloff/source/xforms/SchemaRestrictionContext.cxx @@ -38,7 +38,7 @@ #include <com/sun/star/xsd/DataTypeClass.hpp> #include <com/sun/star/xsd/WhiteSpaceTreatment.hpp> -#include <comphelper/string.hxx> +#include <o3tl/string_view.hxx> #include <sal/log.hxx> #include <tools/diagnose_ex.h> @@ -151,11 +151,11 @@ static Any xforms_date( const OUString& rValue ) { util::Date aDate; aDate.Year = static_cast<sal_uInt16>( - comphelper::string::toInt32(rValue.subView( 0, nPos1 )) ); + o3tl::toInt32(rValue.subView( 0, nPos1 )) ); aDate.Month = static_cast<sal_uInt16>( - comphelper::string::toInt32(rValue.subView( nPos1 + 1, nPos2 - nPos1 - 1 )) ); + o3tl::toInt32(rValue.subView( nPos1 + 1, nPos2 - nPos1 - 1 )) ); aDate.Day = static_cast<sal_uInt16>( - comphelper::string::toInt32(rValue.subView( nPos2 + 1 )) ); + o3tl::toInt32(rValue.subView( nPos2 + 1 )) ); aAny <<= aDate; } return aAny; |