[Libreoffice-commits] core.git: framework/source

Stephan Bergmann sbergman at redhat.com
Tue Feb 24 08:44:28 PST 2015


 framework/source/services/desktop.cxx |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

New commits:
commit d05c7c6287f76ed023a32ff592ff2e8db05926dc
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Feb 24 17:43:38 2015 +0100

    Less casting
    
    Change-Id: I955d82d8dd7a6092feb1de03c7c6486125f30831

diff --git a/framework/source/services/desktop.cxx b/framework/source/services/desktop.cxx
index d686b75..aabf2fd 100644
--- a/framework/source/services/desktop.cxx
+++ b/framework/source/services/desktop.cxx
@@ -1777,13 +1777,12 @@ namespace {
 struct Instance {
     explicit Instance(
         css::uno::Reference<css::uno::XComponentContext> const & context):
-        instance(static_cast<cppu::OWeakObject *>(new framework::Desktop(context)))
+        instance(new framework::Desktop(context))
     {
-        static_cast<framework::Desktop *>(static_cast<cppu::OWeakObject *>
-                (instance.get()))->constructorInit();
+        instance->constructorInit();
     }
 
-    css::uno::Reference<css::uno::XInterface> instance;
+    rtl::Reference<framework::Desktop> instance;
 };
 
 struct Singleton:
@@ -1798,8 +1797,7 @@ com_sun_star_comp_framework_Desktop_get_implementation(
     css::uno::XComponentContext *context,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    return cppu::acquire(static_cast<cppu::OWeakObject *>(
-                Singleton::get(context).instance.get()));
+    return cppu::acquire(Singleton::get(context).instance.get());
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list