summaryrefslogtreecommitdiff
path: root/oox/source/drawingml
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-04-07 20:54:55 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-04-08 13:18:41 +0200
commit36e0e88b28e818faf25b8e32cc8c4dc444b8a0be (patch)
treeb7b5c8e13b6e05f871b01a3d0bf68c1d1329ef12 /oox/source/drawingml
parentcf5bbe3fce4a250ab25998053965bdc604c6114e (diff)
use more subView when converting to Int32
Change-Id: I54e3ddf79ba793fd4328bf8bda7f949b65349651 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132693 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'oox/source/drawingml')
-rw-r--r--oox/source/drawingml/customshapepresetdata.cxx5
-rw-r--r--oox/source/drawingml/customshapeproperties.cxx3
-rw-r--r--oox/source/drawingml/hyperlinkcontext.cxx3
3 files changed, 7 insertions, 4 deletions
diff --git a/oox/source/drawingml/customshapepresetdata.cxx b/oox/source/drawingml/customshapepresetdata.cxx
index ea1fcbb41362..75f43c94e80a 100644
--- a/oox/source/drawingml/customshapepresetdata.cxx
+++ b/oox/source/drawingml/customshapepresetdata.cxx
@@ -20,6 +20,7 @@
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeTextFrame.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeAdjustmentValue.hpp>
+#include <comphelper/string.hxx>
using namespace ::com::sun::star;
@@ -151,7 +152,7 @@ awt::Rectangle lcl_parseRectangle(const OString& rValue)
static const char aExpectedHeightPrefix[] = " Height = (long) ";
assert(nIndex >= 0 && rValue.match(aExpectedHeightPrefix, nIndex));
nIndex += strlen(aExpectedHeightPrefix);
- aRectangle.Height = rValue.copy(nIndex).toInt32();
+ aRectangle.Height = comphelper::string::toInt32(rValue.subView(nIndex));
return aRectangle;
}
@@ -168,7 +169,7 @@ awt::Size lcl_parseSize(const OString& rValue)
static const char aExpectedHeightPrefix[] = " Height = (long) ";
assert(nIndex >= 0 && rValue.match(aExpectedHeightPrefix, nIndex));
nIndex += strlen(aExpectedHeightPrefix);
- aSize.Height = rValue.copy(nIndex).toInt32();
+ aSize.Height = comphelper::string::toInt32(rValue.subView(nIndex));
return aSize;
}
diff --git a/oox/source/drawingml/customshapeproperties.cxx b/oox/source/drawingml/customshapeproperties.cxx
index b748deb48702..3e81b84a133f 100644
--- a/oox/source/drawingml/customshapeproperties.cxx
+++ b/oox/source/drawingml/customshapeproperties.cxx
@@ -31,6 +31,7 @@
#include <com/sun/star/drawing/XEnhancedCustomShapeDefaulter.hpp>
#include <com/sun/star/drawing/XShape.hpp>
#include <comphelper/sequence.hxx>
+#include <comphelper/string.hxx>
#include <sal/log.hxx>
#include <algorithm>
@@ -150,7 +151,7 @@ void CustomShapeProperties::pushToPropSet(
{
if ( adjustmentGuide.maName.getLength() > 3 )
{
- sal_Int32 nAdjustmentIndex = adjustmentGuide.maName.copy( 3 ).toInt32() - 1;
+ sal_Int32 nAdjustmentIndex = comphelper::string::toInt32(adjustmentGuide.maName.subView( 3 )) - 1;
if ( ( nAdjustmentIndex >= 0 ) && ( nAdjustmentIndex < aAdjustmentSeq.getLength() ) )
{
EnhancedCustomShapeAdjustmentValue aAdjustmentVal;
diff --git a/oox/source/drawingml/hyperlinkcontext.cxx b/oox/source/drawingml/hyperlinkcontext.cxx
index 0221e3875d31..844cb7a4fb2c 100644
--- a/oox/source/drawingml/hyperlinkcontext.cxx
+++ b/oox/source/drawingml/hyperlinkcontext.cxx
@@ -28,6 +28,7 @@
#include <oox/token/namespaces.hxx>
#include <oox/token/properties.hxx>
#include <oox/token/tokens.hxx>
+#include <comphelper/string.hxx>
using namespace ::oox::core;
using namespace ::com::sun::star::uno;
@@ -116,7 +117,7 @@ HyperLinkContext::HyperLinkContext( ContextHandler2Helper const & rParent,
break;
nLength++;
}
- sal_Int32 nPageNumber = sHref.copy( nIndex2, nLength ).toInt32();
+ sal_Int32 nPageNumber = comphelper::string::toInt32(sHref.subView( nIndex2, nLength ));
if ( nPageNumber )
{
const OUString aSlideType( sHref.copy( 0, nIndex2 ) );