WaE: passing [...] by value, rather pass by reference
Change-Id: Ic733f9b5dcb55bb8120c3652a60300914fab04ea
This commit is contained in:
@@ -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;
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user