[Libreoffice-commits] core.git: accessibility/inc accessibility/source compilerplugins/clang configmgr/source cppcanvas/source cppuhelper/source dbaccess/source desktop/source drawinglayer/source embeddedobj/source forms/source i18npool/source jvmfwk/source l10ntools/source linguistic/source package/inc package/source pyuno/source sax/qa sax/source scripting/source sdext/source shell/source sot/source starmath/inc starmath/source stoc/source test/source unoidl/source unoxml/source xmlhelp/source

Noel Grandin noel at peralex.com
Mon Mar 17 23:33:22 PDT 2014


 accessibility/inc/accessibility/standard/vclxaccessiblelist.hxx       |    4 
 accessibility/source/standard/vclxaccessiblelist.cxx                  |    4 
 compilerplugins/clang/passstringbyref.cxx                             |   71 ++++++++++
 configmgr/source/writemodfile.cxx                                     |    2 
 cppcanvas/source/inc/implrenderer.hxx                                 |    2 
 cppcanvas/source/mtfrenderer/implrenderer.cxx                         |    2 
 cppuhelper/source/servicemanager.cxx                                  |    2 
 cppuhelper/source/servicemanager.hxx                                  |    2 
 dbaccess/source/ui/querydesign/QueryDesignView.cxx                    |    2 
 desktop/source/app/dispatchwatcher.cxx                                |    6 
 desktop/source/deployment/inc/dp_descriptioninfoset.hxx               |    2 
 desktop/source/deployment/misc/dp_descriptioninfoset.cxx              |    2 
 drawinglayer/source/dumper/EnhancedShapeDumper.cxx                    |    2 
 drawinglayer/source/dumper/EnhancedShapeDumper.hxx                    |    2 
 drawinglayer/source/dumper/XShapeDumper.cxx                           |   48 +++---
 embeddedobj/source/general/docholder.cxx                              |    2 
 forms/source/component/ListBox.cxx                                    |    2 
 forms/source/misc/services.cxx                                        |    2 
 i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx |    2 
 i18npool/source/localedata/localedata.cxx                             |    2 
 jvmfwk/source/elements.hxx                                            |    2 
 l10ntools/source/lngmerge.cxx                                         |    2 
 l10ntools/source/pocheck.cxx                                          |    8 -
 linguistic/source/convdicxml.hxx                                      |    4 
 linguistic/source/hyphdsp.cxx                                         |    2 
 linguistic/source/hyphdsp.hxx                                         |    2 
 package/inc/ZipFile.hxx                                               |    2 
 package/source/xstor/xstorage.cxx                                     |   10 -
 package/source/xstor/xstorage.hxx                                     |   10 -
 package/source/zipapi/ZipFile.cxx                                     |    2 
 pyuno/source/module/pyuno_module.cxx                                  |    4 
 sax/qa/cppunit/parser.cxx                                             |    4 
 sax/source/expatwrap/sax_expat.cxx                                    |    2 
 scripting/source/stringresource/stringresource.hxx                    |    4 
 sdext/source/minimizer/impoptimizer.cxx                               |    2 
 shell/source/sessioninstall/SyncDbusSessionHelper.cxx                 |    2 
 sot/source/unoolestorage/xolesimplestorage.cxx                        |    4 
 sot/source/unoolestorage/xolesimplestorage.hxx                        |    4 
 starmath/inc/ElementsDockingWindow.hxx                                |    4 
 starmath/inc/cursor.hxx                                               |    6 
 starmath/source/ElementsDockingWindow.cxx                             |    4 
 starmath/source/cursor.cxx                                            |    8 -
 stoc/source/inspect/introspection.cxx                                 |    6 
 test/source/sheet/xsheetoutline.cxx                                   |    4 
 unoidl/source/sourceprovider-scanner.hxx                              |    6 
 unoxml/source/events/eventdispatcher.cxx                              |    6 
 unoxml/source/events/eventdispatcher.hxx                              |    6 
 xmlhelp/source/cxxhelp/provider/databases.hxx                         |   12 -
 48 files changed, 183 insertions(+), 112 deletions(-)

New commits:
commit 86a32589e90ee983159fb5b2c6a594428ab7d422
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Mar 6 15:29:08 2014 +0200

    Find places where OUString and OString are passed by value.
    
    It's not very efficient, because we generally end up copying it twice -
    once into the parameter and again into the destination OUString.
    
    So I create a clang plugin that finds such places and generates a
    warning so that we can convert them to pass-by-reference.
    
    Change-Id: I5341a6ea9e3190f4b4c05c42c85595e3dcd83361

diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblelist.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblelist.hxx
index 49a7602..a90d88d 100644
--- a/accessibility/inc/accessibility/standard/vclxaccessiblelist.hxx
+++ b/accessibility/inc/accessibility/standard/vclxaccessiblelist.hxx
@@ -79,7 +79,7 @@ public:
             This string contains the text of the currently selected
             item.  It is used to retrieve the index of that item.
     */
-    void UpdateSelection (OUString sTextOfSelectedItem);
+    void UpdateSelection (const OUString& sTextOfSelectedItem);
 
     // XInterface
     DECLARE_XINTERFACE()
@@ -139,7 +139,7 @@ public:
     sal_Bool    IsInDropDown();
     void        HandleDropOpen();
     virtual void ProcessWindowEvent (const VclWindowEvent& rVclWindowEvent, bool b_IsDropDownList);
-    void UpdateSelection_Acc (::rtl::OUString sTextOfSelectedItem, bool b_IsDropDownList);
+    void UpdateSelection_Acc (const ::rtl::OUString& sTextOfSelectedItem, bool b_IsDropDownList);
     void UpdateSelection_Impl_Acc (bool b_IsDropDownList);
 
     void UpdateFocus_Impl_Acc ( sal_uInt16 nPos, bool b_IsDropDownList) ;
diff --git a/accessibility/source/standard/vclxaccessiblelist.cxx b/accessibility/source/standard/vclxaccessiblelist.cxx
index 2db7e9b..a998032 100644
--- a/accessibility/source/standard/vclxaccessiblelist.cxx
+++ b/accessibility/source/standard/vclxaccessiblelist.cxx
@@ -185,7 +185,7 @@ void VCLXAccessibleList::notifyVisibleStates(sal_Bool _bSetNew )
     }
 }
 
