From e2080e70fe8b085f18e868e46340454720fa94ca Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 18 Jun 2014 12:14:29 +0200 Subject: new compilerplugin returnbyref Find places where we are returning a pointer to something, where we can be returning a reference. e.g. class A { struct X x; public X* getX() { return &x; } } which can be: public X& getX() { return x; } Change-Id: I796fd23fd36a18aedf6e36bc28f8fab4f518c6c7 --- shell/source/sessioninstall/SyncDbusSessionHelper.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'shell') diff --git a/shell/source/sessioninstall/SyncDbusSessionHelper.cxx b/shell/source/sessioninstall/SyncDbusSessionHelper.cxx index c02274dbfb11..42e4f4df9b07 100644 --- a/shell/source/sessioninstall/SyncDbusSessionHelper.cxx +++ b/shell/source/sessioninstall/SyncDbusSessionHelper.cxx @@ -36,7 +36,7 @@ namespace g_error_free(m_pError); throw RuntimeException(sMsg); } - GError** getRef() { return &m_pError; } + GError*& getRef() { return m_pError; } }; static inline GDBusProxy* lcl_GetPackageKitProxy(const OUString& sInterface) { @@ -49,7 +49,7 @@ namespace "/org/freedesktop/PackageKit", reinterpret_cast(sFullInterface.getStr()), NULL, - error.getRef()); + &error.getRef()); if(!proxy) throw RuntimeException("couldnt get a proxy!"); return proxy; @@ -87,7 +87,7 @@ namespace shell { namespace sessioninstall G_DBUS_CALL_FLAGS_NONE, -1, /* timeout */ NULL, /* cancellable */ - error.getRef()); + &error.getRef()); } void SAL_CALL SyncDbusSessionHelper::IsInstalled( const OUString& sPackagename, const OUString& sInteraction, sal_Bool& o_isInstalled ) throw (RuntimeException, std::exception) @@ -104,7 +104,7 @@ namespace shell { namespace sessioninstall G_DBUS_CALL_FLAGS_NONE, -1, /* timeout */ NULL, /* cancellable */ - error.getRef()),GVariantDeleter()); + &error.getRef()),GVariantDeleter()); if(result.get()) o_isInstalled = g_variant_get_boolean(g_variant_get_child_value(result.get(),0)) ? sal_True : sal_False; } -- cgit