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.grandin@collabora.co.uk>
This commit is contained in:
@@ -35,6 +35,7 @@
|
|||||||
#include <osl/diagnose.h>
|
#include <osl/diagnose.h>
|
||||||
#include <typelib/typedescription.h>
|
#include <typelib/typedescription.h>
|
||||||
#include <uno/any2.h>
|
#include <uno/any2.h>
|
||||||
|
#include <o3tl/string_view.hxx>
|
||||||
#include "typelib.hxx"
|
#include "typelib.hxx"
|
||||||
|
|
||||||
using namespace osl;
|
using namespace osl;
|
||||||
@@ -1984,8 +1985,8 @@ extern "C" void SAL_CALL typelib_typedescription_getByName(
|
|||||||
&pInterface, name.copy(i4 + 1).pData);
|
&pInterface, name.copy(i4 + 1).pData);
|
||||||
if (!createDerivedInterfaceMemberDescription(
|
if (!createDerivedInterfaceMemberDescription(
|
||||||
ppRet, name, pBaseRef, pBase, pInterface,
|
ppRet, name, pBaseRef, pBase, pInterface,
|
||||||
name.copy(i2, i3 - i2).toInt32(),
|
o3tl::toInt32(name.subView(i2, i3 - i2)),
|
||||||
name.copy(i3 + 1, i4 - i3 - 1).toInt32()))
|
o3tl::toInt32(name.subView(i3 + 1, i4 - i3 - 1))))
|
||||||
{
|
{
|
||||||
if (pInterface != nullptr) {
|
if (pInterface != nullptr) {
|
||||||
typelib_typedescription_release(pInterface);
|
typelib_typedescription_release(pInterface);
|
||||||
|
@@ -27,6 +27,7 @@
|
|||||||
#include <rtl/string.hxx>
|
#include <rtl/string.hxx>
|
||||||
#include <rtl/ustrbuf.hxx>
|
#include <rtl/ustrbuf.hxx>
|
||||||
#include <sal/log.hxx>
|
#include <sal/log.hxx>
|
||||||
|
#include <o3tl/string_view.hxx>
|
||||||
|
|
||||||
#include <com/sun/star/security/RuntimePermission.hpp>
|
#include <com/sun/star/security/RuntimePermission.hpp>
|
||||||
#include <com/sun/star/security/AllPermission.hpp>
|
#include <com/sun/star/security/AllPermission.hpp>
|
||||||
@@ -148,20 +149,20 @@ SocketPermission::SocketPermission(
|
|||||||
sal_Int32 minus = m_host.indexOf( '-', colon +1 );
|
sal_Int32 minus = m_host.indexOf( '-', colon +1 );
|
||||||
if (minus < 0)
|
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
|
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-
|
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
|
else // A-B
|
||||||
{
|
{
|
||||||
m_lowerPort = m_host.copy( colon +1, minus - colon -1 ).toInt32();
|
m_lowerPort = o3tl::toInt32(m_host.subView( colon +1, minus - colon -1 ));
|
||||||
m_upperPort = m_host.copy( minus +1 ).toInt32();
|
m_upperPort = o3tl::toInt32(m_host.subView( minus +1 ));
|
||||||
}
|
}
|
||||||
m_host = m_host.copy( 0, colon );
|
m_host = m_host.copy( 0, colon );
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user