diff options
Diffstat (limited to 'svx/source/sidebar/PanelFactory.cxx')
-rw-r--r-- | svx/source/sidebar/PanelFactory.cxx | 76 |
1 files changed, 40 insertions, 36 deletions
diff --git a/svx/source/sidebar/PanelFactory.cxx b/svx/source/sidebar/PanelFactory.cxx index 693c00f9a02e..9942faf15491 100644 --- a/svx/source/sidebar/PanelFactory.cxx +++ b/svx/source/sidebar/PanelFactory.cxx @@ -15,7 +15,6 @@ * 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,53 +36,48 @@ #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 ::rtl::OUString; +using namespace svx::sidebar; -namespace svx { namespace sidebar { +namespace { +/* 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" +*/ +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; -} - - - - -cssu::Sequence<OUString> SAL_CALL PanelFactory::getSupportedServiceNames (void) +class PanelFactory + : private ::boost::noncopyable, + private ::cppu::BaseMutex, + public PanelFactoryInterfaceBase { - cssu::Sequence<OUString> aServiceNames (1); - aServiceNames[0] = SERVICE_NAME; - return aServiceNames; - -} - - - +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); +}; PanelFactory::PanelFactory (void) : PanelFactoryInterfaceBase(m_aMutex) @@ -208,6 +202,16 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement ( return Reference<ui::XUIElement>(); } -} } // end of namespace svx::sidebar +} -// eof +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(); +} |