[Libreoffice-commits] core.git: chart2/source cui/source dbaccess/source filter/source forms/source lotuswordpro/source oox/source package/source reportdesign/source sc/source sdext/source sd/source slideshow/source stoc/source svtools/source svx/source sw/source unotools/source unoxml/source winaccessibility/source xmloff/source

Noel Grandin noel.grandin at collabora.co.uk
Tue Jul 11 12:13:37 UTC 2017


 chart2/source/tools/InternalDataProvider.cxx           |    2 +-
 cui/source/customize/cfgutil.cxx                       |    8 ++++----
 cui/source/options/cfgchart.cxx                        |    2 +-
 dbaccess/source/ui/control/SqlNameEdit.cxx             |    2 +-
 dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx  |    2 +-
 filter/source/config/cache/querytokenizer.cxx          |    2 +-
 filter/source/msfilter/escherex.cxx                    |    4 ++--
 filter/source/msfilter/svdfppt.cxx                     |    2 +-
 forms/source/component/DatabaseForm.cxx                |    2 +-
 lotuswordpro/source/filter/lwpfribmark.cxx             |    2 +-
 lotuswordpro/source/filter/lwpmarker.cxx               |   10 +++++-----
 oox/source/drawingml/customshapepresetdata.cxx         |    2 +-
 package/source/zippackage/ZipPackage.cxx               |    6 +++---
 reportdesign/source/filter/xml/xmlExport.cxx           |    2 +-
 sc/source/filter/html/htmlexp.cxx                      |    2 +-
 sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx |    2 +-
 sd/source/filter/ppt/pptinanimations.cxx               |    2 +-
 sdext/source/presenter/PresenterController.cxx         |    2 +-
 slideshow/source/engine/shapes/shapeimporter.cxx       |    3 +--
 stoc/source/security/permissions.cxx                   |    2 +-
 svtools/source/control/collatorres.cxx                 |    2 +-
 svtools/source/control/indexentryres.cxx               |    2 +-
 svtools/source/svhtml/htmlsupp.cxx                     |    4 ++--
 svx/source/xml/xmlgrhlp.cxx                            |    4 ++--
 sw/source/filter/html/parcss1.cxx                      |    4 ++--
 unotools/source/config/dynamicmenuoptions.cxx          |    4 ++--
 unoxml/source/dom/characterdata.cxx                    |    6 +++---
 unoxml/source/dom/document.cxx                         |    4 ++--
 winaccessibility/source/UAccCOM/AccEditableText.cxx    |    4 ++--
 xmloff/source/chart/SchXMLChartContext.cxx             |    2 +-
 xmloff/source/draw/animationimport.cxx                 |    4 ++--
 xmloff/source/draw/shapeexport.cxx                     |    4 ++--
 32 files changed, 52 insertions(+), 53 deletions(-)

