diff options
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/docprop/docprophandler.cxx | 17 | ||||
-rw-r--r-- | oox/source/drawingml/customshapepresetdata.cxx | 5 | ||||
-rw-r--r-- | oox/source/drawingml/customshapeproperties.cxx | 3 | ||||
-rw-r--r-- | oox/source/drawingml/hyperlinkcontext.cxx | 3 | ||||
-rw-r--r-- | oox/source/helper/attributelist.cxx | 13 | ||||
-rw-r--r-- | oox/source/ole/axcontrol.cxx | 5 | ||||
-rw-r--r-- | oox/source/ppt/pptshape.cxx | 5 | ||||
-rw-r--r-- | oox/source/ppt/presentationfragmenthandler.cxx | 7 | ||||
-rw-r--r-- | oox/source/vml/vmldrawing.cxx | 3 | ||||
-rw-r--r-- | oox/source/vml/vmlformatting.cxx | 7 | ||||
-rw-r--r-- | oox/source/vml/vmlshape.cxx | 7 | ||||
-rw-r--r-- | oox/source/vml/vmlshapecontext.cxx | 3 |
12 files changed, 45 insertions, 33 deletions
diff --git a/oox/source/docprop/docprophandler.cxx b/oox/source/docprop/docprophandler.cxx index 95043e497aea..587740f24a93 100644 --- a/oox/source/docprop/docprophandler.cxx +++ b/oox/source/docprop/docprophandler.cxx @@ -24,6 +24,7 @@ #include <com/sun/star/lang/IllegalArgumentException.hpp> #include <com/sun/star/xml/sax/SAXException.hpp> #include <cppuhelper/exc_hlp.hxx> +#include <comphelper/string.hxx> #include <o3tl/safeint.hxx> #include <osl/time.h> @@ -98,25 +99,25 @@ util::DateTime OOXMLDocPropHandler::GetDateTimeFromW3CDTF( const OUString& aChar const sal_Int32 nLen = aChars.getLength(); if ( nLen >= 4 ) { - aOslDTime.Year = static_cast<sal_Int16>(aChars.copy( 0, 4 ).toInt32()); + aOslDTime.Year = static_cast<sal_Int16>(comphelper::string::toInt32(aChars.subView( 0, 4 ))); if ( nLen >= 7 && aChars[4] == '-' ) { - aOslDTime.Month = static_cast<sal_uInt16>(aChars.copy( 5, 2 ).toInt32()); + aOslDTime.Month = static_cast<sal_uInt16>(comphelper::string::toInt32(aChars.subView( 5, 2 ))); if ( nLen >= 10 && aChars[7] == '-' ) { - aOslDTime.Day = static_cast<sal_uInt16>(aChars.copy( 8, 2 ).toInt32()); + aOslDTime.Day = static_cast<sal_uInt16>(comphelper::string::toInt32(aChars.subView( 8, 2 ))); if ( nLen >= 16 && aChars[10] == 'T' && aChars[13] == ':' ) { - aOslDTime.Hours = static_cast<sal_uInt16>(aChars.copy( 11, 2 ).toInt32()); - aOslDTime.Minutes = static_cast<sal_uInt16>(aChars.copy( 14, 2 ).toInt32()); + aOslDTime.Hours = static_cast<sal_uInt16>(comphelper::string::toInt32(aChars.subView( 11, 2 ))); + aOslDTime.Minutes = static_cast<sal_uInt16>(comphelper::string::toInt32(aChars.subView( 14, 2 ))); sal_Int32 nOptTime = 0; if ( nLen >= 19 && aChars[16] == ':' ) { - aOslDTime.Seconds = static_cast<sal_uInt16>(aChars.copy( 17, 2 ).toInt32()); + aOslDTime.Seconds = static_cast<sal_uInt16>(comphelper::string::toInt32(aChars.subView( 17, 2 ))); nOptTime += 3; if ( nLen >= 20 && aChars[19] == '.' ) { @@ -162,8 +163,8 @@ util::DateTime OOXMLDocPropHandler::GetDateTimeFromW3CDTF( const OUString& aChar if ( ( aChars[16 + nOptTime] == '+' || aChars[16 + nOptTime] == '-' ) && aChars[16 + nOptTime + 3] == ':' ) { - nModif = aChars.copy( 16 + nOptTime + 1, 2 ).toInt32() * 3600; - nModif += aChars.copy( 16 + nOptTime + 4, 2 ).toInt32() * 60; + nModif = comphelper::string::toInt32(aChars.subView( 16 + nOptTime + 1, 2 )) * 3600; + nModif += comphelper::string::toInt32(aChars.subView( 16 + nOptTime + 4, 2 )) * 60; if ( aChars[16 + nOptTime] == '-' ) nModif *= -1; } 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 ) ); diff --git a/oox/source/helper/attributelist.cxx b/oox/source/helper/attributelist.cxx index 6ac3ea872eb4..a8f19a335cbc 100644 --- a/oox/source/helper/attributelist.cxx +++ b/oox/source/helper/attributelist.cxx @@ -23,6 +23,7 @@ #include <rtl/ustrbuf.hxx> #include <sax/fastattribs.hxx> #include <oox/token/tokenmap.hxx> +#include <comphelper/string.hxx> namespace oox { @@ -253,12 +254,12 @@ OptValue< util::DateTime > AttributeList::getDateTime( sal_Int32 nAttrToken ) co (aValue[ 10 ] == 'T') && (aValue[ 13 ] == ':') && (aValue[ 16 ] == ':'); if( bValid ) { - aDateTime.Year = static_cast< sal_uInt16 >( aValue.copy( 0, 4 ).toInt32() ); - aDateTime.Month = static_cast< sal_uInt16 >( aValue.copy( 5, 2 ).toInt32() ); - aDateTime.Day = static_cast< sal_uInt16 >( aValue.copy( 8, 2 ).toInt32() ); - aDateTime.Hours = static_cast< sal_uInt16 >( aValue.copy( 11, 2 ).toInt32() ); - aDateTime.Minutes = static_cast< sal_uInt16 >( aValue.copy( 14, 2 ).toInt32() ); - aDateTime.Seconds = static_cast< sal_uInt16 >( aValue.copy( 17, 2 ).toInt32() ); + aDateTime.Year = static_cast< sal_uInt16 >( comphelper::string::toInt32(aValue.subView( 0, 4 )) ); + aDateTime.Month = static_cast< sal_uInt16 >( comphelper::string::toInt32(aValue.subView( 5, 2 )) ); + aDateTime.Day = static_cast< sal_uInt16 >( comphelper::string::toInt32(aValue.subView( 8, 2 )) ); + aDateTime.Hours = static_cast< sal_uInt16 >( comphelper::string::toInt32(aValue.subView( 11, 2 )) ); + aDateTime.Minutes = static_cast< sal_uInt16 >( comphelper::string::toInt32(aValue.subView( 14, 2 )) ); + aDateTime.Seconds = static_cast< sal_uInt16 >( comphelper::string::toInt32(aValue.subView( 17, 2 )) ); } return OptValue< util::DateTime >( bValid, aDateTime ); } diff --git a/oox/source/ole/axcontrol.cxx b/oox/source/ole/axcontrol.cxx index 7442e54ea675..f960e819417f 100644 --- a/oox/source/ole/axcontrol.cxx +++ b/oox/source/ole/axcontrol.cxx @@ -63,6 +63,7 @@ #include <oox/token/properties.hxx> #include <oox/token/tokens.hxx> #include <tools/diagnose_ex.h> +#include <comphelper/string.hxx> namespace oox::ole { @@ -837,8 +838,8 @@ void AxControlModelBase::importProperty( sal_Int32 nPropId, const OUString& rVal OSL_ENSURE( nSepPos >= 0, "AxControlModelBase::importProperty - missing separator in 'Size' property" ); if( nSepPos >= 0 ) { - maSize.first = rValue.copy( 0, nSepPos ).toInt32(); - maSize.second = rValue.copy( nSepPos + 1 ).toInt32(); + maSize.first = comphelper::string::toInt32(rValue.subView( 0, nSepPos )); + maSize.second = comphelper::string::toInt32(rValue.subView( nSepPos + 1 )); } } break; diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx index 92b61176d0c1..f334d100a05d 100644 --- a/oox/source/ppt/pptshape.cxx +++ b/oox/source/ppt/pptshape.cxx @@ -42,6 +42,7 @@ #include <oox/ppt/slidepersist.hxx> #include <oox/token/tokens.hxx> #include <oox/token/properties.hxx> +#include <comphelper/string.hxx> using namespace ::oox::core; using namespace ::oox::drawingml; @@ -473,7 +474,7 @@ void PPTShape::addShape( if (xNamed->getName().startsWith(aTitleText, &sRest) && (sRest.isEmpty() || (sRest.startsWith(" (") && sRest.endsWith(")") - && sRest.copy(2, sRest.getLength() - 3).toInt32() > 0))) + && comphelper::string::toInt32(sRest.subView(2, sRest.getLength() - 3)) > 0))) nCount++; } Reference<container::XNamed> xName(rSlidePersist.getPage(), UNO_QUERY_THROW); @@ -620,7 +621,7 @@ void PPTShape::addShape( sal_Int32 nPageNumber = 0; static const OUStringLiteral sSlide = u"Slide "; if (sURL.match(sSlide)) - nPageNumber = sURL.copy(sSlide.getLength()).toInt32(); + nPageNumber = comphelper::string::toInt32(sURL.subView(sSlide.getLength())); Reference<drawing::XDrawPagesSupplier> xDPS(rFilterBase.getModel(), uno::UNO_QUERY_THROW); Reference<drawing::XDrawPages> xDrawPages(xDPS->getDrawPages(), diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx index a088bf04636e..2d5f18af81d5 100644 --- a/oox/source/ppt/presentationfragmenthandler.cxx +++ b/oox/source/ppt/presentationfragmenthandler.cxx @@ -20,6 +20,7 @@ #include <comphelper/anytostring.hxx> #include <comphelper/propertyvalue.hxx> #include <comphelper/sequenceashashmap.hxx> +#include <comphelper/string.hxx> #include <sal/log.hxx> #include <tools/multisel.hxx> #include <tools/diagnose_ex.h> @@ -131,10 +132,10 @@ static void ResolveTextFields( XmlFilterBase const & rFilter ) bool bNotes = false; sal_Int32 nPageNumber = 0; if ( aURL.match( sSlide ) ) - nPageNumber = aURL.copy( sSlide.getLength() ).toInt32(); + nPageNumber = comphelper::string::toInt32(aURL.subView( sSlide.getLength() )); else if ( aURL.match( sNotes ) ) { - nPageNumber = aURL.copy( sNotes.getLength() ).toInt32(); + nPageNumber = comphelper::string::toInt32(aURL.subView( sNotes.getLength() )); bNotes = true; } if ( nPageNumber ) @@ -192,7 +193,7 @@ void PresentationFragmentHandler::importCustomSlideShow(std::vector<CustomShow>& OUString sCustomSlide = rCustomShowList[i].maSldLst[j]; sal_Int32 nPageNumber = 0; if (sCustomSlide.match(sSlide)) - nPageNumber = sCustomSlide.copy(sSlide.getLength()).toInt32(); + nPageNumber = comphelper::string::toInt32(sCustomSlide.subView(sSlide.getLength())); Reference<XDrawPage> xPage; xDrawPages->getByIndex(nPageNumber - 1) >>= xPage; diff --git a/oox/source/vml/vmldrawing.cxx b/oox/source/vml/vmldrawing.cxx index 1d468fe7b3cd..aa64ce397caa 100644 --- a/oox/source/vml/vmldrawing.cxx +++ b/oox/source/vml/vmldrawing.cxx @@ -38,6 +38,7 @@ #include <oox/vml/vmlshapecontainer.hxx> #include <tools/diagnose_ex.h> #include <tools/gen.hxx> +#include <comphelper/string.hxx> namespace oox::vml { @@ -65,7 +66,7 @@ OUString lclGetShapeId( sal_Int32 nShapeId ) sal_Int32 lclGetShapeId( const OUString& rShapeId ) { // identifier consists of a literal NUL character, a lowercase 's', and the id - return ((rShapeId.getLength() >= 3) && (rShapeId[ 0 ] == '\0') && (rShapeId[ 1 ] == 's')) ? rShapeId.copy( 2 ).toInt32() : -1; + return ((rShapeId.getLength() >= 3) && (rShapeId[ 0 ] == '\0') && (rShapeId[ 1 ] == 's')) ? comphelper::string::toInt32(rShapeId.subView( 2 )) : -1; } } // namespace diff --git a/oox/source/vml/vmlformatting.cxx b/oox/source/vml/vmlformatting.cxx index 5474f782aa64..a93996d94289 100644 --- a/oox/source/vml/vmlformatting.cxx +++ b/oox/source/vml/vmlformatting.cxx @@ -45,6 +45,7 @@ #include <oox/token/tokens.hxx> #include <svx/svdtrans.hxx> #include <comphelper/propertysequence.hxx> +#include <comphelper/string.hxx> #include <vcl/virdev.hxx> namespace oox::vml { @@ -274,7 +275,7 @@ Color ConversionHelper::decodeColor( const GraphicHelper& rGraphicHelper, // try palette colors enclosed in brackets if( (aColorIndex.getLength() >= 3) && (aColorIndex[ 0 ] == '[') && (aColorIndex[ aColorIndex.getLength() - 1 ] == ']') ) { - aDmlColor.setPaletteClr( aColorIndex.copy( 1, aColorIndex.getLength() - 2 ).toInt32() ); + aDmlColor.setPaletteClr( comphelper::string::toInt32(aColorIndex.subView( 1, aColorIndex.getLength() - 2 )) ); return aDmlColor; } @@ -291,7 +292,7 @@ Color ConversionHelper::decodeColor( const GraphicHelper& rGraphicHelper, case XML_darken: nModToken = XML_shade;break; case XML_lighten: nModToken = XML_tint; } - sal_Int32 nValue = aColorIndex.copy( nOpenParen + 1, nCloseParen - nOpenParen - 1 ).toInt32(); + sal_Int32 nValue = comphelper::string::toInt32(aColorIndex.subView( nOpenParen + 1, nCloseParen - nOpenParen - 1 )); if( (nModToken != XML_TOKEN_INVALID) && (0 <= nValue) && (nValue < 255) ) { /* Simulate this modifier color by a color with related transformation. @@ -336,7 +337,7 @@ void ConversionHelper::decodeVmlPath( ::std::vector< ::std::vector< Point > >& r if ( state != START && state != UNSUPPORTED ) { if ( nTokenLen > 0 ) - aCoordList.push_back( rPath.copy( nTokenStart, nTokenLen ).toInt32() ); + aCoordList.push_back( comphelper::string::toInt32(rPath.subView( nTokenStart, nTokenLen )) ); else aCoordList.push_back( 0 ); nTokenLen = 0; diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx index f87cb12a6899..a0768503560b 100644 --- a/oox/source/vml/vmlshape.cxx +++ b/oox/source/vml/vmlshape.cxx @@ -69,6 +69,7 @@ #include <comphelper/processfactory.hxx> #include <comphelper/propertyvalue.hxx> #include <comphelper/storagehelper.hxx> +#include <comphelper/string.hxx> using ::com::sun::star::beans::XPropertySet; using ::com::sun::star::uno::Any; @@ -313,7 +314,7 @@ void ShapeBase::finalizeFragmentImport() static const OUStringLiteral sShapeTypePrefix = u"shapetype_"; OUString tmp; if (aType.startsWith(sShapeTypePrefix)) { - maTypeModel.moShapeType = aType.copy(sShapeTypePrefix.getLength()).toInt32(); + maTypeModel.moShapeType = comphelper::string::toInt32(aType.subView(sShapeTypePrefix.getLength())); } else if (aType.startsWith("_x0000_t", &tmp)) { maTypeModel.moShapeType = tmp.toInt32(); @@ -377,8 +378,8 @@ Reference< XShape > ShapeBase::convertAndInsert( const Reference< XShapes >& rxS if (idPos < seqPos) { auto idPosEnd = idPos+2; - id = sLinkChainName.copy(idPosEnd, seqPos - idPosEnd).toInt32(); - seq = sLinkChainName.copy(seqPos+2).toInt32(); + id = comphelper::string::toInt32(sLinkChainName.subView(idPosEnd, seqPos - idPosEnd)); + seq = comphelper::string::toInt32(sLinkChainName.subView(seqPos+2)); } } diff --git a/oox/source/vml/vmlshapecontext.cxx b/oox/source/vml/vmlshapecontext.cxx index 4ed3f83fd076..d41539083917 100644 --- a/oox/source/vml/vmlshapecontext.cxx +++ b/oox/source/vml/vmlshapecontext.cxx @@ -35,6 +35,7 @@ #include <osl/diagnose.h> #include <filter/msfilter/escherex.hxx> +#include <comphelper/string.hxx> namespace oox::vml { @@ -299,7 +300,7 @@ ShapeTypeContext::ShapeTypeContext(ContextHandler2Helper const & rParent, if( mrTypeModel.maShapeName.startsWith( sShapeTypePrefix ) ) { mrTypeModel.maShapeId = mrTypeModel.maShapeName; - mrTypeModel.moShapeType = mrTypeModel.maShapeName.copy(sShapeTypePrefix.getLength()).toInt32(); + mrTypeModel.moShapeType = comphelper::string::toInt32(mrTypeModel.maShapeName.subView(sShapeTypePrefix.getLength())); } else if (mrTypeModel.maShapeName.startsWith("_x0000_t", &tmp)) { |