[Libreoffice-commits] core.git: include/unotest unotest/source

Tor Lillqvist tml at collabora.com
Mon Mar 30 06:51:58 PDT 2015


 include/unotest/macros_test.hxx    |    2 +-
 unotest/source/cpp/macros_test.cxx |   16 ++++++++--------
 2 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 32423f6f877397be5d3358cbcba5f105e9715a1f
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon Mar 30 16:51:13 2015 +0300

    WaE: passing [...] by value, rather pass by reference
    
    Change-Id: Ic733f9b5dcb55bb8120c3652a60300914fab04ea

diff --git a/include/unotest/macros_test.hxx b/include/unotest/macros_test.hxx
index ae006fc..6ec5c25 100644
--- a/include/unotest/macros_test.hxx
+++ b/include/unotest/macros_test.hxx
@@ -28,7 +28,7 @@ class OOO_DLLPUBLIC_UNOTEST MacrosTest
 {
 public:
     css::uno::Reference< css::lang::XComponent > loadFromDesktop(const OUString& rURL, const OUString& rDocService = OUString(),
-        css::uno::Sequence<css::beans::PropertyValue> extra_args = css::uno::Sequence<css::beans::PropertyValue>() );
+        const css::uno::Sequence<css::beans::PropertyValue>& rExtra_args = css::uno::Sequence<css::beans::PropertyValue>() );
 
 protected:
     css::uno::Reference< css::frame::XDesktop2> mxDesktop;
diff --git a/unotest/source/cpp/macros_test.cxx b/unotest/source/cpp/macros_test.cxx
index 02b14ba..7dce6ef 100644
--- a/unotest/source/cpp/macros_test.cxx
+++ b/unotest/source/cpp/macros_test.cxx
@@ -19,7 +19,7 @@ using namespace css;
 
 namespace unotest {
 
-uno::Reference<css::lang::XComponent> MacrosTest::loadFromDesktop(const OUString& rURL, const OUString& rDocService, uno::Sequence<beans::PropertyValue> extraArgs)
+uno::Reference<css::lang::XComponent> MacrosTest::loadFromDesktop(const OUString& rURL, const OUString& rDocService, const uno::Sequence<beans::PropertyValue>& rExtraArgs)
 {
     CPPUNIT_ASSERT_MESSAGE("no desktop", mxDesktop.is());
     uno::Reference<frame::XComponentLoader> xLoader = uno::Reference<frame::XComponentLoader>(mxDesktop, uno::UNO_QUERY);
@@ -39,16 +39,16 @@ uno::Reference<css::lang::XComponent> MacrosTest::loadFromDesktop(const OUString
         args[1].State = beans::PropertyState_DIRECT_VALUE;
     }
 
-    if (extraArgs.getLength() > 0)
+    if (rExtraArgs.getLength() > 0)
     {
         sal_Int32 aSize = args.getLength();
-        args.realloc(aSize + extraArgs.getLength());
-        for (int i = 0; i < extraArgs.getLength(); i++)
+        args.realloc(aSize + rExtraArgs.getLength());
+        for (int i = 0; i < rExtraArgs.getLength(); i++)
         {
-            args[aSize + i].Name = extraArgs[i].Name;
-            args[aSize + i].Handle = extraArgs[i].Handle;
-            args[aSize + i].Value = extraArgs[i].Value;
-            args[aSize + i].State = extraArgs[i].State;
+            args[aSize + i].Name = rExtraArgs[i].Name;
+            args[aSize + i].Handle = rExtraArgs[i].Handle;
+            args[aSize + i].Value = rExtraArgs[i].Value;
+            args[aSize + i].State = rExtraArgs[i].State;
         }
     }
 


More information about the Libreoffice-commits mailing list