New commits:
commit 7de833a626cea8cd741ba1d971fea6f0c3a2660b
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Jul 11 11:04:35 2017 +0200

    simplify calls OUString::copy in foo.copy(x, foo.getLength() - x)
    
    Change-Id: I20318c77dcc3bc2a64336541ef5a3f412bfd9483
    Reviewed-on: https://gerrit.libreoffice.org/39803
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/chart2/source/tools/InternalDataProvider.cxx b/chart2/source/tools/InternalDataProvider.cxx
index c313475c0ed4..c407c3ac9cdd 100644
--- a/chart2/source/tools/InternalDataProvider.cxx
+++ b/chart2/source/tools/InternalDataProvider.cxx
@@ -1223,7 +1223,7 @@ OUString SAL_CALL InternalDataProvider::convertRangeFromXML( const OUString& aXM
 {
     const OUString aPivotTableID("PT@");
     if (aXMLRange.startsWith(aPivotTableID))
-        return aXMLRange.copy(aPivotTableID.getLength(), aXMLRange.getLength() - aPivotTableID.getLength());
+        return aXMLRange.copy(aPivotTableID.getLength());
 
     XMLRangeHelper::CellRange aRange( XMLRangeHelper::getCellRangeFromXMLString( aXMLRange ));
     if( aRange.aUpperLeft.bIsEmpty )
diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx
index effb212be761..17c445d672e8 100644
--- a/cui/source/customize/cfgutil.cxx
+++ b/cui/source/customize/cfgutil.cxx
@@ -115,15 +115,15 @@ bool SfxStylesInfo_Impl::parseStyleCommand(SfxStyleInfo_Impl& aStyle)
 
     OUString sArg = sCmdArgs.copy(0, i);
     if (sArg.startsWith(CMDURL_SPART_ONLY))
-        aStyle.sStyle = sArg.copy(LEN_SPART, sArg.getLength()-LEN_SPART);
+        aStyle.sStyle = sArg.copy(LEN_SPART);
     else if (sArg.startsWith(CMDURL_FPART_ONLY))
-        aStyle.sFamily = sArg.copy(LEN_FPART, sArg.getLength()-LEN_FPART);
+        aStyle.sFamily = sArg.copy(LEN_FPART);
 
     sArg = sCmdArgs.copy(i+1, sCmdArgs.getLength()-i-1);
     if (sArg.startsWith(CMDURL_SPART_ONLY))
-        aStyle.sStyle = sArg.copy(LEN_SPART, sArg.getLength()-LEN_SPART);
+        aStyle.sStyle = sArg.copy(LEN_SPART);
     else if (sArg.startsWith(CMDURL_FPART_ONLY))
-        aStyle.sFamily = sArg.copy(LEN_FPART, sArg.getLength()-LEN_FPART);
+        aStyle.sFamily = sArg.copy(LEN_FPART);
 
     return !(aStyle.sFamily.isEmpty() || aStyle.sStyle.isEmpty());
 }
diff --git a/cui/source/options/cfgchart.cxx b/cui/source/options/cfgchart.cxx
index fe9a24a01437..8a2e95793b16 100644
--- a/cui/source/options/cfgchart.cxx
+++ b/cui/source/options/cfgchart.cxx
@@ -224,7 +224,7 @@ bool SvxChartOptions::RetrieveOptions()
         {
             aPrefix = aResName.copy( 0, nPos );
             sal_Int32 idx = nPos + sizeof( "$(ROW)" ) - 1;
-            aPostfix = aResName.copy( idx, aResName.getLength()-idx );
+            aPostfix = aResName.copy( idx );
         }
         else
             aPrefix = aResName;
diff --git a/dbaccess/source/ui/control/SqlNameEdit.cxx b/dbaccess/source/ui/control/SqlNameEdit.cxx
index 4f89d37dd8fe..c86a51b13ff9 100644
--- a/dbaccess/source/ui/control/SqlNameEdit.cxx
+++ b/dbaccess/source/ui/control/SqlNameEdit.cxx
@@ -48,7 +48,7 @@ namespace dbaui
                     nMatch = i + 1;
                 }
             }
-            _rsCorrected += _sToCheck.copy( nMatch, _sToCheck.getLength() - nMatch );
+            _rsCorrected += _sToCheck.copy( nMatch );
         }
         return bCorrected;
     }
diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
index 7ad2edae340e..b9dfc239f63e 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
@@ -947,7 +947,7 @@ bool OSelectionBrowseBox::SaveModified()
                         { // special case, we have a table field so we must cut the table name
                             OUString sTableAlias = aFieldName.getToken(0,'.');
                             pEntry->SetAlias(sTableAlias);
-                            OUString sColumnName = aFieldName.copy(sTableAlias.getLength()+1,aFieldName.getLength() - sTableAlias.getLength() -1);
+                            OUString sColumnName = aFieldName.copy(sTableAlias.getLength()+1);
                             Reference<XConnection> xConnection = rController.getConnection();
                             if ( !xConnection.is() )
                                 return false;
diff --git a/filter/source/config/cache/querytokenizer.cxx b/filter/source/config/cache/querytokenizer.cxx
index cb2b3744fc2f..a7f5b3e8be1d 100644
--- a/filter/source/config/cache/querytokenizer.cxx
+++ b/filter/source/config/cache/querytokenizer.cxx
@@ -48,7 +48,7 @@ QueryTokenizer::QueryTokenizer(const OUString& sQuery)
             if (equal > 0)
             {
                 sKey = sToken.copy(0      , equal                       );
-                sVal = sToken.copy(equal+1, sToken.getLength()-(equal+1));
+                sVal = sToken.copy(equal+1);
             }
 
             if (find(sKey) != end())
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index c79056f9dbf2..a13589eaea44 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -1337,7 +1337,7 @@ void EscherPropertyContainer::CreateEmbeddedBitmapProperties(
         nIndex += aVndUrl.getLength();
         if( rBitmapUrl.getLength() > nIndex )
         {
-            OString aUniqueId(OUStringToOString(rBitmapUrl.copy(nIndex, rBitmapUrl.getLength() - nIndex), RTL_TEXTENCODING_UTF8));
+            OString aUniqueId(OUStringToOString(rBitmapUrl.copy(nIndex), RTL_TEXTENCODING_UTF8));
             bool bRetValue = ImplCreateEmbeddedBmp( aUniqueId );
             if( bRetValue )
             {
@@ -1540,7 +1540,7 @@ bool EscherPropertyContainer::CreateGraphicProperties(
             {
                 nIndex = nIndex + aVndUrl.getLength();
                 if ( aGraphicUrl.getLength() > nIndex  )
-                    aUniqueId = OUStringToOString(aGraphicUrl.copy(nIndex, aGraphicUrl.getLength() - nIndex), RTL_TEXTENCODING_UTF8);
+                    aUniqueId = OUStringToOString(aGraphicUrl.copy(nIndex), RTL_TEXTENCODING_UTF8);
             }
             else
             {
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index b30a00c2bdce..1b290223458b 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -6998,7 +6998,7 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
                                                         if ( nCount )
                                                         {
                                                             pBefCPS = new PPTCharPropSet( *pSet );
-                                                            pSet->maString = pSet->maString.copy(nCount, pSet->maString.getLength() - nCount);
+                                                            pSet->maString = pSet->maString.copy(nCount);
                                                         }
                                                         sal_uInt32  nIdx = n;
                                                         sal_Int32   nHyperLenLeft = nHyperLen;
diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx
index aca5c0420a47..085a6fc16d32 100644
--- a/forms/source/component/DatabaseForm.cxx
+++ b/forms/source/component/DatabaseForm.cxx
@@ -994,7 +994,7 @@ bool ODatabaseForm::InsertFilePart( INetMIMEMessage& rParent, const OUString& rN
                 pStream = nullptr;
             }
             sal_Int32 nSepInd = aFileName.lastIndexOf('.');
-            OUString aExtension = aFileName.copy( nSepInd + 1, aFileName.getLength() - nSepInd - 1 );
+            OUString aExtension = aFileName.copy( nSepInd + 1 );
             INetContentType eContentType = INetContentTypes::GetContentType4Extension( aExtension );
             if (eContentType != CONTENT_TYPE_UNKNOWN)
                 aContentType = INetContentTypes::GetContentType(eContentType);
diff --git a/lotuswordpro/source/filter/lwpfribmark.cxx b/lotuswordpro/source/filter/lwpfribmark.cxx
index 05f4bc81daea..6c5ce34e8a20 100644
--- a/lotuswordpro/source/filter/lwpfribmark.cxx
+++ b/lotuswordpro/source/filter/lwpfribmark.cxx
@@ -374,7 +374,7 @@ void LwpFribField::RegisterTimeField(LwpFieldMark* pFieldMark)
 
         OUString tag = sFormula.copy(0,index);
         if (tag == "Now()" || tag == "CreateDate" ||  tag == "EditDate")
-            RegisterDateTimeStyle(sFormula.copy(index+1,sFormula.getLength()-index-1));
+            RegisterDateTimeStyle(sFormula.copy(index+1));
     }
 }
 
diff --git a/lotuswordpro/source/filter/lwpmarker.cxx b/lotuswordpro/source/filter/lwpmarker.cxx
index 97ddd200511e..5743daae7ebc 100644
--- a/lotuswordpro/source/filter/lwpmarker.cxx
+++ b/lotuswordpro/source/filter/lwpmarker.cxx
@@ -436,19 +436,19 @@ bool LwpFieldMark::IsDateTimeField(sal_uInt8& type,OUString& formula)
     if (tag == "Now()")
     {
         type = DATETIME_NOW;
-        formula = sFormula.copy(index+1,sFormula.getLength()-index-1);
+        formula = sFormula.copy(index+1);
         return true;
     }
     else if (tag == "CreateDate")
     {
         type = DATETIME_CREATE;
-        formula = sFormula.copy(index+1,sFormula.getLength()-index-1);
+        formula = sFormula.copy(index+1);
         return true;
     }
     else if (tag == "EditDate")
     {
         type = DATETIME_LASTEDIT;
-        formula = sFormula.copy(index+1,sFormula.getLength()-index-1);
+        formula = sFormula.copy(index+1);
         return true;
     }
     else if (tag == "YesterdaysDate" || tag == "TomorrowsDate"
@@ -482,13 +482,13 @@ bool LwpFieldMark::IsCrossRefField(sal_uInt8& nType, OUString& sMarkName)
     OUString tag = sFormula.copy(0,index);
     if (tag == "PageRef")
     {
-        sMarkName = sFormula.copy(index+1,sFormula.getLength()-index-1);
+        sMarkName = sFormula.copy(index+1);
         nType = CROSSREF_PAGE;
         return true;
     }
     else if (tag == "ParaRef")
     {
-        sMarkName = sFormula.copy(index+1,sFormula.getLength()-index-1);
+        sMarkName = sFormula.copy(index+1);
         nType = CROSSREF_PARANUMBER;
         return true;
     }
diff --git a/oox/source/drawingml/customshapepresetdata.cxx b/oox/source/drawingml/customshapepresetdata.cxx
index e2b0a5816236..28257621a314 100644
--- a/oox/source/drawingml/customshapepresetdata.cxx
+++ b/oox/source/drawingml/customshapepresetdata.cxx
@@ -209,7 +209,7 @@ drawing::EnhancedCustomShapeTextFrame lcl_parseEnhancedCustomShapeTextFrame(cons
         }
     }
 
-    OString aToken = rValue.copy(nStart, rValue.getLength() - nStart);
+    OString aToken = rValue.copy(nStart);
     static const char aExpectedPrefix[] = "BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { ";
     if (aToken.startsWith(aExpectedPrefix))
     {
diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx
index d414588f0f1b..71e412a74fe9 100644
--- a/package/source/zippackage/ZipPackage.cxx
+++ b/package/source/zippackage/ZipPackage.cxx
@@ -526,7 +526,7 @@ void ZipPackage::getZipFileContents()
         if ( rName.getLength() -1 != nStreamIndex )
         {
             nStreamIndex++;
-            sTemp = rName.copy( nStreamIndex, rName.getLength() - nStreamIndex );
+            sTemp = rName.copy( nStreamIndex );
             pPkgStream = new ZipPackageStream( *this, m_xContext, m_nFormat, m_bAllowRemoveOnInsert );
             pPkgStream->SetPackageMember( true );
             pPkgStream->setZipEntryOnLoading( rEntry );
@@ -826,7 +826,7 @@ Any SAL_CALL ZipPackage::getByHierarchicalName( const OUString& aName )
         return makeAny ( uno::Reference < XUnoTunnel > ( pCurrent ) );
     }
 
-    sTemp = aName.copy( nOldIndex, aName.getLength() - nOldIndex );
+    sTemp = aName.copy( nOldIndex );
 
     if ( pCurrent->hasByName ( sTemp ) )
     {
@@ -908,7 +908,7 @@ sal_Bool SAL_CALL ZipPackage::hasByHierarchicalName( const OUString& aName )
         }
         else
         {
-            sTemp = aName.copy( nOldIndex, aName.getLength() - nOldIndex );
+            sTemp = aName.copy( nOldIndex );
 
             if ( pCurrent->hasByName( sTemp ) )
             {
diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx
index abed5392dddf..f37e32667841 100644
--- a/reportdesign/source/filter/xml/xmlExport.cxx
+++ b/reportdesign/source/filter/xml/xmlExport.cxx
@@ -1374,7 +1374,7 @@ void ORptExport::exportParagraph(const Reference< XReportControlModel >& _xRepor
         OUString sFieldData = _xReportElement->getDataField();
         static const char s_sPageNumber[] = "PageNumber()";
         static const char s_sReportPrefix[] = "rpt:";
-        sFieldData = sFieldData.copy(strlen(s_sReportPrefix), sFieldData.getLength() - strlen(s_sReportPrefix));
+        sFieldData = sFieldData.copy(strlen(s_sReportPrefix));
         sal_Int32 nPageNumberIndex = sFieldData.indexOf(s_sPageNumber);
         if ( nPageNumberIndex != -1 )
         {
diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx
index 58358c6a6320..75b7899c686b 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -1188,7 +1188,7 @@ void ScHTMLExport::WriteCell( SCCOL nCol, SCROW nRow, SCTAB nTab )
                     nStartPos = nPos + 1;
                 }
                 while( ( nPos = aStrOut.indexOf( '\n', nStartPos ) ) != -1 );
-                OUString aSingleLine = aStrOut.copy( nStartPos, aStrOut.getLength() - nStartPos );
+                OUString aSingleLine = aStrOut.copy( nStartPos );
                 OUT_STR( aSingleLine );
             }
         }
diff --git a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx
index 2aead2a4d511..2e0f479ccb0f 100644
--- a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx
+++ b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx
@@ -758,7 +758,7 @@ void ScXMLChangeTrackingImportHelper::SetNewCell(ScMyContentAction* pAction)
                             }
                             else
                             {
-                                sFormula2 = sFormula.copy( 1, sFormula.getLength() - 1 );
+                                sFormula2 = sFormula.copy( 1 );
                             }
 
                             aNewCell.meType = CELLTYPE_FORMULA;
diff --git a/sd/source/filter/ppt/pptinanimations.cxx b/sd/source/filter/ppt/pptinanimations.cxx
index f25e482895d7..e4039d42cf50 100644
--- a/sd/source/filter/ppt/pptinanimations.cxx
+++ b/sd/source/filter/ppt/pptinanimations.cxx
@@ -1117,7 +1117,7 @@ void AnimationImporter::fillNode( Reference< XAnimationNode >& xNode, const Anim
                     if( nPos >= 0 )
                     {
                         pValues->Time = aToken.copy( 0, nPos ).toDouble();
-                        pValues->Progress = aToken.copy( nPos+1, aToken.getLength() - nPos - 1 ).toDouble();
+                        pValues->Progress = aToken.copy( nPos+1 ).toDouble();
                     }
                     pValues++;
                 }
diff --git a/sdext/source/presenter/PresenterController.cxx b/sdext/source/presenter/PresenterController.cxx
index cc2b17eeab55..26bd1d5f4208 100644
--- a/sdext/source/presenter/PresenterController.cxx
+++ b/sdext/source/presenter/PresenterController.cxx
@@ -382,7 +382,7 @@ void PresenterController::UpdatePaneTitles()
             if (nStartIndex < 0)
             {
                 // Add the remaining part of the string.
-                sResult.append(sTemplate.copy(nIndex, sTemplate.getLength()-nIndex));
+                sResult.append(sTemplate.copy(nIndex));
                 break;
             }
             else
diff --git a/slideshow/source/engine/shapes/shapeimporter.cxx b/slideshow/source/engine/shapes/shapeimporter.cxx
index 1add73896181..918b910a235e 100644
--- a/slideshow/source/engine/shapes/shapeimporter.cxx
+++ b/slideshow/source/engine/shapes/shapeimporter.cxx
@@ -90,8 +90,7 @@ std::unique_ptr<GraphicObject> importShapeGraphic(uno::Reference<beans::XPropert
 
         // unique ID string found in URL, extract
         // to separate string
-        OUString const aUniqueId(
-            aURL.copy( nIndex, aURL.getLength() - nIndex ) );
+        OUString const aUniqueId( aURL.copy( nIndex ) );
 
         // TODO(T2): Creating a GraphicObject is not
         // thread safe (internally calls VCL, and has
diff --git a/stoc/source/security/permissions.cxx b/stoc/source/security/permissions.cxx
index 3ae049c7fead..e332198d194b 100644
--- a/stoc/source/security/permissions.cxx
+++ b/stoc/source/security/permissions.cxx
@@ -157,7 +157,7 @@ SocketPermission::SocketPermission(
         else // A-B
         {
             m_lowerPort = m_host.copy( colon +1, minus - colon -1 ).toInt32();
-            m_upperPort = m_host.copy( minus +1, m_host.getLength() -minus -1 ).toInt32();
+            m_upperPort = m_host.copy( minus +1 ).toInt32();
         }
         m_host = m_host.copy( 0, colon );
     }
diff --git a/svtools/source/control/collatorres.cxx b/svtools/source/control/collatorres.cxx
index 15ea3a6afb1e..5998eb47ffae 100644
--- a/svtools/source/control/collatorres.cxx
+++ b/svtools/source/control/collatorres.cxx
@@ -51,7 +51,7 @@ CollatorResource::GetTranslation(const OUString &r_Algorithm)
     else
     {
         nIndex += 1;
-        aLocaleFreeAlgorithm = r_Algorithm.copy(nIndex, r_Algorithm.getLength() - nIndex);
+        aLocaleFreeAlgorithm = r_Algorithm.copy(nIndex);
     }
 
     for (size_t i = 0; i < m_aData.size(); ++i)
diff --git a/svtools/source/control/indexentryres.cxx b/svtools/source/control/indexentryres.cxx
index cb8d5084de2b..d9040f909b63 100644
--- a/svtools/source/control/indexentryres.cxx
+++ b/svtools/source/control/indexentryres.cxx
@@ -46,7 +46,7 @@ const OUString& IndexEntryResource::GetTranslation(const OUString &r_Algorithm)
         aLocaleFreeAlgorithm = r_Algorithm;
     else {
         nIndex += 1;
-        aLocaleFreeAlgorithm = r_Algorithm.copy(nIndex, r_Algorithm.getLength() - nIndex);
+        aLocaleFreeAlgorithm = r_Algorithm.copy(nIndex);
     }
 
     for (size_t i = 0; i < m_aData.size(); ++i)
diff --git a/svtools/source/svhtml/htmlsupp.cxx b/svtools/source/svhtml/htmlsupp.cxx
index 71709b8cbd04..8b5998648712 100644
--- a/svtools/source/svhtml/htmlsupp.cxx
+++ b/svtools/source/svhtml/htmlsupp.cxx
@@ -83,7 +83,7 @@ void HTMLParser::RemoveSGMLComment( OUString &rString, bool bFull )
     sal_Unicode c = 0;
     while( !rString.isEmpty() &&
            ( ' '==(c=rString[0]) || '\t'==c || '\r'==c || '\n'==c ) )
-        rString = rString.copy( 1, rString.getLength() - 1 );
+        rString = rString.copy( 1 );
 
     while( !rString.isEmpty() &&
            ( ' '==(c=rString[rString.getLength()-1])
@@ -109,7 +109,7 @@ void HTMLParser::RemoveSGMLComment( OUString &rString, bool bFull )
                 nPos = 3;
         }
         ++nPos;
-        rString = rString.copy( nPos, rString.getLength() - nPos );
+        rString = rString.copy( nPos );
     }
 
     if( rString.endsWith("-->") )
diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx
index eb18e3394a5f..47f2077197c3 100644
--- a/svx/source/xml/xmlgrhlp.cxx
+++ b/svx/source/xml/xmlgrhlp.cxx
@@ -819,7 +819,7 @@ OUString SAL_CALL SvXMLGraphicHelper::resolveGraphicObjectURL( const OUString& r
     {
         aURL = rURL.copy( 0, nUser );
         nUser++;
-        aUserData = rURL.copy( nUser, rURL.getLength() - nUser );
+        aUserData = rURL.copy( nUser );
     }
     if ( !aUserData.isEmpty() )
     {
@@ -831,7 +831,7 @@ OUString SAL_CALL SvXMLGraphicHelper::resolveGraphicObjectURL( const OUString& r
             if ( ( n > 0 ) && ( ( n + 1 ) < aToken.getLength() ) )
             {
                 OUString aParam( aToken.copy( 0, n ) );
-                OUString aValue( aToken.copy( n + 1, aToken.getLength() - ( n + 1 ) ) );
+                OUString aValue( aToken.copy( n + 1 ) );
 
                 const OUString sRequestedName( "requestedName" );
                 if ( aParam.match( sRequestedName ) )
diff --git a/sw/source/filter/html/parcss1.cxx b/sw/source/filter/html/parcss1.cxx
index e3c6c44921be..ed043664ab97 100644
--- a/sw/source/filter/html/parcss1.cxx
+++ b/sw/source/filter/html/parcss1.cxx
@@ -1127,7 +1127,7 @@ bool CSS1Parser::ParseStyleSheet( const OUString& rIn )
     sal_Unicode c;
     while( !aTmp.isEmpty() &&
            ( ' '==(c=aTmp[0]) || '\t'==c || '\r'==c || '\n'==c ) )
-        aTmp = aTmp.copy( 1, aTmp.getLength() - 1 );
+        aTmp = aTmp.copy( 1 );
 
     while( !aTmp.isEmpty() && ( ' '==(c=aTmp[aTmp.getLength()-1])
            || '\t'==c || '\r'==c || '\n'==c ) )
@@ -1136,7 +1136,7 @@ bool CSS1Parser::ParseStyleSheet( const OUString& rIn )
     // remove SGML comments
     if( aTmp.getLength() >= 4 &&
         aTmp.startsWith( "<!--" ) )
-        aTmp = aTmp.copy( 4, aTmp.getLength() - 4 );
+        aTmp = aTmp.copy( 4 );
 
     if( aTmp.getLength() >=3 &&
         aTmp.endsWith("-->") )
diff --git a/unotools/source/config/dynamicmenuoptions.cxx b/unotools/source/config/dynamicmenuoptions.cxx
index 4e56fdcb455b..d0ceb86c61ea 100644
--- a/unotools/source/config/dynamicmenuoptions.cxx
+++ b/unotools/source/config/dynamicmenuoptions.cxx
@@ -459,8 +459,8 @@ class CountWithPrefixSort
             // Get order numbers from entry name without prefix.
             // e.g. "m10" => 10
             //      "m5"  => 5
-            sal_Int32 n1 = s1.copy( 1, s1.getLength()-1 ).toInt32();
-            sal_Int32 n2 = s2.copy( 1, s2.getLength()-1 ).toInt32();
+            sal_Int32 n1 = s1.copy( 1 ).toInt32();
+            sal_Int32 n2 = s2.copy( 1 ).toInt32();
             // MUST be in [0,1] ... because it's a difference between
             // insert-positions of given entries in sorted list!
             return( n1<n2 );
diff --git a/unoxml/source/dom/characterdata.cxx b/unoxml/source/dom/characterdata.cxx
index 35466db362f8..e8ac2aee7c23 100644
--- a/unoxml/source/dom/characterdata.cxx
+++ b/unoxml/source/dom/characterdata.cxx
@@ -98,7 +98,7 @@ namespace DOM
                 count = tmp.getLength() - offset;
 
             OUString tmp2 = tmp.copy(0, offset);
-            tmp2 += tmp.copy(offset+count, tmp.getLength() - (offset+count));
+            tmp2 += tmp.copy(offset+count);
             OUString oldValue(reinterpret_cast<char*>(m_aNodePtr->content), strlen(reinterpret_cast<char*>(m_aNodePtr->content)), RTL_TEXTENCODING_UTF8);
             xmlNodeSetContent(m_aNodePtr, reinterpret_cast<const xmlChar*>(OUStringToOString(tmp2, RTL_TEXTENCODING_UTF8).getStr()));
             OUString newValue(reinterpret_cast<char*>(m_aNodePtr->content), strlen(reinterpret_cast<char*>(m_aNodePtr->content)), RTL_TEXTENCODING_UTF8);
@@ -167,7 +167,7 @@ namespace DOM
 
             OUString tmp2 = tmp.copy(0, offset);
             tmp2 += arg;
-            tmp2 += tmp.copy(offset, tmp.getLength() - offset);
+            tmp2 += tmp.copy(offset);
             OUString oldValue(reinterpret_cast<char*>(m_aNodePtr->content), strlen(reinterpret_cast<char*>(m_aNodePtr->content)), RTL_TEXTENCODING_UTF8);
             xmlNodeSetContent(m_aNodePtr, reinterpret_cast<const xmlChar*>(OUStringToOString(tmp2, RTL_TEXTENCODING_UTF8).getStr()));
             OUString newValue(reinterpret_cast<char*>(m_aNodePtr->content), strlen(reinterpret_cast<char*>(m_aNodePtr->content)), RTL_TEXTENCODING_UTF8);
@@ -203,7 +203,7 @@ namespace DOM
 
             OUString tmp2 = tmp.copy(0, offset);
             tmp2 += arg;
-            tmp2 += tmp.copy(offset+count, tmp.getLength() - (offset+count));
+            tmp2 += tmp.copy(offset+count);
             OUString oldValue(reinterpret_cast<char*>(m_aNodePtr->content), strlen(reinterpret_cast<char*>(m_aNodePtr->content)), RTL_TEXTENCODING_UTF8);
             xmlNodeSetContent(m_aNodePtr, reinterpret_cast<const xmlChar*>(OUStringToOString(tmp2, RTL_TEXTENCODING_UTF8).getStr()));
             OUString newValue(reinterpret_cast<char*>(m_aNodePtr->content), strlen(reinterpret_cast<char*>(m_aNodePtr->content)), RTL_TEXTENCODING_UTF8);
diff --git a/unoxml/source/dom/document.cxx b/unoxml/source/dom/document.cxx
index 9cba7eec823d..11fe708fe902 100644
--- a/unoxml/source/dom/document.cxx
+++ b/unoxml/source/dom/document.cxx
@@ -457,7 +457,7 @@ namespace DOM
         if (i != -1)
         {
             oPrefix = OUStringToOString(qname.copy(0, i), RTL_TEXTENCODING_UTF8);
-            oName = OUStringToOString(qname.copy(i+1, qname.getLength()-i-1), RTL_TEXTENCODING_UTF8);
+            oName = OUStringToOString(qname.copy(i+1), RTL_TEXTENCODING_UTF8);
         }
         else
         {
@@ -548,7 +548,7 @@ namespace DOM
         if ( i != -1) {
             o1 = OUStringToOString(qname.copy(0, i), RTL_TEXTENCODING_UTF8);
             pPrefix = reinterpret_cast<xmlChar const *>(o1.getStr());
-            o2 = OUStringToOString(qname.copy(i+1, qname.getLength()-i-1), RTL_TEXTENCODING_UTF8);
+            o2 = OUStringToOString(qname.copy(i+1), RTL_TEXTENCODING_UTF8);
             pName = reinterpret_cast<xmlChar const *>(o2.getStr());
         } else {
             // default prefix
diff --git a/winaccessibility/source/UAccCOM/AccEditableText.cxx b/winaccessibility/source/UAccCOM/AccEditableText.cxx
index 5e63597bf937..14eaeea32f61 100644
--- a/winaccessibility/source/UAccCOM/AccEditableText.cxx
+++ b/winaccessibility/source/UAccCOM/AccEditableText.cxx
@@ -244,7 +244,7 @@ STDMETHODIMP CAccEditableText::setAttributes(long startOffset, long endOffset, B
         if(nPos > -1)
         {
             ::rtl::OUString attrName = attr.copy(0, nPos);
-            ::rtl::OUString attrValue = attr.copy(nPos + 1, attr.getLength() - nPos - 1);
+            ::rtl::OUString attrValue = attr.copy(nPos + 1);
             beanSeq[i].Name = attrName;
             get_AnyFromOLECHAR(attrName, attrValue, beanSeq[i].Value);
         }
@@ -444,7 +444,7 @@ void CAccEditableText::get_AnyFromOLECHAR(const ::rtl::OUString &ouName, const :
                 pos = ouValue.indexOf("Height=", pos);
                 if(pos != -1)
                 {
-                    ouSubValue = ouValue.copy(pos + 7, ouValue.getLength() - pos - 7);
+                    ouSubValue = ouValue.copy(pos + 7);
                     lineSpacing.Height = (sal_Int16)ouSubValue.toInt32();
                 }
                 else
diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx
index e5db0423c011..69c76d5ab9ea 100644
--- a/xmloff/source/chart/SchXMLChartContext.cxx
+++ b/xmloff/source/chart/SchXMLChartContext.cxx
@@ -193,7 +193,7 @@ uno::Sequence< sal_Int32 > lcl_getNumberSequenceFromString( const OUString& rStr
     if( nLastPos != 0 &&
         rStr.getLength() > nLastPos )
     {
-        aVec.push_back( rStr.copy( nLastPos, (rStr.getLength() - nLastPos) ).toInt32() );
+        aVec.push_back( rStr.copy( nLastPos ).toInt32() );
     }
 
     const sal_Int32 nVecSize = aVec.size();
diff --git a/xmloff/source/draw/animationimport.cxx b/xmloff/source/draw/animationimport.cxx
index 6393d3e1acce..d99066d71ccc 100644
--- a/xmloff/source/draw/animationimport.cxx
+++ b/xmloff/source/draw/animationimport.cxx
@@ -411,7 +411,7 @@ Any AnimationsImportHelperImpl::convertValue( XMLTokenEnum eAttributeName, const
     {
         ValuePair aPair;
         aPair.First = convertValue( eAttributeName, rValue.copy( 0, nCommaPos ) );
-        aPair.Second = convertValue( eAttributeName, rValue.copy( nCommaPos+1, rValue.getLength() - nCommaPos - 1 ) );
+        aPair.Second = convertValue( eAttributeName, rValue.copy( nCommaPos+1 ) );
         return makeAny( aPair );
     }
     else
@@ -607,7 +607,7 @@ Sequence< TimeFilterPair > AnimationsImportHelperImpl::convertTimeFilter( const
             if( nPos >= 0 )
             {
                 pValues->Time = aToken.copy( 0, nPos ).toDouble();
-                pValues->Progress = aToken.copy( nPos+1, aToken.getLength() - nPos - 1 ).toDouble();
+                pValues->Progress = aToken.copy( nPos+1 ).toDouble();
             }
             pValues++;
         }
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx
index 8a63acc1ca26..1ca5437cdbad 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -2290,10 +2290,10 @@ void XMLShapeExport::ImpExportGraphicObjectShape(
                 {
                     bIsEmbeddedImageWithExistingStreamInPackage = true;
 
-                    OUString sRequestedName( aStreamURL.copy( sPackageURL.getLength(), aStreamURL.getLength() - sPackageURL.getLength() ) );
+                    OUString sRequestedName = aStreamURL.copy( sPackageURL.getLength() );
                     sal_Int32 nLastIndex = sRequestedName.lastIndexOf( '/' ) + 1;
                     if ( ( nLastIndex > 0 ) && ( nLastIndex < sRequestedName.getLength() ) )
-                        sRequestedName = sRequestedName.copy( nLastIndex, sRequestedName.getLength() - nLastIndex );
+                        sRequestedName = sRequestedName.copy( nLastIndex );
                     nLastIndex = sRequestedName.lastIndexOf( '.' );
                     if ( nLastIndex >= 0 )
                         sRequestedName = sRequestedName.copy( 0, nLastIndex );


More information about the Libreoffice-commits mailing list