diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-04 14:02:02 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-05 09:22:48 +0200 |
commit | 9b2ad2e29e69fa5b7561f738cc82e49268f2b4ec (patch) | |
tree | 4bf668dae5866506267c5ab13322c6f1da03a979 /sw | |
parent | abf73d576c10482a8e22cb0df3ab1520d751cbd7 (diff) |
add some comphelper::string::toInt* functions for string_views
Change-Id: Icf42e00575edf8fc847bccf9c9505cd9710fc9b2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132509
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/ascii/wrtasc.cxx | 3 | ||||
-rw-r--r-- | sw/source/uibase/utlui/unotools.cxx | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/sw/source/filter/ascii/wrtasc.cxx b/sw/source/filter/ascii/wrtasc.cxx index 1f4153293bc3..c37efe6ee713 100644 --- a/sw/source/filter/ascii/wrtasc.cxx +++ b/sw/source/filter/ascii/wrtasc.cxx @@ -29,6 +29,7 @@ #include <frameformats.hxx> #include <sfx2/docfile.hxx> #include <sfx2/sfxsids.hrc> +#include <comphelper/string.hxx> #include <strings.hrc> @@ -44,7 +45,7 @@ SwASCWriter::SwASCWriter( std::u16string_view rFltNm ) if( 5 < rFltNm.size() ) { std::u16string_view aFilterNum = rFltNm.substr( 5 ); - switch( rtl_ustr_toInt64_WithLength(aFilterNum.data(), 10, aFilterNum.size()) ) + switch( comphelper::string::toInt32(aFilterNum) ) { case 437: aNewOpts.SetCharSet( RTL_TEXTENCODING_IBM_437 ); break; case 850: aNewOpts.SetCharSet( RTL_TEXTENCODING_IBM_850 ); break; diff --git a/sw/source/uibase/utlui/unotools.cxx b/sw/source/uibase/utlui/unotools.cxx index 1d17a279674f..62c3397bf11c 100644 --- a/sw/source/uibase/utlui/unotools.cxx +++ b/sw/source/uibase/utlui/unotools.cxx @@ -50,6 +50,7 @@ #include <comphelper/processfactory.hxx> #include <comphelper/propertysequence.hxx> #include <comphelper/servicehelper.hxx> +#include <comphelper/string.hxx> #include <docsh.hxx> #include <editsh.hxx> #include <swmodule.hxx> @@ -499,7 +500,7 @@ void SwOneExampleFrame::PopupHdl(std::string_view rId) std::string_view sZoomValue; if (o3tl::starts_with(rId, "zoom", &sZoomValue)) { - sal_Int16 nZoom = rtl_str_toInt64_WithLength(sZoomValue.data(), 10, sZoomValue.length()); + sal_Int16 nZoom = comphelper::string::toInt32(sZoomValue); uno::Reference< view::XViewSettingsSupplier > xSettings(m_xController, uno::UNO_QUERY); uno::Reference< beans::XPropertySet > xViewProps = xSettings->getViewSettings(); |