-void VCLXAccessibleList::UpdateSelection_Acc (::rtl::OUString sTextOfSelectedItem, bool b_IsDropDownList)
+void VCLXAccessibleList::UpdateSelection_Acc (const ::rtl::OUString& sTextOfSelectedItem, bool b_IsDropDownList)
 {
     if ( m_aBoxType == COMBOBOX )
     {
@@ -491,7 +491,7 @@ void VCLXAccessibleList::ProcessWindowEvent (const VclWindowEvent& rVclWindowEve
     state of the associated accessibility objects accordingly we exploit the
     fact that the
 */
-void VCLXAccessibleList::UpdateSelection (OUString sTextOfSelectedItem)
+void VCLXAccessibleList::UpdateSelection (const OUString& sTextOfSelectedItem)
 {
     if ( m_aBoxType == COMBOBOX )
     {
diff --git a/compilerplugins/clang/passstringbyref.cxx b/compilerplugins/clang/passstringbyref.cxx
new file mode 100644
index 0000000..6107969
--- /dev/null
+++ b/compilerplugins/clang/passstringbyref.cxx
@@ -0,0 +1,71 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <string>
+
+#include "plugin.hxx"
+
+// Find places where OUString and OString are passed by value.
+// It's not very efficient, because we generally end up copying it twice - once into the parameter and
+// again into the destination OUString.
+// They should rather be passed by reference.
+
+namespace {
+
+class PassStringByRef:
+    public RecursiveASTVisitor<PassStringByRef>, public loplugin::Plugin
+{
+public:
+    explicit PassStringByRef(InstantiationData const & data): Plugin(data) {}
+
+    virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); }
+
+    bool VisitFunctionDecl(const FunctionDecl * decl);
+};
+
+bool PassStringByRef::VisitFunctionDecl(const FunctionDecl * functionDecl) {
+    if (ignoreLocation(functionDecl)) {
+        return true;
+    }
+    // only warn on the definition/prototype of the function,
+    // not on the function implementation
+    if (functionDecl->isThisDeclarationADefinition() && functionDecl->getPreviousDecl() != nullptr) {
+        return true;
+    }
+    unsigned n = functionDecl->getNumParams();
+    for (unsigned i = 0; i != n; ++i) {
+        const ParmVarDecl * pvDecl = functionDecl->getParamDecl(i);
+        QualType t1 { pvDecl->getType() };
+        if (!t1->isClassType()) {
+            continue;
+        }
+        string typeName = t1.getUnqualifiedType().getCanonicalType().getAsString();
+        if (typeName == "class rtl::OUString") {
+            report(
+                DiagnosticsEngine::Warning,
+                "passing OUString by value, rather pass by reference",
+                pvDecl->getSourceRange().getBegin())
+              << pvDecl->getSourceRange();
+        }
+        else if (typeName == "class rtl::OString") {
+            report(
+                DiagnosticsEngine::Warning,
+                "passing OString by value, rather pass by reference",
+                pvDecl->getSourceRange().getBegin())
+              << pvDecl->getSourceRange();
+        }
+    }
+    return true;
+}
+
+loplugin::Plugin::Registration< PassStringByRef > X("passstringbyref");
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/configmgr/source/writemodfile.cxx b/configmgr/source/writemodfile.cxx
index 974398c..b3d7b87 100644
--- a/configmgr/source/writemodfile.cxx
+++ b/configmgr/source/writemodfile.cxx
@@ -138,7 +138,7 @@ void writeValueContent_(oslFileHandle handle, double value) {
     writeData(handle, OString::number(value));
 }
 
-void writeValueContent_(oslFileHandle handle, OUString value) {
+void writeValueContent_(oslFileHandle handle, const OUString& value) {
     writeValueContent(handle, value);
 }
 
diff --git a/cppcanvas/source/inc/implrenderer.hxx b/cppcanvas/source/inc/implrenderer.hxx
index 4f043b9b..55fe6f1 100644
--- a/cppcanvas/source/inc/implrenderer.hxx
+++ b/cppcanvas/source/inc/implrenderer.hxx
@@ -266,7 +266,7 @@ static float GetSwapFloat( SvStream& rSt )
                                        bool                           bSubsettableActions );
 
             void createTextAction( const ::Point&                 rStartPoint,
-                                   const OUString                 rString,
+                                   const OUString&                rString,
                                    int                            nIndex,
                                    int                            nLength,
                                    const sal_Int32*               pCharWidths,
diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx
index 52f5278..4b5935a 100644
--- a/cppcanvas/source/mtfrenderer/implrenderer.cxx
+++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx
@@ -849,7 +849,7 @@ namespace cppcanvas
 
         // create text effects such as shadow/relief/embossed
         void ImplRenderer::createTextAction( const ::Point&                 rStartPoint,
-                                             const OUString                 rString,
+                                             const OUString&                rString,
                                              int                            nIndex,
                                              int                            nLength,
                                              const sal_Int32*               pCharWidths,
diff --git a/cppuhelper/source/servicemanager.cxx b/cppuhelper/source/servicemanager.cxx
index 6a4618c..2ef9dfb 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -1830,7 +1830,7 @@ bool cppuhelper::ServiceManager::removeLegacyFactory(
     return true;
 }
 
-void cppuhelper::ServiceManager::removeImplementation(rtl::OUString name) {
+void cppuhelper::ServiceManager::removeImplementation(const rtl::OUString & name) {
     // The underlying data structures make this function somewhat inefficient,
     // but the assumption is that it is rarely called:
     boost::shared_ptr< Data::Implementation > clear;
diff --git a/cppuhelper/source/servicemanager.hxx b/cppuhelper/source/servicemanager.hxx
index e8446d6..f62fe1d 100644
--- a/cppuhelper/source/servicemanager.hxx
+++ b/cppuhelper/source/servicemanager.hxx
@@ -367,7 +367,7 @@ private:
         css::uno::Reference< css::lang::XServiceInfo > const & factoryInfo,
         bool removeListener);
 
-    void removeImplementation(rtl::OUString name);
+    void removeImplementation(const rtl::OUString & name);
 
     boost::shared_ptr< Data::Implementation > findServiceImplementation(
         css::uno::Reference< css::uno::XComponentContext > const & context,
diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
index a98fa31..90aeac5 100644
--- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
@@ -187,7 +187,7 @@ namespace
     }
     OUString ParseCondition( OQueryController& rController
                                     ,const ::connectivity::OSQLParseNode* pCondition
-                                    ,const OUString _sDecimal
+                                    ,const OUString& _sDecimal
                                     ,const ::com::sun::star::lang::Locale& _rLocale
                                     ,sal_uInt32 _nStartIndex)
     {
diff --git a/desktop/source/app/dispatchwatcher.cxx b/desktop/source/app/dispatchwatcher.cxx
index 7e5f7b9..6067c34 100644
--- a/desktop/source/app/dispatchwatcher.cxx
+++ b/desktop/source/app/dispatchwatcher.cxx
@@ -80,8 +80,8 @@ struct DispatchHolder
     Reference< XDispatch > xDispatch;
 };
 
-static OUString impl_GetFilterFromExt( OUString aUrl, SfxFilterFlags nFlags,
-                                        OUString aAppl )
+static OUString impl_GetFilterFromExt( const OUString& aUrl, SfxFilterFlags nFlags,
+                                        const OUString& aAppl )
 {
     OUString aFilter;
     SfxMedium* pMedium = new SfxMedium( aUrl,
@@ -108,7 +108,7 @@ static OUString impl_GetFilterFromExt( OUString aUrl, SfxFilterFlags nFlags,
     delete pMedium;
     return aFilter;
 }
-static OUString impl_GuessFilter( OUString aUrlIn, OUString aUrlOut )
+static OUString impl_GuessFilter( const OUString& aUrlIn, const OUString& aUrlOut )
 {
     /* aAppl can also be set to Factory like scalc, swriter... */
     OUString aAppl;
diff --git a/desktop/source/deployment/inc/dp_descriptioninfoset.hxx b/desktop/source/deployment/inc/dp_descriptioninfoset.hxx
index 7c5777d..7a232fb 100644
--- a/desktop/source/deployment/inc/dp_descriptioninfoset.hxx
+++ b/desktop/source/deployment/inc/dp_descriptioninfoset.hxx
@@ -265,7 +265,7 @@ private:
     /** Helper method to compare the versions with the current version
      */
     SAL_DLLPRIVATE bool
-        checkBlacklistVersion(OUString currentversion,
+        checkBlacklistVersion(const OUString& currentversion,
                               ::com::sun::star::uno::Sequence< OUString > const & versions) const;
 
     ::com::sun::star::uno::Reference<
diff --git a/desktop/source/deployment/misc/dp_descriptioninfoset.cxx b/desktop/source/deployment/misc/dp_descriptioninfoset.cxx
index 67b6d8e..8b2cbf6 100644
--- a/desktop/source/deployment/misc/dp_descriptioninfoset.cxx
+++ b/desktop/source/deployment/misc/dp_descriptioninfoset.cxx
@@ -454,7 +454,7 @@ void DescriptionInfoset::checkBlacklist() const
 }
 
 bool DescriptionInfoset::checkBlacklistVersion(
-    OUString currentversion,
+    const OUString& currentversion,
     ::com::sun::star::uno::Sequence< OUString > const & versions) const
 {
     sal_Int32 nLen = versions.getLength();
diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx
index 75f8e4e..20eb99d 100644
--- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx
+++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx
@@ -429,7 +429,7 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeGeometryService(uno::Reference<
             dumpHandlesAsElement(aHandles);
     }
 }
-void EnhancedShapeDumper::dumpTypeAsAttribute(OUString sType)
+void EnhancedShapeDumper::dumpTypeAsAttribute(const OUString& sType)
 {
     xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("type"), "%s",
         OUStringToOString(sType, RTL_TEXTENCODING_UTF8).getStr());
diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.hxx b/drawinglayer/source/dumper/EnhancedShapeDumper.hxx
index bb5564a..523d053 100644
--- a/drawinglayer/source/dumper/EnhancedShapeDumper.hxx
+++ b/drawinglayer/source/dumper/EnhancedShapeDumper.hxx
@@ -75,7 +75,7 @@ public:
 
     // EnhancedCustomShapeGeometry.idl
     void dumpEnhancedCustomShapeGeometryService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet);
-    void dumpTypeAsAttribute(OUString sType);
+    void dumpTypeAsAttribute(const OUString& sType);
     void dumpViewBoxAsElement(com::sun::star::awt::Rectangle aViewBox);
     void dumpMirroredXAsAttribute(sal_Bool bMirroredX); // also used in EnhancedCustomShapeHandle
     void dumpMirroredYAsAttribute(sal_Bool bMirroredY); // also used in EnhancedCustomShapeHandle
diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx
index 7a7d598..61eca8c 100644
--- a/drawinglayer/source/dumper/XShapeDumper.cxx
+++ b/drawinglayer/source/dumper/XShapeDumper.cxx
@@ -43,14 +43,14 @@ void dumpPropertyValueAsElement(const beans::PropertyValue& rPropertyValue, xmlT
 void dumpFillStyleAsAttribute(com::sun::star::drawing::FillStyle eFillStyle, xmlTextWriterPtr xmlWriter);
 void dumpFillColorAsAttribute(sal_Int32 aColor, xmlTextWriterPtr xmlWriter);
 void dumpFillTransparenceAsAttribute(sal_Int32 aTransparence, xmlTextWriterPtr xmlWriter);
-void dumpFillTransparenceGradientNameAsAttribute(OUString sTranspGradName, xmlTextWriterPtr xmlWriter);
+void dumpFillTransparenceGradientNameAsAttribute(const OUString& sTranspGradName, xmlTextWriterPtr xmlWriter);
 void dumpFillTransparenceGradientAsElement(com::sun::star::awt::Gradient aTranspGrad, xmlTextWriterPtr xmlWriter);
-void dumpFillGradientNameAsAttribute(OUString sGradName, xmlTextWriterPtr xmlWriter);
+void dumpFillGradientNameAsAttribute(const OUString& sGradName, xmlTextWriterPtr xmlWriter);
 void dumpFillGradientAsElement(com::sun::star::awt::Gradient aGradient, xmlTextWriterPtr xmlWriter);
 void dumpFillHatchAsElement(com::sun::star::drawing::Hatch aHatch, xmlTextWriterPtr xmlWriter);
 void dumpFillBackgroundAsAttribute(sal_Bool bBackground, xmlTextWriterPtr xmlWriter);
 void dumpFillBitmapAsElement(com::sun::star::uno::Reference<com::sun::star::awt::XBitmap> xBitmap, xmlTextWriterPtr xmlWriter);
-void dumpFillBitmapURLAsAttribute(OUString sBitmapURL, xmlTextWriterPtr xmlWriter);
+void dumpFillBitmapURLAsAttribute(const OUString& sBitmapURL, xmlTextWriterPtr xmlWriter);
 void dumpFillBitmapPositionOffsetXAsAttribute(sal_Int32 aBitmapPositionOffsetX, xmlTextWriterPtr xmlWriter);
 void dumpFillBitmapPositionOffsetYAsAttribute(sal_Int32 aBitmapPositionOffsetY, xmlTextWriterPtr xmlWriter);
 void dumpFillBitmapOffsetXAsAttribute(sal_Int32 aBitmapOffsetX, xmlTextWriterPtr xmlWriter);
@@ -66,13 +66,13 @@ void dumpFillBitmapTileAsAttribute(sal_Bool bBitmapTile, xmlTextWriterPtr xmlWri
 // LineProperties.idl
 void dumpLineStyleAsAttribute(com::sun::star::drawing::LineStyle eLineStyle, xmlTextWriterPtr xmlWriter);
 void dumpLineDashAsElement(com::sun::star::drawing::LineDash aLineDash, xmlTextWriterPtr xmlWriter);
-void dumpLineDashNameAsAttribute(OUString sLineDashName, xmlTextWriterPtr xmlWriter);
+void dumpLineDashNameAsAttribute(const OUString& sLineDashName, xmlTextWriterPtr xmlWriter);
 void dumpLineColorAsAttribute(sal_Int32 aLineColor, xmlTextWriterPtr xmlWriter);
 void dumpLineTransparenceAsAttribute(sal_Int32 aLineTransparence, xmlTextWriterPtr xmlWriter);
 void dumpLineWidthAsAttribute(sal_Int32 aLineWidth, xmlTextWriterPtr xmlWriter);
 void dumpLineJointAsAttribute(com::sun::star::drawing::LineJoint eLineJoint, xmlTextWriterPtr xmlWriter);
-void dumpLineStartNameAsAttribute(OUString sLineStartName, xmlTextWriterPtr xmlWriter);
-void dumpLineEndNameAsAttribute(OUString sLineEndName, xmlTextWriterPtr xmlWriter);
+void dumpLineStartNameAsAttribute(const OUString& sLineStartName, xmlTextWriterPtr xmlWriter);
+void dumpLineEndNameAsAttribute(const OUString& sLineEndName, xmlTextWriterPtr xmlWriter);
 void dumpLineStartAsElement(com::sun::star::drawing::PolyPolygonBezierCoords aLineStart, xmlTextWriterPtr xmlWriter);
 void dumpLineEndAsElement(com::sun::star::drawing::PolyPolygonBezierCoords aLineEnd, xmlTextWriterPtr xmlWriter);
 void dumpLineStartCenterAsAttribute(sal_Bool bLineStartCenter, xmlTextWriterPtr xmlWriter);
@@ -124,23 +124,23 @@ void dumpShadowYDistanceAsAttribute(sal_Int32 aShadowYDistance, xmlTextWriterPtr
 //Shape.idl
 void dumpZOrderAsAttribute(sal_Int32 aZOrder, xmlTextWriterPtr xmlWriter);
 void dumpLayerIDAsAttribute(sal_Int32 aLayerID, xmlTextWriterPtr xmlWriter);
-void dumpLayerNameAsAttribute(OUString sLayerName, xmlTextWriterPtr xmlWriter);
+void dumpLayerNameAsAttribute(const OUString& sLayerName, xmlTextWriterPtr xmlWriter);
 void dumpVisibleAsAttribute(sal_Bool bVisible, xmlTextWriterPtr xmlWriter);
 void dumpPrintableAsAttribute(sal_Bool bPrintable, xmlTextWriterPtr xmlWriter);
 void dumpMoveProtectAsAttribute(sal_Bool bMoveProtect, xmlTextWriterPtr xmlWriter);
-void dumpNameAsAttribute(OUString sName, xmlTextWriterPtr xmlWriter);
+void dumpNameAsAttribute(const OUString& sName, xmlTextWriterPtr xmlWriter);
 void dumpSizeProtectAsAttribute(sal_Bool bSizeProtect, xmlTextWriterPtr xmlWriter);
 void dumpHomogenMatrixLine3(com::sun::star::drawing::HomogenMatrixLine3 aLine, xmlTextWriterPtr xmlWriter);
 void dumpTransformationAsElement(com::sun::star::drawing::HomogenMatrix3 aTransformation, xmlTextWriterPtr xmlWriter);
 void dumpNavigationOrderAsAttribute(sal_Int32 aNavigationOrder, xmlTextWriterPtr xmlWriter);
-void dumpHyperlinkAsAttribute(OUString sHyperlink, xmlTextWriterPtr xmlWriter);
+void dumpHyperlinkAsAttribute(const OUString& sHyperlink, xmlTextWriterPtr xmlWriter);
 void dumpInteropGrabBagAsElement(uno::Sequence< beans::PropertyValue> aInteropGrabBag, xmlTextWriterPtr xmlWriter);
 
 // CustomShape.idl
-void dumpCustomShapeEngineAsAttribute(OUString sCustomShapeEngine, xmlTextWriterPtr xmlWriter);
-void dumpCustomShapeDataAsAttribute(OUString sCustomShapeData, xmlTextWriterPtr xmlWriter);
+void dumpCustomShapeEngineAsAttribute(const OUString& sCustomShapeEngine, xmlTextWriterPtr xmlWriter);
+void dumpCustomShapeDataAsAttribute(const OUString& sCustomShapeData, xmlTextWriterPtr xmlWriter);
 void dumpCustomShapeGeometryAsElement(com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue> aCustomShapeGeometry, xmlTextWriterPtr xmlWriter);
-void dumpCustomShapeReplacementURLAsAttribute(OUString sCustomShapeReplacementURL, xmlTextWriterPtr xmlWriter);
+void dumpCustomShapeReplacementURLAsAttribute(const OUString& sCustomShapeReplacementURL, xmlTextWriterPtr xmlWriter);
 
 // XShape.idl
 void dumpPositionAsAttribute(const com::sun::star::awt::Point& rPoint, xmlTextWriterPtr xmlWriter);
@@ -211,7 +211,7 @@ void dumpFillTransparenceAsAttribute(sal_Int32 aTransparence, xmlTextWriterPtr x
     xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillTransparence"), "%" SAL_PRIdINT32, aTransparence);
 }
 
-void dumpFillTransparenceGradientNameAsAttribute(OUString sTranspGradName, xmlTextWriterPtr xmlWriter)
+void dumpFillTransparenceGradientNameAsAttribute(const OUString& sTranspGradName, xmlTextWriterPtr xmlWriter)
 {
     xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillTransparenceGradientName"), "%s",
         OUStringToOString(sTranspGradName, RTL_TEXTENCODING_UTF8).getStr());
@@ -261,7 +261,7 @@ void dumpFillTransparenceGradientAsElement(awt::Gradient aTranspGrad, xmlTextWri
     xmlTextWriterEndElement( xmlWriter );
 }
 
-void dumpFillGradientNameAsAttribute(OUString sGradName, xmlTextWriterPtr xmlWriter)
+void dumpFillGradientNameAsAttribute(const OUString& sGradName, xmlTextWriterPtr xmlWriter)
 {
     xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillGradientName"), "%s",
         OUStringToOString(sGradName, RTL_TEXTENCODING_UTF8).getStr());
@@ -317,7 +317,7 @@ void dumpFillBitmapAsElement(uno::Reference<awt::XBitmap> xBitmap, xmlTextWriter
     xmlTextWriterEndElement( xmlWriter );
 }
 
-void dumpFillBitmapURLAsAttribute(OUString sBitmapURL, xmlTextWriterPtr xmlWriter)
+void dumpFillBitmapURLAsAttribute(const OUString& sBitmapURL, xmlTextWriterPtr xmlWriter)
 {
     xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillBitmapURL"), "%s",
         OUStringToOString(sBitmapURL, RTL_TEXTENCODING_UTF8).getStr());
@@ -481,7 +481,7 @@ void dumpLineDashAsElement(drawing::LineDash aLineDash, xmlTextWriterPtr xmlWrit
     xmlTextWriterEndElement( xmlWriter );
 }
 
-void dumpLineDashNameAsAttribute(OUString sLineDashName, xmlTextWriterPtr xmlWriter)
+void dumpLineDashNameAsAttribute(const OUString& sLineDashName, xmlTextWriterPtr xmlWriter)
 {
     xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineDashName"), "%s",
         OUStringToOString(sLineDashName, RTL_TEXTENCODING_UTF8).getStr());
@@ -526,13 +526,13 @@ void dumpLineJointAsAttribute(drawing::LineJoint eLineJoint, xmlTextWriterPtr xm
     }
 }
 
-void dumpLineStartNameAsAttribute(OUString sLineStartName, xmlTextWriterPtr xmlWriter)
+void dumpLineStartNameAsAttribute(const OUString& sLineStartName, xmlTextWriterPtr xmlWriter)
 {
     xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineStartName"), "%s",
     OUStringToOString(sLineStartName, RTL_TEXTENCODING_UTF8).getStr());
 }
 
-void dumpLineEndNameAsAttribute(OUString sLineEndName, xmlTextWriterPtr xmlWriter)
+void dumpLineEndNameAsAttribute(const OUString& sLineEndName, xmlTextWriterPtr xmlWriter)
 {
     xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineEndName"), "%s",
     OUStringToOString(sLineEndName, RTL_TEXTENCODING_UTF8).getStr());
@@ -977,7 +977,7 @@ void dumpLayerIDAsAttribute(sal_Int32 aLayerID, xmlTextWriterPtr xmlWriter)
     xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("layerID"), "%" SAL_PRIdINT32, aLayerID);
 }
 
-void dumpLayerNameAsAttribute(OUString sLayerName, xmlTextWriterPtr xmlWriter)
+void dumpLayerNameAsAttribute(const OUString& sLayerName, xmlTextWriterPtr xmlWriter)
 {
     xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("layerName"), "%s",
         OUStringToOString(sLayerName, RTL_TEXTENCODING_UTF8).getStr());
@@ -1007,7 +1007,7 @@ void dumpMoveProtectAsAttribute(sal_Bool bMoveProtect, xmlTextWriterPtr xmlWrite
         xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("moveProtect"), "%s", "false");
 }
 
-void dumpNameAsAttribute(OUString sName, xmlTextWriterPtr xmlWriter)
+void dumpNameAsAttribute(const OUString& sName, xmlTextWriterPtr xmlWriter)
 {
     if(!sName.isEmpty() && !m_bNameDumped)
     {
@@ -1053,7 +1053,7 @@ void dumpNavigationOrderAsAttribute(sal_Int32 aNavigationOrder, xmlTextWriterPtr
     xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("navigationOrder"), "%" SAL_PRIdINT32, aNavigationOrder);
 }
 
-void dumpHyperlinkAsAttribute(OUString sHyperlink, xmlTextWriterPtr xmlWriter)
+void dumpHyperlinkAsAttribute(const OUString& sHyperlink, xmlTextWriterPtr xmlWriter)
 {
     xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("hyperlink"), "%s",
         OUStringToOString(sHyperlink, RTL_TEXTENCODING_UTF8).getStr());
@@ -1096,13 +1096,13 @@ void dumpShapeDescriptorAsAttribute( uno::Reference< drawing::XShapeDescriptor >
 // ---------- CustomShape.idl ----------
 
 
-void dumpCustomShapeEngineAsAttribute(OUString sCustomShapeEngine, xmlTextWriterPtr xmlWriter)
+void dumpCustomShapeEngineAsAttribute(const OUString& sCustomShapeEngine, xmlTextWriterPtr xmlWriter)
 {
     xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("customShapeEngine"), "%s",
         OUStringToOString(sCustomShapeEngine, RTL_TEXTENCODING_UTF8).getStr());
 }
 
-void dumpCustomShapeDataAsAttribute(OUString sCustomShapeData, xmlTextWriterPtr xmlWriter)
+void dumpCustomShapeDataAsAttribute(const OUString& sCustomShapeData, xmlTextWriterPtr xmlWriter)
 {
     xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("customShapeData"), "%s",
         OUStringToOString(sCustomShapeData, RTL_TEXTENCODING_UTF8).getStr());
@@ -1208,7 +1208,7 @@ void dumpCustomShapeGeometryAsElement(uno::Sequence< beans::PropertyValue> aCust
     xmlTextWriterEndElement( xmlWriter );
 }
 
-void dumpCustomShapeReplacementURLAsAttribute(OUString sCustomShapeReplacementURL, xmlTextWriterPtr xmlWriter)
+void dumpCustomShapeReplacementURLAsAttribute(const OUString& sCustomShapeReplacementURL, xmlTextWriterPtr xmlWriter)
 {
     xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("customShapeReplacementURL"), "%s",
         OUStringToOString(sCustomShapeReplacementURL, RTL_TEXTENCODING_UTF8).getStr());
diff --git a/embeddedobj/source/general/docholder.cxx b/embeddedobj/source/general/docholder.cxx
index a970979..dcb99a1 100644
--- a/embeddedobj/source/general/docholder.cxx
+++ b/embeddedobj/source/general/docholder.cxx
@@ -102,7 +102,7 @@ static void InsertMenu_Impl( const uno::Reference< container::XIndexContainer >&
                             sal_Int32 nTargetIndex,
                             const uno::Reference< container::XIndexAccess >& xSourceMenu,
                             sal_Int32 nSourceIndex,
-                            const OUString aContModuleName,
+                            const OUString& aContModuleName,
                             const uno::Reference< frame::XDispatchProvider >& xSourceDisp )
 {
     sal_Int32 nInd = 0;
diff --git a/forms/source/component/ListBox.cxx b/forms/source/component/ListBox.cxx
index c103c65..12fba62 100644
--- a/forms/source/component/ListBox.cxx
+++ b/forms/source/component/ListBox.cxx
@@ -100,7 +100,7 @@ namespace frm
             {
             }
 
-            void operator()( const OUString _append )
+            void operator()( const OUString& _append )
             {
                 m_string += _append;
             }
diff --git a/forms/source/misc/services.cxx b/forms/source/misc/services.cxx
index 4b7416c..2228bc0 100644
--- a/forms/source/misc/services.cxx
+++ b/forms/source/misc/services.cxx
@@ -99,7 +99,7 @@ static Sequence<sal_Int64>                              s_aFactories;
 
 
 void registerClassInfo(
-        OUString _rClassImplName,                                // the ImplName of the class
+        const OUString& _rClassImplName,                                // the ImplName of the class
         const Sequence< OUString >& _rServiceNames,      // the services supported by this class
         ::cppu::ComponentInstantiation _pCreateFunction                 // the method for instantiating such a class
         )
diff --git a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
index e58afe7..8a110c0 100644
--- a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
+++ b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
@@ -521,7 +521,7 @@ void lcl_formatCharsGR(const sal_Unicode table[], int n, OUString& s )
 }
 
 static
-bool should_ignore( OUString s )
+bool should_ignore( const OUString& s )
 {
         // return true if blank or null
         return s == " " || (!s.isEmpty() && s[0]==0);
diff --git a/i18npool/source/localedata/localedata.cxx b/i18npool/source/localedata/localedata.cxx
index b9748c7..a45bab1 100644
--- a/i18npool/source/localedata/localedata.cxx
+++ b/i18npool/source/localedata/localedata.cxx
@@ -1383,7 +1383,7 @@ public:
     virtual sal_Bool SAL_CALL hasElements(  ) throw(RuntimeException, std::exception);
 };
 
-static sal_Char* U2C( OUString str )
+static sal_Char* U2C( const OUString& str )
 {
     sal_Char* s = new sal_Char[ str.getLength()+1 ];
     int i;
diff --git a/jvmfwk/source/elements.hxx b/jvmfwk/source/elements.hxx
index f716fe4..d3f0dfa 100644
--- a/jvmfwk/source/elements.hxx
+++ b/jvmfwk/source/elements.hxx
@@ -358,7 +358,7 @@ struct PluginLibrary
     PluginLibrary()
     {
     }
-    PluginLibrary(OUString vendor,OUString path) :
+    PluginLibrary(const OUString & vendor, const OUString & path) :
         sVendor(vendor), sPath(path)
     {
     }
diff --git a/l10ntools/source/lngmerge.cxx b/l10ntools/source/lngmerge.cxx
index 2e3a4d6..1ab50ac 100644
--- a/l10ntools/source/lngmerge.cxx
+++ b/l10ntools/source/lngmerge.cxx
@@ -29,7 +29,7 @@
 
 namespace {
 
-OString getBracketedContent(OString text) {
+OString getBracketedContent(const OString& text) {
     return text.getToken(1, '[').getToken(0, ']');
 }
 
diff --git a/l10ntools/source/pocheck.cxx b/l10ntools/source/pocheck.cxx
index 6043156..c7c6164 100644
--- a/l10ntools/source/pocheck.cxx
+++ b/l10ntools/source/pocheck.cxx
@@ -17,7 +17,7 @@
 #include "po.hxx"
 
 // Translated style names must be unique
-static void checkStyleNames(OString aLanguage)
+static void checkStyleNames(const OString& aLanguage)
 {
     std::map<OString,sal_uInt16> aLocalizedStyleNames;
     std::map<OString,sal_uInt16> aLocalizedNumStyleNames;
@@ -130,7 +130,7 @@ static void checkStyleNames(OString aLanguage)
 }
 
 // Translated spreadsheet function names must be unique
-static void checkFunctionNames(OString aLanguage)
+static void checkFunctionNames(const OString& aLanguage)
 {
     std::map<OString,sal_uInt16> aLocalizedFunctionNames;
     std::map<OString,sal_uInt16> aLocalizedCoreFunctionNames;
@@ -352,7 +352,7 @@ static void checkFunctionNames(OString aLanguage)
 // In instsetoo_native/inc_openoffice/windows/msi_languages.po
 // where an en-US string ends with '|', translation must end
 // with '|', too.
-static void checkVerticalBar(OString aLanguage)
+static void checkVerticalBar(const OString& aLanguage)
 {
     OString aPoPath = OString(getenv("SRC_ROOT")) +
                       "/translations/source/" +
@@ -400,7 +400,7 @@ static void checkVerticalBar(OString aLanguage)
 
 // In starmath/source.po Math symbol names (from symbol.src)
 // must not contain spaces
-static void checkMathSymbolNames(OString aLanguage)
+static void checkMathSymbolNames(const OString& aLanguage)
 {
     OString aPoPath = OString(getenv("SRC_ROOT")) +
                       "/translations/source/" +
diff --git a/linguistic/source/convdicxml.hxx b/linguistic/source/convdicxml.hxx
index a11a50e..de5fada 100644
--- a/linguistic/source/convdicxml.hxx
+++ b/linguistic/source/convdicxml.hxx
@@ -76,14 +76,14 @@ class ConvDicXMLImport : public SvXMLImport
                                 //   but the language and conversion type will
                                 //   still be determined!
 
-    sal_Int16           nLanguage;          // language of the dictionary
+    sal_Int16       nLanguage;          // language of the dictionary
     sal_Int16       nConversionType;    // conversion type the dictionary is used for
     sal_Bool        bSuccess;
 
 public:
 
     //!!  see comment for pDic member
-    ConvDicXMLImport( ConvDic *pConvDic, const OUString /*&rFileName*/ ) :
+    ConvDicXMLImport( ConvDic *pConvDic, const OUString& /*&rFileName*/ ) :
         SvXMLImport ( comphelper::getProcessComponentContext(), "com.sun.star.lingu2.ConvDicXMLImport", IMPORT_ALL ),
         pDic        ( pConvDic )
     {
diff --git a/linguistic/source/hyphdsp.cxx b/linguistic/source/hyphdsp.cxx
index f877061..3202c78 100644
--- a/linguistic/source/hyphdsp.cxx
+++ b/linguistic/source/hyphdsp.cxx
@@ -65,7 +65,7 @@ void HyphenatorDispatcher::ClearSvcList()
 
 
 Reference<XHyphenatedWord>  HyphenatorDispatcher::buildHyphWord(
-            const OUString rOrigWord,
+            const OUString& rOrigWord,
             const Reference<XDictionaryEntry> &xEntry,
             sal_Int16 nLang, sal_Int16 nMaxLeading )
 {
diff --git a/linguistic/source/hyphdsp.hxx b/linguistic/source/hyphdsp.hxx
index fdcfcbf..4b6fdd6 100644
--- a/linguistic/source/hyphdsp.hxx
+++ b/linguistic/source/hyphdsp.hxx
@@ -75,7 +75,7 @@ class HyphenatorDispatcher :
 
     com::sun::star::uno::Reference<
         ::com::sun::star::linguistic2::XHyphenatedWord>
-            buildHyphWord( const OUString rOrigWord,
+            buildHyphWord( const OUString& rOrigWord,
                 const ::com::sun::star::uno::Reference<
                     ::com::sun::star::linguistic2::XDictionaryEntry> &xEntry,
                 sal_Int16 nLang, sal_Int16 nMaxLeading );
diff --git a/package/inc/ZipFile.hxx b/package/inc/ZipFile.hxx
index c3dd7a1..be3c32c 100644
--- a/package/inc/ZipFile.hxx
+++ b/package/inc/ZipFile.hxx
@@ -87,7 +87,7 @@ protected:
             const ::rtl::Reference < EncryptionData > &rData,
             sal_Int8 nStreamMode,
             sal_Bool bDecrypt,
-            OUString aMediaType = OUString() );
+            const OUString& aMediaType = OUString() );
 
     sal_Bool hasValidPassword ( ZipEntry & rEntry, const rtl::Reference < EncryptionData > &rData );
 
diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx
index 1c00a5d..c3a6212 100644
--- a/package/source/xstor/xstorage.cxx
+++ b/package/source/xstor/xstorage.cxx
@@ -776,7 +776,7 @@ void OStorage_Impl::CopyToStorage( const uno::Reference< embed::XStorage >& xDes
 
 void OStorage_Impl::CopyStorageElement( SotElement_Impl* pElement,
                                         uno::Reference< embed::XStorage > xDest,
-                                        OUString aName,
+                                        const OUString& aName,
                                         sal_Bool bDirect )
 {
     SAL_WARN_IF( !xDest.is(), "package.xstor", "No destination storage!" );
@@ -1384,7 +1384,7 @@ SotElement_Impl* OStorage_Impl::FindElement( const OUString& rName )
     return NULL;
 }
 
-SotElement_Impl* OStorage_Impl::InsertStream( OUString aName, sal_Bool bEncr )
+SotElement_Impl* OStorage_Impl::InsertStream( const OUString& aName, sal_Bool bEncr )
 {
     SAL_WARN_IF( !m_xPackage.is(), "package.xstor", "Not possible to refer to package as to factory!" );
     if ( !m_xPackage.is() )
@@ -1418,7 +1418,7 @@ SotElement_Impl* OStorage_Impl::InsertStream( OUString aName, sal_Bool bEncr )
     return pNewElement;
 }
 
-SotElement_Impl* OStorage_Impl::InsertRawStream( OUString aName, const uno::Reference< io::XInputStream >& xInStream )
+SotElement_Impl* OStorage_Impl::InsertRawStream( const OUString& aName, const uno::Reference< io::XInputStream >& xInStream )
 {
     // insert of raw stream means insert and commit
     SAL_WARN_IF( !m_xPackage.is(), "package.xstor", "Not possible to refer to package as to factory!" );
@@ -1486,7 +1486,7 @@ OStorage_Impl* OStorage_Impl::CreateNewStorageImpl( sal_Int32 nStorageMode )
     return pResult;
 }
 
-SotElement_Impl* OStorage_Impl::InsertStorage( OUString aName, sal_Int32 nStorageMode )
+SotElement_Impl* OStorage_Impl::InsertStorage( const OUString& aName, sal_Int32 nStorageMode )
 {
     SotElement_Impl* pNewElement = InsertElement( aName, sal_True );
 
@@ -1497,7 +1497,7 @@ SotElement_Impl* OStorage_Impl::InsertStorage( OUString aName, sal_Int32 nStorag
     return pNewElement;
 }
 
-SotElement_Impl* OStorage_Impl::InsertElement( OUString aName, sal_Bool bIsStorage )
+SotElement_Impl* OStorage_Impl::InsertElement( const OUString& aName, sal_Bool bIsStorage )
 {
     OSL_ENSURE( FindElement( aName ) == NULL, "Should not try to insert existing element" );
 
diff --git a/package/source/xstor/xstorage.hxx b/package/source/xstor/xstorage.hxx
index 53883be..3e968e2 100644
--- a/package/source/xstor/xstorage.hxx
+++ b/package/source/xstor/xstorage.hxx
@@ -232,19 +232,19 @@ struct OStorage_Impl
                         sal_Bool bDirect );
     void CopyStorageElement( SotElement_Impl* pElement,
                             ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > xDest,
-                            OUString aName,
+                            const OUString& aName,
                             sal_Bool bDirect );
 
     void SetModified( sal_Bool bModified );
 
     SotElement_Impl* FindElement( const OUString& rName );
 
-    SotElement_Impl* InsertStream( OUString aName, sal_Bool bEncr );
-    SotElement_Impl* InsertRawStream( OUString aName, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInStream );
+    SotElement_Impl* InsertStream( const OUString& aName, sal_Bool bEncr );
+    SotElement_Impl* InsertRawStream( const OUString& aName, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInStream );
 
     OStorage_Impl* CreateNewStorageImpl( sal_Int32 nStorageMode );
-    SotElement_Impl* InsertStorage( OUString aName, sal_Int32 nStorageMode );
-    SotElement_Impl* InsertElement( OUString aName, sal_Bool bIsStorage );
+    SotElement_Impl* InsertStorage( const OUString& aName, sal_Int32 nStorageMode );
+    SotElement_Impl* InsertElement( const OUString& aName, sal_Bool bIsStorage );
 
     void OpenSubStorage( SotElement_Impl* pElement, sal_Int32 nStorageMode );
     void OpenSubStream( SotElement_Impl* pElement );
diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx
index 76ff293..7255185 100644
--- a/package/source/zipapi/ZipFile.cxx
+++ b/package/source/zipapi/ZipFile.cxx
@@ -518,7 +518,7 @@ uno::Reference< XInputStream > ZipFile::createUnbufferedStream(
             const ::rtl::Reference< EncryptionData > &rData,
             sal_Int8 nStreamMode,
             sal_Bool bIsEncrypted,
-            OUString aMediaType )
+            const OUString& aMediaType )
 {
     ::osl::MutexGuard aGuard( m_aMutex );
 
diff --git a/pyuno/source/module/pyuno_module.cxx b/pyuno/source/module/pyuno_module.cxx
index 5513f0e..47b57aa 100644
--- a/pyuno/source/module/pyuno_module.cxx
+++ b/pyuno/source/module/pyuno_module.cxx
@@ -106,7 +106,7 @@ public:
     {
         PyDict_SetItem(used, key, Py_True);
     }
-    void setInitialised(OUString key, sal_Int32 pos = -1)
+    void setInitialised(const OUString& key, sal_Int32 pos = -1)
     {
         if (initialised[key])
         {
@@ -126,7 +126,7 @@ public:
         if ( pos >= 0 )
             ++nPosConsumed;
     }
-    bool isInitialised(OUString key)
+    bool isInitialised(const OUString& key)
     {
         return initialised[key];
     }
diff --git a/sax/qa/cppunit/parser.cxx b/sax/qa/cppunit/parser.cxx
index 5ee1613..74ab76a 100644
--- a/sax/qa/cppunit/parser.cxx
+++ b/sax/qa/cppunit/parser.cxx
@@ -39,7 +39,7 @@ public:
     CPPUNIT_TEST_SUITE_END();
 
 private:
-    uno::Reference< io::XInputStream > createStream(OString sInput);
+    uno::Reference< io::XInputStream > createStream(const OString& sInput);
 };
 
 void ParserTest::setUp()
@@ -55,7 +55,7 @@ void ParserTest::tearDown()
     test::BootstrapFixture::tearDown();
 }
 
-uno::Reference< io::XInputStream > ParserTest::createStream(OString sInput)
+uno::Reference< io::XInputStream > ParserTest::createStream(const OString& sInput)
 {
     uno::Reference< io::XOutputStream > xPipe( io::Pipe::create(m_xContext) );
     uno::Reference< io::XInputStream > xInStream( xPipe, uno::UNO_QUERY );
diff --git a/sax/source/expatwrap/sax_expat.cxx b/sax/source/expatwrap/sax_expat.cxx
index a262d2a..fb3445b 100644
--- a/sax/source/expatwrap/sax_expat.cxx
+++ b/sax/source/expatwrap/sax_expat.cxx
@@ -614,7 +614,7 @@ css::uno::Sequence< OUString > SaxExpatParser::getSupportedServiceNames(void) th
 *
 *
 *-------------------------------------------*/
-OUString getErrorMessage( XML_Error xmlE, OUString sSystemId , sal_Int32 nLine )
+OUString getErrorMessage( XML_Error xmlE, const OUString& sSystemId , sal_Int32 nLine )
 {
     OUString Message;
     if( XML_ERROR_NONE == xmlE ) {
diff --git a/scripting/source/stringresource/stringresource.hxx b/scripting/source/stringresource/stringresource.hxx
index 0e7309e..87e4732 100644
--- a/scripting/source/stringresource/stringresource.hxx
+++ b/scripting/source/stringresource/stringresource.hxx
@@ -55,7 +55,7 @@ namespace stringresource
 // Hashtable to map string ids to string
 struct hashName_Impl
 {
-    size_t operator()(const OUString Str) const
+    size_t operator()(const OUString& Str) const
     {
         return (size_t)Str.hashCode();
     }
@@ -63,7 +63,7 @@ struct hashName_Impl
 
 struct eqName_Impl
 {
-    sal_Bool operator()(const OUString Str1, const OUString Str2) const
+    sal_Bool operator()(const OUString& Str1, const OUString& Str2) const
     {
         return ( Str1 == Str2 );
     }
diff --git a/sdext/source/minimizer/impoptimizer.cxx b/sdext/source/minimizer/impoptimizer.cxx
index c2eceef..f3fa1ee 100644
--- a/sdext/source/minimizer/impoptimizer.cxx
+++ b/sdext/source/minimizer/impoptimizer.cxx
@@ -576,7 +576,7 @@ sal_Bool ImpOptimizer::Optimize()
     return sal_True;
 }
 
-static void DispatchURL( Reference< XComponentContext > xContext, OUString sURL, Reference< XFrame > xFrame )
+static void DispatchURL( Reference< XComponentContext > xContext, const OUString& sURL, Reference< XFrame > xFrame )
 {
     try
     {
diff --git a/shell/source/sessioninstall/SyncDbusSessionHelper.cxx b/shell/source/sessioninstall/SyncDbusSessionHelper.cxx
index 3d4e3fa..ce13c33 100644
--- a/shell/source/sessioninstall/SyncDbusSessionHelper.cxx
+++ b/shell/source/sessioninstall/SyncDbusSessionHelper.cxx
@@ -38,7 +38,7 @@ namespace
             }
             GError** getRef() { return &m_pError; }
     };
-    static inline GDBusProxy* lcl_GetPackageKitProxy(const OUString sInterface)
+    static inline GDBusProxy* lcl_GetPackageKitProxy(const OUString& sInterface)
     {
         const OString sFullInterface = OUStringToOString("org.freedesktop.PackageKit." + sInterface, RTL_TEXTENCODING_ASCII_US);
         GErrorWrapper error(NULL);
diff --git a/sot/source/unoolestorage/xolesimplestorage.cxx b/sot/source/unoolestorage/xolesimplestorage.cxx
index 90887e4..12fcd50 100644
--- a/sot/source/unoolestorage/xolesimplestorage.cxx
+++ b/sot/source/unoolestorage/xolesimplestorage.cxx
@@ -120,7 +120,7 @@ void OLESimpleStorage::UpdateOriginal_Impl()
 }
 
 
-void OLESimpleStorage::InsertInputStreamToStorage_Impl( BaseStorage* pStorage, OUString aName, const uno::Reference< io::XInputStream >& xInputStream )
+void OLESimpleStorage::InsertInputStreamToStorage_Impl( BaseStorage* pStorage, const OUString & aName, const uno::Reference< io::XInputStream >& xInputStream )
     throw ( uno::Exception )
 {
     if ( !pStorage || aName.isEmpty() || !xInputStream.is() )
@@ -165,7 +165,7 @@ void OLESimpleStorage::InsertInputStreamToStorage_Impl( BaseStorage* pStorage, O
 }
 
 
-void OLESimpleStorage::InsertNameAccessToStorage_Impl( BaseStorage* pStorage, OUString aName, const uno::Reference< container::XNameAccess >& xNameAccess )
+void OLESimpleStorage::InsertNameAccessToStorage_Impl( BaseStorage* pStorage, const OUString & aName, const uno::Reference< container::XNameAccess >& xNameAccess )
     throw ( uno::Exception )
 {
     if ( !pStorage || aName.isEmpty() || !xNameAccess.is() )
diff --git a/sot/source/unoolestorage/xolesimplestorage.hxx b/sot/source/unoolestorage/xolesimplestorage.hxx
index ecd718c..c9777c3 100644
--- a/sot/source/unoolestorage/xolesimplestorage.hxx
+++ b/sot/source/unoolestorage/xolesimplestorage.hxx
@@ -59,10 +59,10 @@ class OLESimpleStorage  : public ::cppu::WeakImplHelper3
 
     void UpdateOriginal_Impl();
 
-    static void InsertInputStreamToStorage_Impl( BaseStorage* pStorage, OUString aName, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInputStream )
+    static void InsertInputStreamToStorage_Impl( BaseStorage* pStorage, const OUString & aName, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInputStream )
     throw ( ::com::sun::star::uno::Exception );
 
-    static void InsertNameAccessToStorage_Impl( BaseStorage* pStorage, OUString aName, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& xNameAccess )
+    static void InsertNameAccessToStorage_Impl( BaseStorage* pStorage, const OUString & aName, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& xNameAccess )
     throw ( ::com::sun::star::uno::Exception );
 
 public:
diff --git a/starmath/inc/ElementsDockingWindow.hxx b/starmath/inc/ElementsDockingWindow.hxx
index a5985d3..ccd9d7c 100644
--- a/starmath/inc/ElementsDockingWindow.hxx
+++ b/starmath/inc/ElementsDockingWindow.hxx
@@ -34,7 +34,7 @@ public:
     Point mBoxLocation;
     Size  mBoxSize;
 
-    SmElement(SmNodePointer pNode, OUString aText, OUString aHelpText);
+    SmElement(SmNodePointer pNode, const OUString& aText, const OUString& aHelpText);
     virtual ~SmElement();
 
     SmNodePointer getNode();
@@ -96,7 +96,7 @@ class SmElementsControl : public Control
     Size          maMaxElementDimensions;
     bool          mbVerticalMode;
 
-    void addElement(OUString aElementVisual, OUString aElementSource, OUString aHelpText);
+    void addElement(const OUString& aElementVisual, const OUString& aElementSource, const OUString& aHelpText);
 
     void addElements(const sal_uInt16 aElementsArray[][2], sal_uInt16 size);
 
diff --git a/starmath/inc/cursor.hxx b/starmath/inc/cursor.hxx
index b1f6e8b..ca3527d 100644
--- a/starmath/inc/cursor.hxx
+++ b/starmath/inc/cursor.hxx
@@ -121,7 +121,7 @@ public:
     void DeletePrev(OutputDevice* pDev);
 
     /** Insert text at the current position */
-    void InsertText(OUString aString);
+    void InsertText(const OUString& aString);
 
     /** Insert an element into the formula */
     void InsertElement(SmFormulaElement element);
@@ -137,7 +137,7 @@ public:
      * This will work for stuff like "A intersection B". But stuff spaning multiple lines
      * or dependent on the context which position is placed in will not work!
      */
-    void InsertCommandText(OUString aCommandText);
+    void InsertCommandText(const OUString& aCommandText);
 
     /** Insert a special node created from aString
      *
@@ -148,7 +148,7 @@ public:
      * For more complex expressions use InsertCommandText, this method doesn't
      * use SmParser, this means that it's faster, but not as strong.
      */
-    void InsertSpecial(OUString aString);
+    void InsertSpecial(const OUString& aString);
 
     /** Create sub-/super script
      *
diff --git a/starmath/source/ElementsDockingWindow.cxx b/starmath/source/ElementsDockingWindow.cxx
index aaaba71..d5e2772 100644
--- a/starmath/source/ElementsDockingWindow.cxx
+++ b/starmath/source/ElementsDockingWindow.cxx
@@ -31,7 +31,7 @@
 SV_DECL_REF(SmDocShell)
 SV_IMPL_REF(SmDocShell)
 
-SmElement::SmElement(SmNodePointer pNode, OUString aText, OUString aHelpText) :
+SmElement::SmElement(SmNodePointer pNode, const OUString& aText, const OUString& aHelpText) :
     mpNode(pNode),
     maText(aText),
     maHelpText(aHelpText)
@@ -397,7 +397,7 @@ void SmElementsControl::addSeparator()
     maElementList.push_back(pElement);
 }
 
-void SmElementsControl::addElement(OUString aElementVisual, OUString aElementSource, OUString aHelpText)
+void SmElementsControl::addElement(const OUString& aElementVisual, const OUString& aElementSource, const OUString& aHelpText)
 {
     SmNodePointer pNode(SmParser().ParseExpression(aElementVisual));
 
diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx
index 4c770d0..6704c2a 100644
--- a/starmath/source/cursor.cxx
+++ b/starmath/source/cursor.cxx
@@ -963,7 +963,7 @@ void SmCursor::InsertFraction() {
     FinishEdit(pLineList, pLineParent, nParentIndex, SmCaretPos(pSelectedNode, 1));
 }
 
-void SmCursor::InsertText(OUString aString)
+void SmCursor::InsertText(const OUString& aString)
 {
     BeginEdit();
 
@@ -1092,12 +1092,12 @@ void SmCursor::InsertElement(SmFormulaElement element){
     EndEdit();
 }
 
-void SmCursor::InsertSpecial(OUString aString)
+void SmCursor::InsertSpecial(const OUString& _aString)
 {
     BeginEdit();
     Delete();
 
-    aString = comphelper::string::strip(aString, ' ');
+    OUString aString = comphelper::string::strip(_aString, ' ');
 
     //Create instance of special node
     SmToken token;
@@ -1140,7 +1140,7 @@ void SmCursor::InsertCommand(sal_uInt16 nCommand) {
     }
 }
 
-void SmCursor::InsertCommandText(OUString aCommandText) {
+void SmCursor::InsertCommandText(const OUString& aCommandText) {
     //Parse the sub expression
     SmNode* pSubExpr = SmParser().ParseExpression(aCommandText);
 
diff --git a/stoc/source/inspect/introspection.cxx b/stoc/source/inspect/introspection.cxx
index 09dc11ba..6361044 100644
--- a/stoc/source/inspect/introspection.cxx
+++ b/stoc/source/inspect/introspection.cxx
@@ -137,7 +137,7 @@ sal_Bool isDerivedFrom( Reference<XIdlClass> xToTestClass, Reference<XIdlClass>
 // Hashtable for the search of names
 struct hashName_Impl
 {
-    size_t operator()(const OUString Str) const
+    size_t operator()(const OUString& Str) const
     {
         return (size_t)Str.hashCode();
     }
@@ -145,7 +145,7 @@ struct hashName_Impl
 
 struct eqName_Impl
 {
-    sal_Bool operator()(const OUString Str1, const OUString Str2) const
+    sal_Bool operator()(const OUString& Str1, const OUString& Str2) const
     {
         return ( Str1 == Str2 );
     }
@@ -1411,7 +1411,7 @@ Any ImplIntrospectionAccess::getMaterial(void) throw(RuntimeException, std::exce
 }
 
 // Hilfs-Funktion zur LowerCase-Wandlung eines OUString
-OUString toLower( OUString aUStr )
+OUString toLower( const OUString& aUStr )
 {
     // Tabelle fuer XExactName pflegen
     OUString aOWStr( aUStr.getStr() );
diff --git a/test/source/sheet/xsheetoutline.cxx b/test/source/sheet/xsheetoutline.cxx
index 3275448..6c734ef 100644
--- a/test/source/sheet/xsheetoutline.cxx
+++ b/test/source/sheet/xsheetoutline.cxx
@@ -39,7 +39,7 @@ const OUString rowLevel4 = "OutlineSheet.A7:A21";
 
 uno::Reference< sheet::XSpreadsheet > aSheetGlobal;
 
-OUString getVisibleAdress(OUString aLevelRangeString)
+OUString getVisibleAdress(const OUString& aLevelRangeString)
 {
 
     uno::Reference<table::XCellRange> aSheetRangeAccess(aSheetGlobal, UNO_QUERY_THROW);
@@ -53,7 +53,7 @@ OUString getVisibleAdress(OUString aLevelRangeString)
 
 }
 
-table::CellRangeAddress getAddressFromRangeString(OUString aStringAddress)
+table::CellRangeAddress getAddressFromRangeString(const OUString& aStringAddress)
 {
 
     uno::Reference< table::XCellRange > aSheetRangeAccess(aSheetGlobal, UNO_QUERY_THROW);
diff --git a/unoidl/source/sourceprovider-scanner.hxx b/unoidl/source/sourceprovider-scanner.hxx
index 14ac154..614340e 100644
--- a/unoidl/source/sourceprovider-scanner.hxx
+++ b/unoidl/source/sourceprovider-scanner.hxx
@@ -58,7 +58,7 @@ private:
 class SourceProviderPlainStructTypeEntityPad: public SourceProviderEntityPad {
 public:
     SourceProviderPlainStructTypeEntityPad(
-        bool published, OUString theBaseName,
+        bool published, const OUString & theBaseName,
         rtl::Reference<unoidl::PlainStructTypeEntity> const & theBaseEntity):
         SourceProviderEntityPad(published), baseName(theBaseName),
         baseEntity(theBaseEntity)
@@ -90,7 +90,7 @@ private:
 class SourceProviderExceptionTypeEntityPad: public SourceProviderEntityPad {
 public:
     SourceProviderExceptionTypeEntityPad(
-        bool published, OUString theBaseName,
+        bool published, const OUString & theBaseName,
         rtl::Reference<unoidl::ExceptionTypeEntity> const & theBaseEntity):
         SourceProviderEntityPad(published), baseName(theBaseName),
         baseEntity(theBaseEntity)
@@ -128,7 +128,7 @@ public:
         OUString mandatory;
         std::set<OUString> optional;
 
-        explicit Member(OUString theMandatory): mandatory(theMandatory) {}
+        explicit Member(const OUString & theMandatory): mandatory(theMandatory) {}
     };
 
     SourceProviderInterfaceTypeEntityPad(bool published, bool theSingleBase):
diff --git a/unoxml/source/events/eventdispatcher.cxx b/unoxml/source/events/eventdispatcher.cxx
index f159e47..1b155aa 100644
--- a/unoxml/source/events/eventdispatcher.cxx
+++ b/unoxml/source/events/eventdispatcher.cxx
@@ -29,7 +29,7 @@
 
 namespace DOM { namespace events {
 
-    void CEventDispatcher::addListener(xmlNodePtr pNode, OUString aType, const Reference<XEventListener>& aListener, sal_Bool bCapture)
+    void CEventDispatcher::addListener(xmlNodePtr pNode, const OUString& aType, const Reference<XEventListener>& aListener, sal_Bool bCapture)
     {
         TypeListenerMap *const pTMap = (bCapture)
             ? (& m_CaptureListeners) : (& m_TargetListeners);
@@ -48,7 +48,7 @@ namespace DOM { namespace events {
             pMap->insert(ListenerMap::value_type(pNode, aListener));
     }
 
-    void CEventDispatcher::removeListener(xmlNodePtr pNode, OUString aType, const Reference<XEventListener>& aListener, sal_Bool bCapture)
+    void CEventDispatcher::removeListener(xmlNodePtr pNode, const OUString& aType, const Reference<XEventListener>& aListener, sal_Bool bCapture)
     {
         TypeListenerMap *const pTMap = (bCapture)
             ? (& m_CaptureListeners) : (& m_TargetListeners);
@@ -87,7 +87,7 @@ namespace DOM { namespace events {
     void CEventDispatcher::callListeners(
             TypeListenerMap const& rTMap,
             xmlNodePtr const pNode,
-            OUString aType, Reference< XEvent > const& xEvent)
+            const OUString& aType, Reference< XEvent > const& xEvent)
     {
         // get the multimap for the specified type
         TypeListenerMap::const_iterator tIter = rTMap.find(aType);
diff --git a/unoxml/source/events/eventdispatcher.hxx b/unoxml/source/events/eventdispatcher.hxx
index b6259f4..b5541bf 100644
--- a/unoxml/source/events/eventdispatcher.hxx
+++ b/unoxml/source/events/eventdispatcher.hxx
@@ -57,20 +57,20 @@ private:
 public:
     void addListener(
         xmlNodePtr pNode,
-        OUString aType,
+        const OUString& aType,
         const Reference<com::sun::star::xml::dom::events::XEventListener>& aListener,
         sal_Bool bCapture);
 
     void removeListener(
         xmlNodePtr pNode,
-        OUString aType,
+        const OUString& aType,
         const Reference<com::sun::star::xml::dom::events::XEventListener>& aListener,
         sal_Bool bCapture);
 
     static void callListeners(
         TypeListenerMap const& rTMap,
         xmlNodePtr const pNode,
-        OUString aType,
+        const OUString& aType,
         const Reference< XEvent >& xEvent);
 
     bool dispatchEvent(
diff --git a/xmlhelp/source/cxxhelp/provider/databases.hxx b/xmlhelp/source/cxxhelp/provider/databases.hxx
index abd924b..82d9d1d 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.hxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.hxx
@@ -68,12 +68,12 @@ namespace chelp {
 
     public:
 
-        StaticModuleInformation( OUString aTitle,
-                                 OUString aStartId,
-                                 OUString aProgramSwitch,
-                                 OUString aHeading,
-                                 OUString aFulltext,
-                                 OUString aOrder )
+        StaticModuleInformation( const OUString& aTitle,
+                                 const OUString& aStartId,
+                                 const OUString& aProgramSwitch,
+                                 const OUString& aHeading,
+                                 const OUString& aFulltext,
+                                 const OUString& aOrder )
             : m_aStartId( aStartId ),
               m_aProgramSwitch( aProgramSwitch ),
               m_aTitle( aTitle ),


More information about the Libreoffice-commits mailing list