diff options
author | Matúš Kukan <matus.kukan@collabora.com> | 2013-12-20 22:41:38 +0100 |
---|---|---|
committer | Matúš Kukan <matus.kukan@collabora.com> | 2013-12-20 22:58:29 +0100 |
commit | 09af884e7b5712e0311a4c122a5213e7c89f626e (patch) | |
tree | f4291ccbae836111fa05ff6404f1b53d1ca94450 /svx/source/sidebar/PanelFactory.cxx | |
parent | be053c9a80ad237afc6da0b4174e1c7afc94ed92 (diff) |
Revert "svx: split into direct implementation getFactories"
Also reverts "These services are in fact implemented in svxcore library."
This reverts commit 090674dcb085cd41f4628e4f07c9a2268a18e862
and commit 4a969ac35174520f1ffeb4f919f5d7bb6d99a628.
This is embarrassing; needs more work.
Diffstat (limited to 'svx/source/sidebar/PanelFactory.cxx')
-rw-r--r-- | svx/source/sidebar/PanelFactory.cxx | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/svx/source/sidebar/PanelFactory.cxx b/svx/source/sidebar/PanelFactory.cxx index 86669834dd6f..693c00f9a02e 100644 --- a/svx/source/sidebar/PanelFactory.cxx +++ b/svx/source/sidebar/PanelFactory.cxx @@ -1,4 +1,3 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * @@ -16,6 +15,7 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include "sidebar/PanelFactory.hxx" #include "text/TextPropertyPanel.hxx" #include "paragraph/ParaPropertyPanel.hxx" @@ -37,57 +37,69 @@ #include <vcl/window.hxx> #include <rtl/ref.hxx> #include <comphelper/namedvaluecollection.hxx> -#include <cppuhelper/basemutex.hxx> -#include <cppuhelper/compbase1.hxx> #include <com/sun/star/ui/XSidebar.hpp> -#include <com/sun/star/ui/XUIElementFactory.hpp> #include <boost/bind.hpp> -#include <boost/noncopyable.hpp> -namespace cssu = ::com::sun::star::uno; + using namespace css; using namespace cssu; -using namespace svx::sidebar; +using ::rtl::OUString; + + +namespace svx { namespace sidebar { -/* Why this is not used ? Doesn't it need to inherit from XServiceInfo ? #define IMPLEMENTATION_NAME "org.apache.openoffice.comp.svx.sidebar.PanelFactory" #define SERVICE_NAME "com.sun.star.ui.UIElementFactory" -*/ -namespace { -typedef ::cppu::WeakComponentImplHelper1 < - css::ui::XUIElementFactory > PanelFactoryInterfaceBase; +::rtl::OUString SAL_CALL PanelFactory::getImplementationName (void) +{ + return OUString(IMPLEMENTATION_NAME); +} + + + + +cssu::Reference<cssu::XInterface> SAL_CALL PanelFactory::createInstance ( + const uno::Reference<lang::XMultiServiceFactory>& rxFactory) +{ + (void)rxFactory; + + ::rtl::Reference<PanelFactory> pPanelFactory (new PanelFactory()); + cssu::Reference<cssu::XInterface> xService (static_cast<XWeak*>(pPanelFactory.get()), cssu::UNO_QUERY); + return xService; +} + + + -class PanelFactory - : private ::boost::noncopyable, - private ::cppu::BaseMutex, - public PanelFactoryInterfaceBase +cssu::Sequence<OUString> SAL_CALL PanelFactory::getSupportedServiceNames (void) { -public: - PanelFactory (void); - virtual ~PanelFactory (void); - - // XUIElementFactory - cssu::Reference<css::ui::XUIElement> SAL_CALL createUIElement ( - const ::rtl::OUString& rsResourceURL, - const ::cssu::Sequence<css::beans::PropertyValue>& rArguments) - throw( - css::container::NoSuchElementException, - css::lang::IllegalArgumentException, - cssu::RuntimeException); -}; + cssu::Sequence<OUString> aServiceNames (1); + aServiceNames[0] = SERVICE_NAME; + return aServiceNames; + +} + + + PanelFactory::PanelFactory (void) : PanelFactoryInterfaceBase(m_aMutex) { } + + + PanelFactory::~PanelFactory (void) { } + + + Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement ( const ::rtl::OUString& rsResourceURL, const ::cssu::Sequence<css::beans::PropertyValue>& rArguments) @@ -196,18 +208,6 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement ( return Reference<ui::XUIElement>(); } -} - -extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL -org_apache_openoffice_comp_svx_sidebar_PanelFactory_implementation_getFactory( - SAL_UNUSED_PARAMETER css::uno::XComponentContext *, - uno_Sequence * arguments) -{ - assert(arguments != 0 && arguments->nElements == 0); (void) arguments; - css::uno::Reference<css::uno::XInterface> x( - static_cast<cppu::OWeakObject *>(new PanelFactory)); - x->acquire(); - return x.get(); -} +} } // end of namespace svx::sidebar -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +// eof |