Kaydet (Commit) 32423f6f authored tarafından Tor Lillqvist's avatar Tor Lillqvist

WaE: passing [...] by value, rather pass by reference

Change-Id: Ic733f9b5dcb55bb8120c3652a60300914fab04ea
üst 45cfdae9
...@@ -28,7 +28,7 @@ class OOO_DLLPUBLIC_UNOTEST MacrosTest ...@@ -28,7 +28,7 @@ class OOO_DLLPUBLIC_UNOTEST MacrosTest
{ {
public: public:
css::uno::Reference< css::lang::XComponent > loadFromDesktop(const OUString& rURL, const OUString& rDocService = OUString(), 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: protected:
css::uno::Reference< css::frame::XDesktop2> mxDesktop; css::uno::Reference< css::frame::XDesktop2> mxDesktop;
......
...@@ -19,7 +19,7 @@ using namespace css; ...@@ -19,7 +19,7 @@ using namespace css;
namespace unotest { 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()); CPPUNIT_ASSERT_MESSAGE("no desktop", mxDesktop.is());
uno::Reference<frame::XComponentLoader> xLoader = uno::Reference<frame::XComponentLoader>(mxDesktop, uno::UNO_QUERY); 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 ...@@ -39,16 +39,16 @@ uno::Reference<css::lang::XComponent> MacrosTest::loadFromDesktop(const OUString
args[1].State = beans::PropertyState_DIRECT_VALUE; args[1].State = beans::PropertyState_DIRECT_VALUE;
} }
if (extraArgs.getLength() > 0) if (rExtraArgs.getLength() > 0)
{ {
sal_Int32 aSize = args.getLength(); sal_Int32 aSize = args.getLength();
args.realloc(aSize + extraArgs.getLength()); args.realloc(aSize + rExtraArgs.getLength());
for (int i = 0; i < extraArgs.getLength(); i++) for (int i = 0; i < rExtraArgs.getLength(); i++)
{ {
args[aSize + i].Name = extraArgs[i].Name; args[aSize + i].Name = rExtraArgs[i].Name;
args[aSize + i].Handle = extraArgs[i].Handle; args[aSize + i].Handle = rExtraArgs[i].Handle;
args[aSize + i].Value = extraArgs[i].Value; args[aSize + i].Value = rExtraArgs[i].Value;
args[aSize + i].State = extraArgs[i].State; args[aSize + i].State = rExtraArgs[i].State;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment