cppu/source/typelib/typelib.cxx | 5 +++-- stoc/source/security/permissions.cxx | 11 ++++++----- 2 files changed, 9 insertions(+), 7 deletions(-)
New commits: commit 035c9fc7ecaf0fce032748f47450fb31cc62d65a Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Sat Apr 9 09:42:26 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sat Apr 9 13:26:39 2022 +0200 use more subView when converting to Int32 Change-Id: Ia1be48050cca386a6e765aa2229de1bc9e64ffff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132749 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/cppu/source/typelib/typelib.cxx b/cppu/source/typelib/typelib.cxx index d659171f1722..fddaa16baa3a 100644 --- a/cppu/source/typelib/typelib.cxx +++ b/cppu/source/typelib/typelib.cxx @@ -35,6 +35,7 @@ #include <osl/diagnose.h> #include <typelib/typedescription.h> #include <uno/any2.h> +#include <o3tl/string_view.hxx> #include "typelib.hxx" using namespace osl; @@ -1984,8 +1985,8 @@ extern "C" void SAL_CALL typelib_typedescription_getByName( &pInterface, name.copy(i4 + 1).pData); if (!createDerivedInterfaceMemberDescription( ppRet, name, pBaseRef, pBase, pInterface, - name.copy(i2, i3 - i2).toInt32(), - name.copy(i3 + 1, i4 - i3 - 1).toInt32())) + o3tl::toInt32(name.subView(i2, i3 - i2)), + o3tl::toInt32(name.subView(i3 + 1, i4 - i3 - 1)))) { if (pInterface != nullptr) { typelib_typedescription_release(pInterface); diff --git a/stoc/source/security/permissions.cxx b/stoc/source/security/permissions.cxx index 1d7aca177344..8fa8bdd831cd 100644 --- a/stoc/source/security/permissions.cxx +++ b/stoc/source/security/permissions.cxx @@ -27,6 +27,7 @@ #include <rtl/string.hxx> #include <rtl/ustrbuf.hxx> #include <sal/log.hxx> +#include <o3tl/string_view.hxx> #include <com/sun/star/security/RuntimePermission.hpp> #include <com/sun/star/security/AllPermission.hpp> @@ -148,20 +149,20 @@ SocketPermission::SocketPermission( sal_Int32 minus = m_host.indexOf( '-', colon +1 ); if (minus < 0) { - m_lowerPort = m_upperPort = m_host.copy( colon +1 ).toInt32(); + m_lowerPort = m_upperPort = o3tl::toInt32(m_host.subView( colon +1 )); } else if (minus == (colon +1)) // -N { - m_upperPort = m_host.copy( minus +1 ).toInt32(); + m_upperPort = o3tl::toInt32(m_host.subView( minus +1 )); } else if (minus == (m_host.getLength() -1)) // N- { - m_lowerPort = m_host.copy( colon +1, m_host.getLength() -1 -colon -1 ).toInt32(); + m_lowerPort = o3tl::toInt32(m_host.subView( colon +1, m_host.getLength() -1 -colon -1 )); } else // A-B { - m_lowerPort = m_host.copy( colon +1, minus - colon -1 ).toInt32(); - m_upperPort = m_host.copy( minus +1 ).toInt32(); + m_lowerPort = o3tl::toInt32(m_host.subView( colon +1, minus - colon -1 )); + m_upperPort = o3tl::toInt32(m_host.subView( minus +1 )); } m_host = m_host.copy( 0, colon ); }