[Libreoffice-commits] core.git: dbaccess/source filter/source framework/source oox/source scripting/source sw/source xmloff/source

Noel Grandin noel.grandin at collabora.co.uk
Tue Jul 11 19:42:53 UTC 2017


 dbaccess/source/core/dataaccess/databasedocument.cxx |    4 +--
 filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx  |    4 ---
 framework/source/fwe/xml/menudocumenthandler.cxx     |    2 -
 framework/source/fwe/xml/toolboxdocumenthandler.cxx  |    2 -
 oox/source/drawingml/hyperlinkcontext.cxx            |    3 --
 scripting/source/basprov/basprov.cxx                 |    5 +---
 scripting/source/provider/MasterScriptProvider.cxx   |   23 ++++++-------------
 scripting/source/provider/URIHelper.cxx              |    3 --
 scripting/source/stringresource/stringresource.cxx   |    8 +-----
 scripting/source/vbaevents/eventhelper.cxx           |    4 ---
 sw/source/filter/ww8/ww8par.cxx                      |    5 +---
 sw/source/ui/vba/vbaheaderfooter.cxx                 |    2 -
 xmloff/source/draw/shapeexport.cxx                   |    7 ++---
 13 files changed, 26 insertions(+), 46 deletions(-)

New commits:
commit f9b104abc1185d4f9f3af66f49ec9e39f85a1c36
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Jul 11 13:49:02 2017 +0200

    simplify some OUString::concat usage
    
    Change-Id: Ifa150dc9d694981ffe03c254ea8c3fd820c99795
    Reviewed-on: https://gerrit.libreoffice.org/39812
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx
index 958e6b7498fc..cadc240f1ffe 100644
--- a/dbaccess/source/core/dataaccess/databasedocument.cxx
+++ b/dbaccess/source/core/dataaccess/databasedocument.cxx
@@ -372,8 +372,8 @@ void lcl_uglyHackToStoreDialogeEmbedImages( const Reference< XStorageBasedLibrar
             for ( sal_Int32 j=0; j < nDialogs; ++j )
             {
                 Reference < awt::XDialogProvider > xDlgPrv = awt::DialogProvider::createWithModel(rxContext, rxModel);
-                OUString sDialogUrl = "vnd.sun.star.script:";
-                sDialogUrl = sDialogUrl.concat( sLibraries[ i ] ).concat( "." ).concat (  sDialogs[ j ]  ).concat( "?location=document" );
+                OUString sDialogUrl =
+                    "vnd.sun.star.script:" + sLibraries[i] + "." + sDialogs[j] + "?location=document";
 
                 Reference< css::awt::XControl > xDialog( xDlgPrv->createDialog( sDialogUrl ), UNO_QUERY );
                 Reference< XInterface > xModel( xDialog->getModel() );
diff --git a/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx b/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx
index 84277d3b95c0..03a3b2bc746b 100644
--- a/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx
+++ b/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx
@@ -134,9 +134,7 @@ bool SAL_CALL XmlFilterAdaptor::importImpl( const Sequence< css::beans::Property
             if(!comphelper::isFileUrl(msTemplateName))
             {
                 SvtPathOptions aOptions;
-                OUString PathString = aOptions.SubstituteVariable("$(progurl)");
-                PathString = PathString.concat("/");
-                msTemplateName=PathString.concat(msTemplateName);
+                msTemplateName = aOptions.SubstituteVariable("$(progurl)") + "/" + msTemplateName;
             }
 
             xstyleLoader->loadStylesFromURL(msTemplateName,aValue);
diff --git a/framework/source/fwe/xml/menudocumenthandler.cxx b/framework/source/fwe/xml/menudocumenthandler.cxx
index a7d8bd0e1acf..d6bff96e3155 100644
--- a/framework/source/fwe/xml/menudocumenthandler.cxx
+++ b/framework/source/fwe/xml/menudocumenthandler.cxx
@@ -872,7 +872,7 @@ void OWriteMenuDocumentHandler::WriteMenuItem( const OUString& aCommandURL, cons
             if ( nStyle & pStyle->nBit )
             {
                 if ( !aValue.isEmpty() )
-                    aValue = aValue.concat( "+" );
+                    aValue += "+";
                 aValue += OUString::createFromAscii( pStyle->attrName );
             }
         }
diff --git a/framework/source/fwe/xml/toolboxdocumenthandler.cxx b/framework/source/fwe/xml/toolboxdocumenthandler.cxx
index 21f2d53ccc5d..633a057c574a 100644
--- a/framework/source/fwe/xml/toolboxdocumenthandler.cxx
+++ b/framework/source/fwe/xml/toolboxdocumenthandler.cxx
@@ -719,7 +719,7 @@ void OWriteToolBoxDocumentHandler::WriteToolBoxItem(
             if ( nStyle & pStyle->nBit )
             {
                 if ( !aValue.isEmpty() )
-                    aValue = aValue.concat( " " );
+                    aValue += " ";
                 aValue += OUString::createFromAscii( pStyle->attrName );
             }
         }
diff --git a/oox/source/drawingml/hyperlinkcontext.cxx b/oox/source/drawingml/hyperlinkcontext.cxx
index 055e1cfb7785..99cca512831c 100644
--- a/oox/source/drawingml/hyperlinkcontext.cxx
+++ b/oox/source/drawingml/hyperlinkcontext.cxx
@@ -94,8 +94,7 @@ HyperLinkContext::HyperLinkContext( ContextHandler2Helper& rParent,
                 if ( aPPAct.match( sJump, nIndex + 1 ) )
                 {
                     OUString aDestination( aPPAct.copy( nIndex + 1 + sJump.getLength() ) );
-                    sURL = sURL.concat( "#action?jump=" );
-                    sURL = sURL.concat( aDestination );
+                    sURL += "#action?jump=" + aDestination;
                 }
             }
             else if ( aPPAction.match( sHlinksldjump ) )
diff --git a/scripting/source/basprov/basprov.cxx b/scripting/source/basprov/basprov.cxx
index 4fac2f9cbb51..28cc4a48714a 100644
--- a/scripting/source/basprov/basprov.cxx
+++ b/scripting/source/basprov/basprov.cxx
@@ -293,10 +293,9 @@ namespace basprov
 
         if ( !uriRef.is() || !sfUri.is() )
         {
-            OUString errorMsg("BasicProviderImpl::getScript: failed to parse URI: ");
-            errorMsg = errorMsg.concat( scriptURI );
             throw provider::ScriptFrameworkErrorException(
-                errorMsg, Reference< XInterface >(),
+                "BasicProviderImpl::getScript: failed to parse URI: " + scriptURI,
+                Reference< XInterface >(),
                 scriptURI, "Basic",
                 provider::ScriptFrameworkErrorType::MALFORMED_URL );
         }
diff --git a/scripting/source/provider/MasterScriptProvider.cxx b/scripting/source/provider/MasterScriptProvider.cxx
index 63a2685c48ee..972097da4fb1 100644
--- a/scripting/source/provider/MasterScriptProvider.cxx
+++ b/scripting/source/provider/MasterScriptProvider.cxx
@@ -197,8 +197,7 @@ void MasterScriptProvider::createPkgProvider()
     try
     {
         Any location;
-        OUString sPkgCtx =  m_sCtxString.concat( ":uno_packages" );
-        location <<= sPkgCtx;
+        location <<= m_sCtxString + ":uno_packages";
 
         Reference< provider::XScriptProviderFactory > xFac =
             provider::theMasterScriptProviderFactory::get( m_xContext );
@@ -237,10 +236,9 @@ MasterScriptProvider::getScript( const OUString& scriptURI )
 
     if ( !uriRef.is() || !sfUri.is() )
     {
-        OUString errorMsg = "Incorrect format for Script URI: ";
-        errorMsg = errorMsg.concat( scriptURI );
         throw provider::ScriptFrameworkErrorException(
-            errorMsg, Reference< XInterface >(),
+            "Incorrect format for Script URI: " + scriptURI,
+            Reference< XInterface >(),
             scriptURI, "",
             provider::ScriptFrameworkErrorType::UNKNOWN );
     }
@@ -252,10 +250,9 @@ MasterScriptProvider::getScript( const OUString& scriptURI )
          !sfUri->hasParameter( locKey ) ||
          ( sfUri->getName().isEmpty()  ) )
     {
-        OUString errorMsg = "Incorrect format for Script URI: ";
-        errorMsg = errorMsg.concat( scriptURI );
         throw provider::ScriptFrameworkErrorException(
-            errorMsg, Reference< XInterface >(),
+            "Incorrect format for Script URI: " + scriptURI,
+            Reference< XInterface >(),
             scriptURI, "",
             provider::ScriptFrameworkErrorType::UNKNOWN );
     }
@@ -519,9 +516,7 @@ MasterScriptProvider::insertByName( const OUString& aName, const Any& aElement )
         if ( index == xSProviders.getLength() )
         {
             // No script providers could process the package
-            OUString message = "Failed to register package for ";
-            message = message.concat( aName );
-            throw lang::IllegalArgumentException( message,
+            throw lang::IllegalArgumentException( "Failed to register package for " + aName,
                 Reference < XInterface > (), 2 );
         }
    }
@@ -585,10 +580,8 @@ MasterScriptProvider::removeByName( const OUString& Name )
         if ( index == xSProviders.getLength() )
         {
             // No script providers could process the package
-            OUString message = "Failed to revoke package for ";
-            message = message.concat( Name );
-            throw lang::IllegalArgumentException( message,
-                                                      Reference < XInterface > (), 1 );
+            throw lang::IllegalArgumentException( "Failed to revoke package for " + Name,
+                                                  Reference < XInterface > (), 1 );
         }
 
     }
diff --git a/scripting/source/provider/URIHelper.cxx b/scripting/source/provider/URIHelper.cxx
index d043d3f0b5de..fb74cba6ab6b 100644
--- a/scripting/source/provider/URIHelper.cxx
+++ b/scripting/source/provider/URIHelper.cxx
@@ -88,8 +88,7 @@ ScriptingFrameworkURIHelper::initialize(
         throw uno::RuntimeException( "ScriptingFrameworkURIHelper error parsing args" );
     }
 
-    SCRIPTS_PART = "/Scripts/";
-    SCRIPTS_PART = SCRIPTS_PART.concat( m_sLanguage.toAsciiLowerCase() );
+    SCRIPTS_PART = "/Scripts/" + m_sLanguage.toAsciiLowerCase();
 
     if ( !initBaseURI() )
     {
diff --git a/scripting/source/stringresource/stringresource.cxx b/scripting/source/stringresource/stringresource.cxx
index 7b27a5751a35..4d328e22d716 100644
--- a/scripting/source/stringresource/stringresource.cxx
+++ b/scripting/source/stringresource/stringresource.cxx
@@ -183,9 +183,7 @@ OUString StringResourceImpl::implResolveString
     }
     if( !bSuccess )
     {
-        OUString errorMsg("StringResourceImpl: No entry for ResourceID: ");
-        errorMsg = errorMsg.concat( ResourceID );
-        throw css::resource::MissingResourceException( errorMsg );
+        throw css::resource::MissingResourceException( "StringResourceImpl: No entry for ResourceID: " + ResourceID );
     }
     return aRetStr;
 }
@@ -413,9 +411,7 @@ void StringResourceImpl::implRemoveId( const OUString& ResourceID, LocaleItem* p
         IdToStringMap::iterator it = rHashMap.find( ResourceID );
         if( it == rHashMap.end() )
         {
-            OUString errorMsg("StringResourceImpl: No entries for ResourceID: ");
-            errorMsg = errorMsg.concat( ResourceID );
-            throw css::resource::MissingResourceException( errorMsg );
+            throw css::resource::MissingResourceException( "StringResourceImpl: No entries for ResourceID: " + ResourceID );
         }
         rHashMap.erase( it );
         pLocaleItem->m_bModified = true;
diff --git a/scripting/source/vbaevents/eventhelper.cxx b/scripting/source/vbaevents/eventhelper.cxx
index e60161a9ea87..e85455f90bb1 100644
--- a/scripting/source/vbaevents/eventhelper.cxx
+++ b/scripting/source/vbaevents/eventhelper.cxx
@@ -872,9 +872,7 @@ EventListener::firing_Impl(const ScriptEvent& evt, Any* pRet )
             sProject = sScriptCode.copy( 0, nIndex );
             sScriptCode = sScriptCode.copy( nIndex + 1 );
         }
-        OUString sMacroLoc = sProject;
-        sMacroLoc = sMacroLoc.concat(  "." );
-        sMacroLoc = sMacroLoc.concat( sScriptCode ).concat( "." );
+        OUString sMacroLoc = sProject + "." + sScriptCode + ".";
 
         for ( ; txInfo != txInfo_end; ++txInfo )
         {
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 68f241eaf240..05fe2f786455 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -302,7 +302,7 @@ void SwWW8ImplReader::ReadEmbeddedData(SvStream& rStrm, SwDocShell* pDocShell, s
     if( !xLongName.get() && xShortName.get() )
     {
         xLongName.reset( new OUString );
-        *xLongName = xLongName->concat(*xShortName);
+        *xLongName += *xShortName;
     }
     else if( !xLongName.get() && xTextMark.get() )
         xLongName.reset( new OUString );
@@ -313,8 +313,7 @@ void SwWW8ImplReader::ReadEmbeddedData(SvStream& rStrm, SwDocShell* pDocShell, s
         {
             if (xLongName->isEmpty())
                 *xTextMark = xTextMark->replace('!', '.');
-            *xLongName = xLongName->concat("#");
-            *xLongName = xLongName->concat(*xTextMark);
+            *xLongName += "#" + *xTextMark;
         }
         hlStr.hLinkAddr = *xLongName;
     }
diff --git a/sw/source/ui/vba/vbaheaderfooter.cxx b/sw/source/ui/vba/vbaheaderfooter.cxx
index 61548d62d521..21bd2debe849 100644
--- a/sw/source/ui/vba/vbaheaderfooter.cxx
+++ b/sw/source/ui/vba/vbaheaderfooter.cxx
@@ -62,7 +62,7 @@ uno::Reference< word::XRange > SAL_CALL SwVbaHeaderFooter::getRange()
     }
     if( mnIndex == word::WdHeaderFooterIndex::wdHeaderFooterEvenPages )
     {
-        sPropsNameText = sPropsNameText.concat( "Left" );
+        sPropsNameText += "Left";
     }
 
     uno::Reference< text::XText > xText( mxPageStyleProps->getPropertyValue( sPropsNameText ), uno::UNO_QUERY_THROW );
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx
index 1ca5437cdbad..bb55ebe0ec9f 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -2299,8 +2299,7 @@ void XMLShapeExport::ImpExportGraphicObjectShape(
                         sRequestedName = sRequestedName.copy( 0, nLastIndex );
                     if ( !sRequestedName.isEmpty() )
                     {
-                        aResolveURL = aResolveURL.concat( "?requestedName=");
-                        aResolveURL = aResolveURL.concat( sRequestedName );
+                        aResolveURL += "?requestedName=" + sRequestedName;
                     }
                 }
 
@@ -2315,11 +2314,11 @@ void XMLShapeExport::ImpExportGraphicObjectShape(
                         aStreamURL = sPackageURL;
                         if ( aStr[0] == '#' )
                         {
-                            aStreamURL = aStreamURL.concat( aStr.copy( 1, aStr.getLength() - 1 ) );
+                            aStreamURL += aStr.copy( 1, aStr.getLength() - 1 );
                         }
                         else
                         {
-                            aStreamURL = aStreamURL.concat( aStr );
+                            aStreamURL += aStr;
                         }
 
                         xPropSet->setPropertyValue( "GraphicStreamURL", uno::Any(aStreamURL) );


More information about the Libreoffice-commits mailing list