[Libreoffice-commits] core.git: 11 commits - chart2/CppunitTest_chart2_export.mk chart2/CppunitTest_chart2_import.mk include/svx sc/CppunitTest_sc_chart_regression_test.mk sc/CppunitTest_sc_filters_test.mk sc/CppunitTest_sc_macros_test.mk sc/CppunitTest_sc_opencl_test.mk sc/CppunitTest_sc_rangelst_test.mk solenv/bin svx/inc svx/source svx/util sw/CppunitTest_sw_ooxmlexport.mk sw/CppunitTest_sw_ooxmlimport.mk vcl/inc vcl/source
Matúš Kukan
matus.kukan at collabora.com
Tue Dec 31 04:27:08 PST 2013
chart2/CppunitTest_chart2_export.mk | 1
chart2/CppunitTest_chart2_import.mk | 1
include/svx/sdr/primitive2d/primitiveFactory2d.hxx | 76 ------
include/svx/unoshcol.hxx | 3
include/svx/xmlgrhlp.hxx | 43 ---
sc/CppunitTest_sc_chart_regression_test.mk | 1
sc/CppunitTest_sc_filters_test.mk | 1
sc/CppunitTest_sc_macros_test.mk | 1
sc/CppunitTest_sc_opencl_test.mk | 1
sc/CppunitTest_sc_rangelst_test.mk | 1
solenv/bin/native-code.py | 4
svx/inc/sidebar/PanelFactory.hxx | 68 -----
svx/inc/tbunocontroller.hxx | 84 -------
svx/inc/tbunosearchcontrollers.hxx | 55 ----
svx/source/customshapes/EnhancedCustomShapeEngine.cxx | 102 +++++++-
svx/source/customshapes/EnhancedCustomShapeEngine.hxx | 96 --------
svx/source/gallery2/GalleryControl.cxx | 1
svx/source/inc/unogalthemeprovider.hxx | 19 -
svx/source/sdr/primitive2d/primitivefactory2d.cxx | 130 ++++------
svx/source/sidebar/PanelFactory.cxx | 76 +++---
svx/source/tbxctrls/tbunocontroller.cxx | 78 +++++-
svx/source/tbxctrls/tbunosearchcontrollers.cxx | 200 ++++++++++------
svx/source/unodraw/UnoGraphicExporter.cxx | 48 +---
svx/source/unodraw/UnoGraphicExporter.hxx | 34 --
svx/source/unodraw/recoveryui.cxx | 146 +++++++++---
svx/source/unodraw/unoctabl.cxx | 213 +-----------------
svx/source/unodraw/unoshcol.cxx | 24 --
svx/source/unogallery/unogalthemeprovider.cxx | 79 ++----
svx/source/xml/xmlgrhlp.cxx | 108 +++++----
svx/util/svx.component | 58 ++--
svx/util/svxcore.component | 18 +
sw/CppunitTest_sw_ooxmlexport.mk | 1
sw/CppunitTest_sw_ooxmlimport.mk | 1
vcl/inc/svdata.hxx | 3
vcl/source/app/svdata.cxx | 6
vcl/source/app/svmain.cxx | 6
36 files changed, 682 insertions(+), 1105 deletions(-)
New commits:
commit 5bf7b06c937ef08478831bc42b344dc96986a881
Author: Matúš Kukan <matus.kukan at collabora.com>
Date: Mon Dec 30 13:19:36 2013 +0100
svx: Constructor feature for last implementations in svx component.
Change-Id: Ifc021eabce9ae3dbd1a54edefda7d3ae3eb67b53
diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index ebdd5db..8edc968 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -45,7 +45,6 @@ core_factory_list = [
("libspelllo.a", "spell_component_getFactory"),
("libsvllo.a", "svl_component_getFactory"),
("libsvtlo.a", "svt_component_getFactory"),
- ("libsvxlo.a", "svx_component_getFactory"),
("libtklo.a", "tk_component_getFactory"),
("libucb1.a", "ucb_component_getFactory"),
("libucpexpand1lo.a", "ucpexpand1_component_getFactory"),
@@ -143,6 +142,9 @@ core_constructor_list = [
"com_sun_star_comp_stoc_SimpleRegistry",
"com_sun_star_security_comp_stoc_AccessController",
"com_sun_star_security_comp_stoc_FilePolicy",
+# svx/util/svx.component
+# FIXME: what is missing ?
+ "com_sun_star_drawing_SvxShapeCollection_implementation_getFactory",
]
# Components which are not in any group yet:
diff --git a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
index bfaa791..b9bc674 100644
--- a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
@@ -17,7 +17,14 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "EnhancedCustomShapeEngine.hxx"
+#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/uno/RuntimeException.hpp>
+#include <com/sun/star/awt/Rectangle.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/drawing/XCustomShapeEngine.hpp>
#include "svx/EnhancedCustomShape2d.hxx"
#include "EnhancedCustomShape3d.hxx"
#include "EnhancedCustomShapeFontWork.hxx"
@@ -42,29 +49,61 @@
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <basegfx/tools/unotools.hxx>
#include <com/sun/star/document/XActionLockable.hpp>
+#include <cppuhelper/implbase3.hxx>
#include <cppuhelper/supportsservice.hxx>
using namespace css;
using namespace css::uno;
-// - EnhancedCustomShapeEngine -
-OUString EnhancedCustomShapeEngine_getImplementationName()
- throw( RuntimeException )
-{
- return OUString( "com.sun.star.drawing.EnhancedCustomShapeEngine" );
-}
+class SdrObject;
+class SdrObjCustomShape;
-Sequence< OUString > SAL_CALL EnhancedCustomShapeEngine_getSupportedServiceNames()
- throw( RuntimeException )
-{
- Sequence< OUString > aRet(1);
- OUString* pArray = aRet.getArray();
- pArray[0] = "com.sun.star.drawing.CustomShapeEngine";
- return aRet;
-}
+namespace {
-EnhancedCustomShapeEngine::EnhancedCustomShapeEngine( const Reference< lang::XMultiServiceFactory >& rxMgr ) :
- mxFact ( rxMgr ),
+class EnhancedCustomShapeEngine : public cppu::WeakImplHelper3
+<
+ css::lang::XInitialization,
+ css::lang::XServiceInfo,
+ css::drawing::XCustomShapeEngine
+>
+{
+ css::uno::Reference< css::drawing::XShape > mxShape;
+ sal_Bool mbForceGroupWithText;
+
+ SdrObject* ImplForceGroupWithText( const SdrObjCustomShape* pCustoObj, SdrObject* pRenderedShape );
+
+public:
+ EnhancedCustomShapeEngine();
+ virtual ~EnhancedCustomShapeEngine();
+
+ // XInterface
+ virtual void SAL_CALL acquire() throw();
+ virtual void SAL_CALL release() throw();
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
+ throw ( css::uno::Exception, css::uno::RuntimeException );
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName()
+ throw ( css::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName )
+ throw ( css::uno::RuntimeException );
+ virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
+ throw ( css::uno::RuntimeException );
+
+ // XCustomShapeEngine
+ virtual css::uno::Reference< css::drawing::XShape > SAL_CALL render()
+ throw ( css::uno::RuntimeException );
+ virtual css::awt::Rectangle SAL_CALL getTextBounds()
+ throw ( css::uno::RuntimeException );
+ virtual css::drawing::PolyPolygonBezierCoords SAL_CALL getLineGeometry()
+ throw ( css::uno::RuntimeException );
+ virtual css::uno::Sequence< css::uno::Reference< css::drawing::XCustomShapeHandle > > SAL_CALL getInteraction()
+ throw ( css::uno::RuntimeException );
+};
+
+EnhancedCustomShapeEngine::EnhancedCustomShapeEngine() :
mbForceGroupWithText ( sal_False )
{
}
@@ -109,7 +148,7 @@ void SAL_CALL EnhancedCustomShapeEngine::initialize( const Sequence< Any >& aArg
OUString SAL_CALL EnhancedCustomShapeEngine::getImplementationName()
throw( RuntimeException )
{
- return EnhancedCustomShapeEngine_getImplementationName();
+ return OUString( "com.sun.star.drawing.EnhancedCustomShapeEngine" );
}
sal_Bool SAL_CALL EnhancedCustomShapeEngine::supportsService( const OUString& rServiceName )
throw( RuntimeException )
@@ -119,7 +158,10 @@ sal_Bool SAL_CALL EnhancedCustomShapeEngine::supportsService( const OUString& rS
Sequence< OUString > SAL_CALL EnhancedCustomShapeEngine::getSupportedServiceNames()
throw ( RuntimeException )
{
- return EnhancedCustomShapeEngine_getSupportedServiceNames();
+ Sequence< OUString > aRet(1);
+ OUString* pArray = aRet.getArray();
+ pArray[0] = "com.sun.star.drawing.CustomShapeEngine";
+ return aRet;
}
// XCustomShapeEngine -----------------------------------------------------------
@@ -444,4 +486,26 @@ Sequence< Reference< drawing::XCustomShapeHandle > > SAL_CALL EnhancedCustomShap
return aSeq;
}
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+com_sun_star_drawing_EnhancedCustomShapeEngine_implementation_getFactory(
+ SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
+ uno_Sequence * arguments)
+{
+ assert(arguments != 0);
+ css::uno::Reference<css::uno::XInterface> x(
+ static_cast<cppu::OWeakObject *>(new EnhancedCustomShapeEngine));
+ x->acquire();
+ css::uno::Reference< css::lang::XInitialization > xx(x, css::uno::UNO_QUERY);
+ if (xx.is())
+ {
+ css::uno::Sequence<css::uno::Any> aArgs(
+ reinterpret_cast<css::uno::Any *>(arguments->elements),
+ arguments->nElements);
+ xx->initialize(aArgs);
+ }
+ return x.get();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/customshapes/EnhancedCustomShapeEngine.hxx b/svx/source/customshapes/EnhancedCustomShapeEngine.hxx
deleted file mode 100644
index ae90045..0000000
--- a/svx/source/customshapes/EnhancedCustomShapeEngine.hxx
+++ /dev/null
@@ -1,96 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef INCLUDED_SVX_SOURCE_CUSTOMSHAPES_ENHANCEDCUSTOMSHAPEENGINE_HXX
-#define INCLUDED_SVX_SOURCE_CUSTOMSHAPES_ENHANCEDCUSTOMSHAPEENGINE_HXX
-
-#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/uno/RuntimeException.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/lang/XComponent.hpp>
-#include <com/sun/star/registry/XRegistryKey.hpp>
-#include <cppuhelper/implbase3.hxx>
-#include <com/sun/star/awt/Rectangle.hpp>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/drawing/XCustomShapeEngine.hpp>
-
-// ---------------------------
-// - EnhancedCustomShapeEngine -
-// ---------------------------
-//
-
-class SdrObject;
-class SdrObjCustomShape;
-class EnhancedCustomShapeEngine : public cppu::WeakImplHelper3
-<
- css::lang::XInitialization,
- css::lang::XServiceInfo,
- css::drawing::XCustomShapeEngine
->
-{
- css::uno::Reference< css::lang::XMultiServiceFactory > mxFact;
- css::uno::Reference< css::drawing::XShape > mxShape;
- sal_Bool mbForceGroupWithText;
-
- SdrObject* ImplForceGroupWithText( const SdrObjCustomShape* pCustoObj, SdrObject* pRenderedShape );
-
-public:
- EnhancedCustomShapeEngine( const css::uno::Reference< css::lang::XMultiServiceFactory >& rxMgr );
- virtual ~EnhancedCustomShapeEngine();
-
- // XInterface
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
-
- // XInitialization
- virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
- throw ( css::uno::Exception, css::uno::RuntimeException );
-
- // XServiceInfo
- virtual OUString SAL_CALL getImplementationName()
- throw ( css::uno::RuntimeException );
- virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName )
- throw ( css::uno::RuntimeException );
- virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
- throw ( css::uno::RuntimeException );
-
- // XCustomShapeEngine
- virtual css::uno::Reference< css::drawing::XShape > SAL_CALL render()
- throw ( css::uno::RuntimeException );
- virtual css::awt::Rectangle SAL_CALL getTextBounds()
- throw ( css::uno::RuntimeException );
- virtual css::drawing::PolyPolygonBezierCoords SAL_CALL getLineGeometry()
- throw ( css::uno::RuntimeException );
- virtual css::uno::Sequence< css::uno::Reference< css::drawing::XCustomShapeHandle > > SAL_CALL getInteraction()
- throw ( css::uno::RuntimeException );
-};
-
-OUString EnhancedCustomShapeEngine_getImplementationName()
- throw ( css::uno::RuntimeException );
-sal_Bool SAL_CALL EnhancedCustomShapeEngine_supportsService( const OUString& rServiceName )
- throw( css::uno::RuntimeException );
-css::uno::Sequence< OUString > SAL_CALL EnhancedCustomShapeEngine_getSupportedServiceNames()
- throw( css::uno::RuntimeException );
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/unodraw/unoctabl.cxx b/svx/source/unodraw/unoctabl.cxx
index 1c95214..925265b 100644
--- a/svx/source/unodraw/unoctabl.cxx
+++ b/svx/source/unodraw/unoctabl.cxx
@@ -20,17 +20,15 @@
#include <unotools/pathoptions.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
#include <cppuhelper/implbase2.hxx>
-
-#include "../customshapes/EnhancedCustomShapeEngine.hxx"
-
#include <svx/xtable.hxx>
using namespace ::com::sun::star;
-using namespace ::rtl;
-using namespace ::cppu;
-class SvxUnoColorTable : public WeakImplHelper2< container::XNameContainer, lang::XServiceInfo >
+namespace {
+
+class SvxUnoColorTable : public cppu::WeakImplHelper2< container::XNameContainer, lang::XServiceInfo >
{
private:
XColorListRef pList;
@@ -44,13 +42,6 @@ public:
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( uno::RuntimeException);
virtual uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( uno::RuntimeException);
- static OUString getImplementationName_Static() throw()
- {
- return OUString("com.sun.star.drawing.SvxUnoColorTable");
- }
-
- static uno::Sequence< OUString > getSupportedServiceNames_Static(void) throw();
-
// XNameContainer
virtual void SAL_CALL insertByName( const OUString& aName, const uno::Any& aElement ) throw( lang::IllegalArgumentException, container::ElementExistException, lang::WrappedTargetException, uno::RuntimeException);
virtual void SAL_CALL removeByName( const OUString& Name ) throw( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException);
@@ -93,17 +84,12 @@ sal_Bool SAL_CALL SvxUnoColorTable::supportsService( const OUString& ServiceNam
OUString SAL_CALL SvxUnoColorTable::getImplementationName() throw( uno::RuntimeException )
{
- return OUString("SvxUnoColorTable");
+ return OUString("com.sun.star.drawing.SvxUnoColorTable");
}
uno::Sequence< OUString > SAL_CALL SvxUnoColorTable::getSupportedServiceNames()
throw( uno::RuntimeException )
{
- return getSupportedServiceNames_Static();
-}
-
-uno::Sequence< OUString > SvxUnoColorTable::getSupportedServiceNames_Static(void) throw()
-{
uno::Sequence< OUString > aSNS( 1 );
aSNS.getArray()[0] = "com.sun.star.drawing.ColorTable";
return aSNS;
@@ -202,63 +188,18 @@ sal_Bool SAL_CALL SvxUnoColorTable::hasElements()
return pList.is() && pList->Count() != 0;
}
-/**
- * Create a colortable
- */
-uno::Reference< uno::XInterface > SAL_CALL SvxUnoColorTable_createInstance(const uno::Reference< lang::XMultiServiceFactory > & ) throw(uno::Exception)
-{
- return *new SvxUnoColorTable();
}
-uno::Reference< uno::XInterface > SAL_CALL create_EnhancedCustomShapeEngine( const uno::Reference< lang::XMultiServiceFactory >& rxFact ) throw(uno::Exception)
-{
- return *new EnhancedCustomShapeEngine( rxFact );
-}
-
-//
-// export this service
-//
-
-#include <com/sun/star/registry/XRegistryKey.hpp>
-#include "sal/types.h"
-#include "osl/diagnose.h"
-#include "cppuhelper/factory.hxx"
-
-extern "C"
-{
-SAL_DLLPUBLIC_EXPORT void * SAL_CALL svx_component_getFactory (
- const sal_Char * pImplName, void * pServiceManager, void * )
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+com_sun_star_drawing_SvxUnoColorTable_implementation_getFactory(
+ SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
+ uno_Sequence * arguments)
{
- void * pRet = 0;
- if( pServiceManager )
- {
- uno::Reference< lang::XSingleServiceFactory > xFactory;
-
- if( rtl_str_compare( pImplName, "com.sun.star.drawing.SvxUnoColorTable" ) == 0 )
- {
- xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
- SvxUnoColorTable::getImplementationName_Static(),
- SvxUnoColorTable_createInstance,
- SvxUnoColorTable::getSupportedServiceNames_Static() );
- }
- else if ( rtl_str_compare( pImplName, "com.sun.star.drawing.EnhancedCustomShapeEngine" ) == 0 )
- {
- xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory* >( pServiceManager ),
- EnhancedCustomShapeEngine_getImplementationName(),
- create_EnhancedCustomShapeEngine,
- EnhancedCustomShapeEngine_getSupportedServiceNames() );
- }
-
- if( xFactory.is())
- {
- xFactory->acquire();
- pRet = xFactory.get();
- }
- }
-
- return pRet;
-}
-
+ assert(arguments != 0 && arguments->nElements == 0); (void) arguments;
+ css::uno::Reference<css::uno::XInterface> x(
+ static_cast<cppu::OWeakObject *>(new SvxUnoColorTable));
+ x->acquire();
+ return x.get();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/util/svx.component b/svx/util/svx.component
index da40ece..848b28e 100644
--- a/svx/util/svx.component
+++ b/svx/util/svx.component
@@ -18,7 +18,7 @@
-->
<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
- prefix="svx" xmlns="http://openoffice.org/2010/uno-components">
+ xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.gallery.GalleryThemeProvider"
constructor="com_sun_star_comp_gallery_GalleryThemeProvider_implementation_getFactory">
<service name="com.sun.star.gallery.GalleryThemeProvider"/>
@@ -32,14 +32,16 @@
constructor="com_sun_star_comp_svx_RecoveryUI_implementation_getFactory">
<service name="com.sun.star.dialog.RecoveryUI"/>
</implementation>
- <implementation name="com.sun.star.drawing.EnhancedCustomShapeEngine">
+ <implementation name="com.sun.star.drawing.EnhancedCustomShapeEngine"
+ constructor="com_sun_star_drawing_EnhancedCustomShapeEngine_implementation_getFactory">
<service name="com.sun.star.drawing.CustomShapeEngine"/>
</implementation>
<implementation name="com.sun.star.drawing.SvxShapeCollection"
constructor="com_sun_star_drawing_SvxShapeCollection_implementation_getFactory">
<service name="com.sun.star.drawing.ShapeCollection"/>
</implementation>
- <implementation name="com.sun.star.drawing.SvxUnoColorTable">
+ <implementation name="com.sun.star.drawing.SvxUnoColorTable"
+ constructor="com_sun_star_drawing_SvxUnoColorTable_implementation_getFactory">
<service name="com.sun.star.drawing.ColorTable"/>
</implementation>
<implementation name="com.sun.star.svx.DownSearchToolboxController"
commit 2978ddf60d9cc0aced1c3804cd489b47c63bcf6d
Author: Matúš Kukan <matus.kukan at collabora.com>
Date: Mon Dec 30 12:37:34 2013 +0100
svx: Use constructor feature for SvxShapeCollection.
Change-Id: If717b1d526e5d3e67adae4a224018b6da4bf09aa
diff --git a/include/svx/unoshcol.hxx b/include/svx/unoshcol.hxx
index b349b5e..523313f 100644
--- a/include/svx/unoshcol.hxx
+++ b/include/svx/unoshcol.hxx
@@ -81,11 +81,8 @@ public:
virtual OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
- static com::sun::star::uno::Sequence< OUString > getSupportedServiceNames_Static();
- static OUString getImplementationName_Static();
};
-::com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL SvxShapeCollection_createInstance( const com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rSMgr );
#endif
diff --git a/svx/source/unodraw/unoctabl.cxx b/svx/source/unodraw/unoctabl.cxx
index 660a0ce..1c95214 100644
--- a/svx/source/unodraw/unoctabl.cxx
+++ b/svx/source/unodraw/unoctabl.cxx
@@ -25,7 +25,6 @@
#include "../customshapes/EnhancedCustomShapeEngine.hxx"
#include <svx/xtable.hxx>
-#include "svx/unoshcol.hxx"
using namespace ::com::sun::star;
using namespace ::rtl;
@@ -249,13 +248,6 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL svx_component_getFactory (
create_EnhancedCustomShapeEngine,
EnhancedCustomShapeEngine_getSupportedServiceNames() );
}
- else if( rtl_str_compare( pImplName, "com.sun.star.drawing.SvxShapeCollection" ) == 0 )
- {
- xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
- SvxShapeCollection::getImplementationName_Static(),
- SvxShapeCollection_createInstance,
- SvxShapeCollection::getSupportedServiceNames_Static() );
- }
if( xFactory.is())
{
diff --git a/svx/source/unodraw/unoshcol.cxx b/svx/source/unodraw/unoshcol.cxx
index 2850e1e..66b2195 100644
--- a/svx/source/unodraw/unoshcol.cxx
+++ b/svx/source/unodraw/unoshcol.cxx
@@ -18,9 +18,10 @@
*/
#include <com/sun/star/document/EventObject.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
-#include "svx/unoshcol.hxx"
#include <svx/unoprov.hxx>
+#include <svx/unoshcol.hxx>
#include <cppuhelper/supportsservice.hxx>
using namespace ::cppu;
@@ -210,11 +211,6 @@ sal_Bool SAL_CALL SvxShapeCollection::hasElements() throw( uno::RuntimeException
OUString SAL_CALL SvxShapeCollection::getImplementationName()
throw( uno::RuntimeException )
{
- return getImplementationName_Static();
-}
-
-OUString SvxShapeCollection::getImplementationName_Static()
-{
return OUString("com.sun.star.drawing.SvxShapeCollection");
}
@@ -226,20 +222,22 @@ sal_Bool SAL_CALL SvxShapeCollection::supportsService( const OUString& ServiceNa
uno::Sequence< OUString > SAL_CALL SvxShapeCollection::getSupportedServiceNames() throw( uno::RuntimeException )
{
- return getSupportedServiceNames_Static();
-}
-
-uno::Sequence< OUString > SvxShapeCollection::getSupportedServiceNames_Static()
-{
uno::Sequence< OUString > aSeq(2);
aSeq.getArray()[0] = "com.sun.star.drawing.Shapes";
aSeq.getArray()[1] = "com.sun.star.drawing.ShapeCollection";
return aSeq;
}
-Reference< XInterface > SAL_CALL SvxShapeCollection_createInstance( const Reference< ::com::sun::star::lang::XMultiServiceFactory >& )
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+com_sun_star_drawing_SvxShapeCollection_implementation_getFactory(
+ SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
+ uno_Sequence * arguments)
{
- return *( new SvxShapeCollection() );
+ assert(arguments != 0 && arguments->nElements == 0); (void) arguments;
+ css::uno::Reference<css::uno::XInterface> x(
+ static_cast<cppu::OWeakObject *>(new SvxShapeCollection));
+ x->acquire();
+ return x.get();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/util/svx.component b/svx/util/svx.component
index 3aedd3a..da40ece 100644
--- a/svx/util/svx.component
+++ b/svx/util/svx.component
@@ -35,7 +35,8 @@
<implementation name="com.sun.star.drawing.EnhancedCustomShapeEngine">
<service name="com.sun.star.drawing.CustomShapeEngine"/>
</implementation>
- <implementation name="com.sun.star.drawing.SvxShapeCollection">
+ <implementation name="com.sun.star.drawing.SvxShapeCollection"
+ constructor="com_sun_star_drawing_SvxShapeCollection_implementation_getFactory">
<service name="com.sun.star.drawing.ShapeCollection"/>
</implementation>
<implementation name="com.sun.star.drawing.SvxUnoColorTable">
commit e11a80d0be9db1e8cc1054d166638a99e89defea
Author: Matúš Kukan <matus.kukan at collabora.com>
Date: Mon Dec 30 11:21:33 2013 +0100
svx: Use constructor feature for RecoveryUI.
Change-Id: I8c7ae37ff6f06615726810392db0a0955e159d30
diff --git a/svx/source/unodraw/recoveryui.cxx b/svx/source/unodraw/recoveryui.cxx
index 986afe7..a6e344a 100644
--- a/svx/source/unodraw/recoveryui.cxx
+++ b/svx/source/unodraw/recoveryui.cxx
@@ -19,29 +19,120 @@
#include <config_folders.h>
-#include "recoveryui.hxx"
-#include "docrecovery.hxx"
-#include <com/sun/star/lang/XInitialization.hpp>
+#include <docrecovery.hxx>
+#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/frame/XFramesSupplier.hpp>
-#include <com/sun/star/beans/NamedValue.hpp>
+#include <com/sun/star/frame/XSynchronousDispatch.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/task/XStatusIndicatorFactory.hpp>
+#include <cppuhelper/implbase2.hxx>
#include <osl/file.hxx>
#include <rtl/bootstrap.hxx>
#include <comphelper/processfactory.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <vcl/svapp.hxx>
+#include <vcl/window.hxx>
#include <boost/scoped_ptr.hpp>
#include <officecfg/Office/Recovery.hxx>
-namespace svx
+namespace svxdr = ::svx::DocRecovery;
+using namespace ::osl;
+
+namespace {
+
+class RecoveryUI : public ::cppu::WeakImplHelper2< css::lang::XServiceInfo ,
+ css::frame::XSynchronousDispatch > // => XDispatch!
{
+ //-------------------------------------------
+ // const, types, etcpp.
+ private:
-namespace svxdr = ::svx::DocRecovery;
+ /** @short TODO */
+ enum EJob
+ {
+ E_JOB_UNKNOWN,
+ E_DO_EMERGENCY_SAVE,
+ E_DO_RECOVERY,
+ E_DO_CRASHREPORT
+ };
-using namespace ::rtl;
-using namespace ::osl;
+ //-------------------------------------------
+ // member
+ private:
+
+ /** @short TODO */
+ css::uno::Reference< css::uno::XComponentContext > m_xContext;
+
+ /** @short TODO */
+ Window* m_pParentWindow;
+
+ /** @short TODO */
+ RecoveryUI::EJob m_eJob;
+
+ /** @short TODO */
+ css::uno::Reference< css::task::XStatusIndicatorFactory > m_xProgressFactory;
+
+ //-------------------------------------------
+ // interface
+ public:
+
+ //---------------------------------------
+ /** @short TODO */
+ RecoveryUI(const css::uno::Reference< css::uno::XComponentContext >& xContext);
+
+ //---------------------------------------
+ /** @short TODO */
+ virtual ~RecoveryUI();
+
+ //---------------------------------------
+ // css.lang.XServiceInfo
+
+ virtual OUString SAL_CALL getImplementationName()
+ throw(css::uno::RuntimeException);
+
+ virtual sal_Bool SAL_CALL supportsService(const OUString& sServiceName)
+ throw(css::uno::RuntimeException);
+
+ virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
+ throw(css::uno::RuntimeException);
+
+ //---------------------------------------
+ virtual com::sun::star::uno::Any SAL_CALL dispatchWithReturnValue(const css::util::URL& aURL,
+ const css::uno::Sequence< css::beans::PropertyValue >& lArguments )
+ throw(css::uno::RuntimeException);
+
+ //---------------------------------------
+ // css.frame.XDispatch
+
+ virtual void SAL_CALL dispatch(const css::util::URL& aURL ,
+ const css::uno::Sequence< css::beans::PropertyValue >& lArguments)
+ throw(css::uno::RuntimeException);
+
+ virtual void SAL_CALL addStatusListener(const css::uno::Reference< css::frame::XStatusListener >& xListener,
+ const css::util::URL& aURL )
+ throw(css::uno::RuntimeException);
+ virtual void SAL_CALL removeStatusListener(const css::uno::Reference< css::frame::XStatusListener >& xListener,
+ const css::util::URL& aURL )
+ throw(css::uno::RuntimeException);
+
+ //-------------------------------------------
+ // helper
+ private:
+
+ EJob impl_classifyJob(const css::util::URL& aURL);
+
+ sal_Bool impl_doEmergencySave();
+
+ void impl_doRecovery();
+
+ void impl_showAllRecoveredDocs();
+
+ void impl_doCrashReport();
+
+};
RecoveryUI::RecoveryUI(const css::uno::Reference< css::uno::XComponentContext >& xContext)
: m_xContext (xContext )
@@ -57,7 +148,7 @@ RecoveryUI::~RecoveryUI()
OUString SAL_CALL RecoveryUI::getImplementationName()
throw(css::uno::RuntimeException)
{
- return RecoveryUI::st_getImplementationName();
+ return OUString("com.sun.star.comp.svx.RecoveryUI");
}
sal_Bool SAL_CALL RecoveryUI::supportsService(const OUString& sServiceName)
@@ -69,7 +160,9 @@ sal_Bool SAL_CALL RecoveryUI::supportsService(const OUString& sServiceName)
css::uno::Sequence< OUString > SAL_CALL RecoveryUI::getSupportedServiceNames()
throw(css::uno::RuntimeException)
{
- return RecoveryUI::st_getSupportedServiceNames();
+ css::uno::Sequence< OUString > lServiceNames(1);
+ lServiceNames[0] = "com.sun.star.dialog.RecoveryUI";
+ return lServiceNames;
}
css::uno::Any SAL_CALL RecoveryUI::dispatchWithReturnValue(const css::util::URL& aURL,
@@ -132,24 +225,6 @@ void SAL_CALL RecoveryUI::removeStatusListener(const css::uno::Reference< css::f
OSL_FAIL("RecoveryUI::removeStatusListener()\nNot implemented yet!");
}
-OUString RecoveryUI::st_getImplementationName()
-{
- return OUString("com.sun.star.comp.svx.RecoveryUI");
-}
-
-css::uno::Sequence< OUString > RecoveryUI::st_getSupportedServiceNames()
-{
- css::uno::Sequence< OUString > lServiceNames(1);
- lServiceNames[0] = "com.sun.star.dialog.RecoveryUI";
- return lServiceNames;
-}
-
-css::uno::Reference< css::uno::XInterface > SAL_CALL RecoveryUI::st_createInstance(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR)
-{
- RecoveryUI* pNew = new RecoveryUI(comphelper::getComponentContext(xSMGR));
- return css::uno::Reference< css::uno::XInterface >(static_cast< css::lang::XServiceInfo* >(pNew));
-}
-
static OUString GetCrashConfigDir()
{
@@ -160,7 +235,7 @@ static OUString GetCrashConfigDir()
#else
OUString ustrValue = "$SYSUSERCONFIG";
#endif
- Bootstrap::expandMacros( ustrValue );
+ rtl::Bootstrap::expandMacros( ustrValue );
#if defined(WNT)
ustrValue += "/user/crashdata";
@@ -342,6 +417,17 @@ void RecoveryUI::impl_showAllRecoveredDocs()
}
}
-} // namespace svx
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+com_sun_star_comp_svx_RecoveryUI_implementation_getFactory(
+ css::uno::XComponentContext *context, uno_Sequence * arguments)
+{
+ assert(arguments != 0 && arguments->nElements == 0); (void) arguments;
+ css::uno::Reference<css::uno::XInterface> x(
+ static_cast<cppu::OWeakObject *>(new RecoveryUI(context)));
+ x->acquire();
+ return x.get();
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/unodraw/unoctabl.cxx b/svx/source/unodraw/unoctabl.cxx
index 8157228..660a0ce 100644
--- a/svx/source/unodraw/unoctabl.cxx
+++ b/svx/source/unodraw/unoctabl.cxx
@@ -26,7 +26,6 @@
#include <svx/xtable.hxx>
#include "svx/unoshcol.hxx"
-#include "recoveryui.hxx"
using namespace ::com::sun::star;
using namespace ::rtl;
@@ -257,13 +256,6 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL svx_component_getFactory (
SvxShapeCollection_createInstance,
SvxShapeCollection::getSupportedServiceNames_Static() );
}
- else if( svx::RecoveryUI::st_getImplementationName().equalsAscii( pImplName ) )
- {
- xFactory = ::cppu::createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
- svx::RecoveryUI::st_getImplementationName(),
- svx::RecoveryUI::st_createInstance,
- svx::RecoveryUI::st_getSupportedServiceNames() );
- }
if( xFactory.is())
{
diff --git a/svx/util/svx.component b/svx/util/svx.component
index 7cd6aaa..3aedd3a 100644
--- a/svx/util/svx.component
+++ b/svx/util/svx.component
@@ -28,7 +28,8 @@
<service name="com.sun.star.comp.svx.FindbarDispatcher"/>
<service name="com.sun.star.frame.ProtocolHandler"/>
</implementation>
- <implementation name="com.sun.star.comp.svx.RecoveryUI">
+ <implementation name="com.sun.star.comp.svx.RecoveryUI"
+ constructor="com_sun_star_comp_svx_RecoveryUI_implementation_getFactory">
<service name="com.sun.star.dialog.RecoveryUI"/>
</implementation>
<implementation name="com.sun.star.drawing.EnhancedCustomShapeEngine">
commit 82093a207c5bd5daf5b0a5b67e831177de605f53
Author: Matúš Kukan <matus.kukan at collabora.com>
Date: Mon Dec 30 11:10:17 2013 +0100
svx: Use constructor feature for GraphicExporter.
Change-Id: I6384cce0915929b0a1249edfb72f5516ad2da3dd
diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx
index 0c83a67..8220620 100644
--- a/svx/source/unodraw/UnoGraphicExporter.cxx
+++ b/svx/source/unodraw/UnoGraphicExporter.cxx
@@ -83,15 +83,12 @@ using namespace ::com::sun::star::document;
using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::task;
-#include <svx/sdr/contact/viewobjectcontactredirector.hxx>
// #i102251#
#include <editeng/editstat.hxx>
-//////////////////////////////////////////////////////////////////////////////
+namespace {
-namespace svx
-{
struct ExportSettings
{
OUString maFilterName;
@@ -180,26 +177,6 @@ namespace svx
SdrModel* mpDoc;
};
- SVX_DLLPUBLIC Reference< XInterface > SAL_CALL GraphicExporter_createInstance(const Reference< XMultiServiceFactory > & )
- throw( Exception )
- {
- return (XWeak*)new GraphicExporter();
- }
-
- SVX_DLLPUBLIC Sequence< OUString > SAL_CALL GraphicExporter_getSupportedServiceNames()
- throw()
- {
- Sequence< OUString > aSupportedServiceNames( 1 );
- aSupportedServiceNames[0] = "com.sun.star.drawing.GraphicExportFilter";
- return aSupportedServiceNames;
- }
-
- SVX_DLLPUBLIC OUString SAL_CALL GraphicExporter_getImplementationName()
- throw()
- {
- return OUString( "com.sun.star.comp.Draw.GraphicExporter" );
- }
-
/** creates a bitmap that is optionaly transparent from a metafile
*/
BitmapEx GetBitmapFromMetaFile( const GDIMetaFile& rMtf, sal_Bool bTransparent, const Size* pSize )
@@ -300,7 +277,6 @@ namespace svx
return &aOutSize;
}
-}
class ImplExportCheckVisisbilityRedirector : public ::sdr::contact::ViewObjectContactRedirector
{
@@ -351,8 +327,6 @@ drawinglayer::primitive2d::Primitive2DSequence ImplExportCheckVisisbilityRedirec
}
}
-using namespace ::svx;
-
GraphicExporter::GraphicExporter()
: mpUnoPage( NULL ), mnPageNumber(-1), mpCurrentPage(0), mpDoc( NULL )
{
@@ -1224,7 +1198,7 @@ void SAL_CALL GraphicExporter::setSourceDocument( const Reference< lang::XCompon
OUString SAL_CALL GraphicExporter::getImplementationName( )
throw(RuntimeException)
{
- return GraphicExporter_getImplementationName();
+ return OUString( "com.sun.star.comp.Draw.GraphicExporter" );
}
sal_Bool SAL_CALL GraphicExporter::supportsService( const OUString& ServiceName )
@@ -1236,7 +1210,9 @@ sal_Bool SAL_CALL GraphicExporter::supportsService( const OUString& ServiceName
Sequence< OUString > SAL_CALL GraphicExporter::getSupportedServiceNames( )
throw(RuntimeException)
{
- return GraphicExporter_getSupportedServiceNames();
+ Sequence< OUString > aSupportedServiceNames(1);
+ aSupportedServiceNames[0] = "com.sun.star.drawing.GraphicExportFilter";
+ return aSupportedServiceNames;
}
// XMimeTypeInfo
@@ -1284,6 +1260,8 @@ Sequence< OUString > SAL_CALL GraphicExporter::getSupportedMimeTypeNames( ) thr
return aSeq;
}
+}
+
Graphic SvxGetGraphicForShape( SdrObject& rShape, bool bVector )
{
Graphic aGraphic;
@@ -1302,4 +1280,16 @@ Graphic SvxGetGraphicForShape( SdrObject& rShape, bool bVector )
return aGraphic;
}
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+com_sun_star_comp_Draw_GraphicExporter_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 GraphicExporter));
+ x->acquire();
+ return x.get();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/unodraw/UnoGraphicExporter.hxx b/svx/source/unodraw/UnoGraphicExporter.hxx
deleted file mode 100644
index 864ad21..0000000
--- a/svx/source/unodraw/UnoGraphicExporter.hxx
+++ /dev/null
@@ -1,34 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef INCLUDED_SVX_SOURCE_UNODRAW_UNOGRAPHICEXPORTER_HXX
-#define INCLUDED_SVX_SOURCE_UNODRAW_UNOGRAPHICEXPORTER_HXX
-
-#include <com/sun/star/uno/XInterface.hpp>
-
-namespace svx
-{
- SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL GraphicExporter_createInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) throw( ::com::sun::star::uno::Exception );
- SVX_DLLPUBLIC ::com::sun::star::uno::Sequence< OUString > SAL_CALL GraphicExporter_getSupportedServiceNames() throw();
- SVX_DLLPUBLIC OUString SAL_CALL GraphicExporter_getImplementationName() throw();
-}
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/unodraw/unoctabl.cxx b/svx/source/unodraw/unoctabl.cxx
index 961b311..8157228 100644
--- a/svx/source/unodraw/unoctabl.cxx
+++ b/svx/source/unodraw/unoctabl.cxx
@@ -220,7 +220,6 @@ uno::Reference< uno::XInterface > SAL_CALL create_EnhancedCustomShapeEngine( con
// export this service
//
-#include "UnoGraphicExporter.hxx"
#include <com/sun/star/registry/XRegistryKey.hpp>
#include "sal/types.h"
#include "osl/diagnose.h"
@@ -265,13 +264,6 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL svx_component_getFactory (
svx::RecoveryUI::st_createInstance,
svx::RecoveryUI::st_getSupportedServiceNames() );
}
- else if( svx::GraphicExporter_getImplementationName().equalsAscii( pImplName ) )
- {
- xFactory = ::cppu::createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
- svx::GraphicExporter_getImplementationName(),
- svx::GraphicExporter_createInstance,
- svx::GraphicExporter_getSupportedServiceNames() );
- }
if( xFactory.is())
{
diff --git a/svx/util/svx.component b/svx/util/svx.component
index 2cc086a..7cd6aaa 100644
--- a/svx/util/svx.component
+++ b/svx/util/svx.component
@@ -19,9 +19,6 @@
<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
prefix="svx" xmlns="http://openoffice.org/2010/uno-components">
- <implementation name="com.sun.star.comp.Draw.GraphicExporter">
- <service name="com.sun.star.drawing.GraphicExportFilter"/>
- </implementation>
<implementation name="com.sun.star.comp.gallery.GalleryThemeProvider"
constructor="com_sun_star_comp_gallery_GalleryThemeProvider_implementation_getFactory">
<service name="com.sun.star.gallery.GalleryThemeProvider"/>
diff --git a/svx/util/svxcore.component b/svx/util/svxcore.component
index 7664825..5555c2a 100644
--- a/svx/util/svxcore.component
+++ b/svx/util/svxcore.component
@@ -18,6 +18,10 @@
-->
<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
prefix="svxcore" xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.Draw.GraphicExporter"
+ constructor="com_sun_star_comp_Draw_GraphicExporter_implementation_getFactory">
+ <service name="com.sun.star.drawing.GraphicExportFilter"/>
+ </implementation>
<implementation name="com.sun.star.comp.svx.ExtrusionDepthController">
<service name="com.sun.star.frame.ToolbarController"/>
</implementation>
commit 05caae2d040497c68b9328da93eb4c33caee4632
Author: Matúš Kukan <matus.kukan at collabora.com>
Date: Mon Dec 30 11:03:25 2013 +0100
svx: Use constructor feature for FontHeightToolBoxControl.
Change-Id: I4c4991e494f026951a4805c04018ea7b7f610cd9
diff --git a/svx/inc/tbunocontroller.hxx b/svx/inc/tbunocontroller.hxx
deleted file mode 100644
index 82e48c5..0000000
--- a/svx/inc/tbunocontroller.hxx
+++ /dev/null
@@ -1,84 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef INCLUDED_SVX_INC_TBUNOCONTROLLER_HXX
-#define INCLUDED_SVX_INC_TBUNOCONTROLLER_HXX
-
-#include <svtools/toolboxcontroller.hxx>
-#include <com/sun/star/awt/FontDescriptor.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-
-namespace svx
-{
-
-class SvxFontSizeBox_Impl;
-class FontHeightToolBoxControl : public svt::ToolboxController,
- public ::com::sun::star::lang::XServiceInfo
-{
- public:
- FontHeightToolBoxControl(
- const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rServiceManager );
- ~FontHeightToolBoxControl();
-
- // XInterface
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL acquire() throw ();
- virtual void SAL_CALL release() throw ();
-
- // XServiceInfo
- virtual OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
- virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( ::com::sun::star::uno::RuntimeException );
- virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException );
-
- static OUString getImplementationName_Static() throw()
- {
- return OUString("com.sun.star.svx.FontHeightToolBoxController");
- }
-
- static ::com::sun::star::uno::Sequence< OUString > getSupportedServiceNames_Static() throw();
-
- // XComponent
- virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);
-
- // XStatusListener
- virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
-
- // XToolbarController
- virtual void SAL_CALL execute( sal_Int16 KeyModifier ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL click() throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL doubleClick() throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL createPopupWindow() throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL createItemWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& Parent ) throw (::com::sun::star::uno::RuntimeException);
-
- void dispatchCommand( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rArgs );
- using svt::ToolboxController::dispatchCommand;
-
- private:
- SvxFontSizeBox_Impl* m_pBox;
- ::com::sun::star::awt::FontDescriptor m_aCurrentFont;
-};
-
-::com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL FontHeightToolBoxControl_createInstance( const com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rSMgr );
-
-}
-
-#endif // INCLUDED_SVX_INC_TBUNOCONTROLLER_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/tbxctrls/tbunocontroller.cxx b/svx/source/tbxctrls/tbunocontroller.cxx
index c343844..56dc41e 100644
--- a/svx/source/tbxctrls/tbunocontroller.cxx
+++ b/svx/source/tbxctrls/tbunocontroller.cxx
@@ -17,18 +17,18 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-
-#include "tbunocontroller.hxx"
-
+#include <com/sun/star/awt/FontDescriptor.hpp>
#include <com/sun/star/frame/status/FontHeight.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
#include <vcl/svapp.hxx>
#include <vcl/window.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <svtools/ctrltool.hxx>
#include <svtools/ctrlbox.hxx>
+#include <svtools/toolboxcontroller.hxx>
#include <osl/mutex.hxx>
#include <comphelper/processfactory.hxx>
#include <cppuhelper/supportsservice.hxx>
@@ -39,10 +39,48 @@
using namespace ::com::sun::star;
-namespace svx
+namespace {
+
+class SvxFontSizeBox_Impl;
+class FontHeightToolBoxControl : public svt::ToolboxController,
+ public lang::XServiceInfo
{
+ public:
+ FontHeightToolBoxControl(
+ const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rServiceManager );
+ ~FontHeightToolBoxControl();
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire() throw ();
+ virtual void SAL_CALL release() throw ();
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException );
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);
+
+ // XStatusListener
+ virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
+
+ // XToolbarController
+ virtual void SAL_CALL execute( sal_Int16 KeyModifier ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL click() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL doubleClick() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL createPopupWindow() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL createItemWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& Parent ) throw (::com::sun::star::uno::RuntimeException);
+
+ void dispatchCommand( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rArgs );
+ using svt::ToolboxController::dispatchCommand;
+
+ private:
+ SvxFontSizeBox_Impl* m_pBox;
+ ::com::sun::star::awt::FontDescriptor m_aCurrentFont;
+};
-class FontHeightToolBoxControl;
class SvxFontSizeBox_Impl : public FontSizeBox
{
public:
@@ -284,18 +322,12 @@ throw(uno::RuntimeException)
OUString SAL_CALL FontHeightToolBoxControl::getImplementationName()
throw( uno::RuntimeException )
{
- return getImplementationName_Static();
+ return OUString("com.sun.star.svx.FontHeightToolBoxController");
}
uno::Sequence< OUString > SAL_CALL FontHeightToolBoxControl::getSupportedServiceNames( )
throw( uno::RuntimeException )
{
- return getSupportedServiceNames_Static();
-}
-
-uno::Sequence< OUString > FontHeightToolBoxControl::getSupportedServiceNames_Static()
-throw()
-{
uno::Sequence< OUString > aSNS( 1 );
aSNS.getArray()[0] = "com.sun.star.frame.ToolbarController";
return aSNS;
@@ -404,12 +436,26 @@ void FontHeightToolBoxControl::dispatchCommand(
}
}
-uno::Reference< uno::XInterface > SAL_CALL FontHeightToolBoxControl_createInstance(
- const uno::Reference< lang::XMultiServiceFactory >& rSMgr )
-{
- return *new FontHeightToolBoxControl( comphelper::getComponentContext(rSMgr) );
}
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+com_sun_star_svx_FontHeightToolBoxController_implementation_getFactory(
+ css::uno::XComponentContext *rxContext,
+ uno_Sequence * arguments)
+{
+ assert(arguments != 0);
+ css::uno::Reference<css::uno::XInterface> x(
+ static_cast<cppu::OWeakObject *>(new FontHeightToolBoxControl(rxContext)));
+ x->acquire();
+ css::uno::Reference< css::lang::XInitialization > xx(x, css::uno::UNO_QUERY);
+ if (xx.is())
+ {
+ css::uno::Sequence<css::uno::Any> aArgs(
+ reinterpret_cast<css::uno::Any *>(arguments->elements),
+ arguments->nElements);
+ xx->initialize(aArgs);
+ }
+ return x.get();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/unodraw/unoctabl.cxx b/svx/source/unodraw/unoctabl.cxx
index 6e4575d..961b311 100644
--- a/svx/source/unodraw/unoctabl.cxx
+++ b/svx/source/unodraw/unoctabl.cxx
@@ -27,7 +27,6 @@
#include <svx/xtable.hxx>
#include "svx/unoshcol.hxx"
#include "recoveryui.hxx"
-#include "tbunocontroller.hxx"
using namespace ::com::sun::star;
using namespace ::rtl;
@@ -273,13 +272,6 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL svx_component_getFactory (
svx::GraphicExporter_createInstance,
svx::GraphicExporter_getSupportedServiceNames() );
}
- else if ( svx::FontHeightToolBoxControl::getImplementationName_Static().equalsAscii( pImplName ) )
- {
- xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
- svx::FontHeightToolBoxControl::getImplementationName_Static(),
- svx::FontHeightToolBoxControl_createInstance,
- svx::FontHeightToolBoxControl::getSupportedServiceNames_Static() );
- }
if( xFactory.is())
{
diff --git a/svx/util/svx.component b/svx/util/svx.component
index b3b4df0..2cc086a 100644
--- a/svx/util/svx.component
+++ b/svx/util/svx.component
@@ -59,7 +59,8 @@
constructor="com_sun_star_svx_FindAllToolboxController_implementation_getFactory">
<service name="com.sun.star.frame.ToolbarController"/>
</implementation>
- <implementation name="com.sun.star.svx.FontHeightToolBoxController">
+ <implementation name="com.sun.star.svx.FontHeightToolBoxController"
+ constructor="com_sun_star_svx_FontHeightToolBoxController_implementation_getFactory">
<service name="com.sun.star.frame.ToolbarController"/>
</implementation>
<implementation name="com.sun.star.svx.UpSearchToolboxController"
commit 01739fc69fa91e58331d0edbf7282e8e25f124d1
Author: Matúš Kukan <matus.kukan at collabora.com>
Date: Mon Dec 30 10:54:41 2013 +0100
svx: Use constructor feature for uno search controllers.
Change-Id: If84ee775c5172eb40361b93aece920ab94c9e15c
diff --git a/svx/inc/tbunosearchcontrollers.hxx b/svx/inc/tbunosearchcontrollers.hxx
index 5f33b60..51d31de 100644
--- a/svx/inc/tbunosearchcontrollers.hxx
+++ b/svx/inc/tbunosearchcontrollers.hxx
@@ -40,8 +40,7 @@
#include <map>
#include <vector>
-namespace svx
-{
+namespace {
class FindTextFieldControl : public ComboBox
{
@@ -105,13 +104,6 @@ public:
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException );
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( css::uno::RuntimeException );
- static OUString getImplementationName_Static() throw()
- {
- return OUString("com.sun.star.svx.FindTextToolboxController");
- }
-
- static ::com::sun::star::uno::Sequence< OUString > getSupportedServiceNames_Static() throw();
-
// XComponent
virtual void SAL_CALL dispose() throw ( css::uno::RuntimeException );
@@ -153,13 +145,6 @@ public:
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException );
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( css::uno::RuntimeException );
- static OUString getImplementationName_Static( ) throw()
- {
- return OUString( "com.sun.star.svx.ExitFindbarToolboxController" );
- }
-
- static css::uno::Sequence< OUString > getSupportedServiceNames_Static() throw();
-
// XComponent
virtual void SAL_CALL dispose() throw ( css::uno::RuntimeException );
@@ -192,14 +177,6 @@ public:
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException );
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( css::uno::RuntimeException );
- static OUString getImplementationName_Static( Type eType ) throw()
- {
- return eType == UP? OUString( "com.sun.star.svx.UpSearchToolboxController" ) :
- OUString( "com.sun.star.svx.DownSearchToolboxController" );
- }
-
- static css::uno::Sequence< OUString > getSupportedServiceNames_Static() throw();
-
// XComponent
virtual void SAL_CALL dispose() throw ( css::uno::RuntimeException );
@@ -233,13 +210,6 @@ public:
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException );
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( css::uno::RuntimeException );
- static OUString getImplementationName_Static( ) throw()
- {
- return OUString( "com.sun.star.svx.MatchCaseToolboxController" );
- }
-
- static css::uno::Sequence< OUString > getSupportedServiceNames_Static() throw();
-
// XComponent
virtual void SAL_CALL dispose() throw ( css::uno::RuntimeException );
@@ -274,13 +244,6 @@ public:
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException );
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( css::uno::RuntimeException );
- static OUString getImplementationName_Static( ) throw()
- {
- return OUString( "com.sun.star.svx.FindAllToolboxController" );
- }
-
- static css::uno::Sequence< OUString > getSupportedServiceNames_Static() throw();
-
// XComponent
virtual void SAL_CALL dispose() throw ( css::uno::RuntimeException );
@@ -317,13 +280,6 @@ public:
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException );
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( css::uno::RuntimeException );
- static OUString getImplementationName_Static() throw()
- {
- return OUString("com.sun.star.comp.svx.Impl.FindbarDispatcher");
- }
-
- static css::uno::Sequence< OUString > getSupportedServiceNames_Static() throw();
-
// XInitialization
virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) throw ( css::uno::Exception, css::uno::RuntimeException );
@@ -342,15 +298,6 @@ private:
};
-// createInstance
-css::uno::Reference< css::uno::XInterface > SAL_CALL FindTextToolbarController_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr );
-css::uno::Reference< css::uno::XInterface > SAL_CALL DownSearchToolboxController_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr );
-css::uno::Reference< css::uno::XInterface > SAL_CALL UpSearchToolboxController_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr );
-css::uno::Reference< css::uno::XInterface > SAL_CALL MatchCaseToolboxController_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr );
-css::uno::Reference< css::uno::XInterface > SAL_CALL FindAllToolboxController_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr );
-css::uno::Reference< css::uno::XInterface > SAL_CALL ExitFindbarToolboxController_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr );
-css::uno::Reference< css::uno::XInterface > SAL_CALL FindbarDispatcher_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr );
-
}
#endif // INCLUDED_SVX_INC_TBUNOSEARCHCONTROLLERS_HXX
diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
index 6089e39..aecea5c 100644
--- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "tbunosearchcontrollers.hxx"
+#include <tbunosearchcontrollers.hxx>
#include <svx/dialogs.hrc>
#include <svx/dialmgr.hxx>
@@ -41,8 +41,9 @@
#include <osl/mutex.hxx>
#include <rtl/instance.hxx>
-namespace svx
-{
+using namespace css;
+
+namespace {
static const char SEARCHITEM_COMMAND[] = "SearchItem.Command";
static const char SEARCHITEM_SEARCHSTRING[] = "SearchItem.SearchString";
@@ -379,7 +380,7 @@ void SAL_CALL FindTextToolbarController::release() throw ()
// XServiceInfo
OUString SAL_CALL FindTextToolbarController::getImplementationName() throw( css::uno::RuntimeException )
{
- return getImplementationName_Static();
+ return OUString("com.sun.star.svx.FindTextToolboxController");
}
sal_Bool SAL_CALL FindTextToolbarController::supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException )
@@ -389,11 +390,6 @@ sal_Bool SAL_CALL FindTextToolbarController::supportsService( const OUString& Se
css::uno::Sequence< OUString > SAL_CALL FindTextToolbarController::getSupportedServiceNames() throw( css::uno::RuntimeException )
{
- return getSupportedServiceNames_Static();
-}
-
-css::uno::Sequence< OUString > FindTextToolbarController::getSupportedServiceNames_Static() throw()
-{
css::uno::Sequence< OUString > aSNS( 1 );
aSNS[0] = "com.sun.star.frame.ToolbarController";
return aSNS;
@@ -545,7 +541,9 @@ void SAL_CALL UpDownSearchToolboxController::release() throw ()
// XServiceInfo
OUString SAL_CALL UpDownSearchToolboxController::getImplementationName() throw( css::uno::RuntimeException )
{
- return getImplementationName_Static( meType );
+ return meType == UpDownSearchToolboxController::UP?
+ OUString( "com.sun.star.svx.UpSearchToolboxController" ) :
+ OUString( "com.sun.star.svx.DownSearchToolboxController" );
}
sal_Bool SAL_CALL UpDownSearchToolboxController::supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException )
@@ -555,11 +553,6 @@ sal_Bool SAL_CALL UpDownSearchToolboxController::supportsService( const OUString
css::uno::Sequence< OUString > SAL_CALL UpDownSearchToolboxController::getSupportedServiceNames() throw( css::uno::RuntimeException )
{
- return getSupportedServiceNames_Static();
-}
-
-css::uno::Sequence< OUString > UpDownSearchToolboxController::getSupportedServiceNames_Static() throw()
-{
css::uno::Sequence< OUString > aSNS( 1 );
aSNS[0] = "com.sun.star.frame.ToolbarController";
return aSNS;
@@ -646,7 +639,7 @@ void SAL_CALL MatchCaseToolboxController::release() throw ()
// XServiceInfo
OUString SAL_CALL MatchCaseToolboxController::getImplementationName() throw( css::uno::RuntimeException )
{
- return getImplementationName_Static();
+ return OUString( "com.sun.star.svx.MatchCaseToolboxController" );
}
sal_Bool SAL_CALL MatchCaseToolboxController::supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException )
@@ -656,11 +649,6 @@ sal_Bool SAL_CALL MatchCaseToolboxController::supportsService( const OUString& S
css::uno::Sequence< OUString > SAL_CALL MatchCaseToolboxController::getSupportedServiceNames() throw( css::uno::RuntimeException )
{
- return getSupportedServiceNames_Static();
-}
-
-css::uno::Sequence< OUString > MatchCaseToolboxController::getSupportedServiceNames_Static() throw()
-{
css::uno::Sequence< OUString > aSNS( 1 );
aSNS[0] = "com.sun.star.frame.ToolbarController";
return aSNS;
@@ -757,7 +745,7 @@ void SAL_CALL FindAllToolboxController::release() throw ()
// XServiceInfo
OUString SAL_CALL FindAllToolboxController::getImplementationName() throw( css::uno::RuntimeException )
{
- return getImplementationName_Static( );
+ return OUString( "com.sun.star.svx.FindAllToolboxController" );
}
@@ -768,11 +756,6 @@ sal_Bool SAL_CALL FindAllToolboxController::supportsService( const OUString& Ser
css::uno::Sequence< OUString > SAL_CALL FindAllToolboxController::getSupportedServiceNames() throw( css::uno::RuntimeException )
{
- return getSupportedServiceNames_Static();
-}
-
-css::uno::Sequence< OUString > FindAllToolboxController::getSupportedServiceNames_Static() throw()
-{
css::uno::Sequence< OUString > aSNS( 1 );
aSNS[0] = "com.sun.star.frame.ToolbarController";
return aSNS;
@@ -852,7 +835,7 @@ void SAL_CALL ExitSearchToolboxController::release() throw ()
// XServiceInfo
OUString SAL_CALL ExitSearchToolboxController::getImplementationName() throw( css::uno::RuntimeException )
{
- return getImplementationName_Static( );
+ return OUString( "com.sun.star.svx.ExitFindbarToolboxController" );
}
@@ -863,11 +846,6 @@ sal_Bool SAL_CALL ExitSearchToolboxController::supportsService( const OUString&
css::uno::Sequence< OUString > SAL_CALL ExitSearchToolboxController::getSupportedServiceNames() throw( css::uno::RuntimeException )
{
- return getSupportedServiceNames_Static();
-}
-
-css::uno::Sequence< OUString > ExitSearchToolboxController::getSupportedServiceNames_Static() throw()
-{
css::uno::Sequence< OUString > aSNS( 1 );
aSNS[0] = "com.sun.star.frame.ToolbarController";
return aSNS;
@@ -961,7 +939,7 @@ void SAL_CALL FindbarDispatcher::release() throw()
// XServiceInfo
OUString SAL_CALL FindbarDispatcher::getImplementationName() throw( css::uno::RuntimeException )
{
- return getImplementationName_Static();
+ return OUString("com.sun.star.comp.svx.Impl.FindbarDispatcher");
}
sal_Bool SAL_CALL FindbarDispatcher::supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException )
@@ -971,11 +949,6 @@ sal_Bool SAL_CALL FindbarDispatcher::supportsService( const OUString& ServiceNam
css::uno::Sequence< OUString > SAL_CALL FindbarDispatcher::getSupportedServiceNames() throw( css::uno::RuntimeException )
{
- return getSupportedServiceNames_Static();
-}
-
-css::uno::Sequence< OUString > FindbarDispatcher::getSupportedServiceNames_Static() throw()
-{
css::uno::Sequence< OUString > aSNS( 2 );
aSNS[0] = "com.sun.star.comp.svx.FindbarDispatcher";
aSNS[1] = "com.sun.star.frame.ProtocolHandler";
@@ -1074,59 +1047,142 @@ void SAL_CALL FindbarDispatcher::removeStatusListener( const css::uno::Reference
{
}
-//-----------------------------------------------------------------------------------------------------------
-// create Instance
-
-css::uno::Reference< css::uno::XInterface > SAL_CALL FindTextToolbarController_createInstance(
- const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr )
-{
- return static_cast< cppu::OWeakObject * >(
- new FindTextToolbarController( comphelper::getComponentContext(rSMgr) ) );
}
-css::uno::Reference< css::uno::XInterface > SAL_CALL DownSearchToolboxController_createInstance(
- const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr )
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+com_sun_star_svx_FindTextToolboxController_implementation_getFactory(
+ css::uno::XComponentContext *context, uno_Sequence * arguments)
{
- return static_cast< cppu::OWeakObject * >(
- new UpDownSearchToolboxController(
- comphelper::getComponentContext(rSMgr), UpDownSearchToolboxController::DOWN ) );
+ assert(arguments != 0);
+ css::uno::Reference<css::uno::XInterface> x(
+ static_cast<cppu::OWeakObject *>(new FindTextToolbarController(context)));
+ x->acquire();
+ css::uno::Reference< css::lang::XInitialization > xx(x, css::uno::UNO_QUERY);
+ if (xx.is())
+ {
+ css::uno::Sequence<css::uno::Any> aArgs(
+ reinterpret_cast<css::uno::Any *>(arguments->elements),
+ arguments->nElements);
+ xx->initialize(aArgs);
+ }
+ return x.get();
}
-css::uno::Reference< css::uno::XInterface > SAL_CALL UpSearchToolboxController_createInstance(
- const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr )
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+com_sun_star_svx_ExitFindbarToolboxController_implementation_getFactory(
+ css::uno::XComponentContext *context, uno_Sequence * arguments)
{
- return static_cast< cppu::OWeakObject * >(
- new UpDownSearchToolboxController(
- comphelper::getComponentContext(rSMgr), UpDownSearchToolboxController::UP ) );
+ assert(arguments != 0);
+ css::uno::Reference<css::uno::XInterface> x(
+ static_cast<cppu::OWeakObject *>(new ExitSearchToolboxController(context)));
+ x->acquire();
+ css::uno::Reference< css::lang::XInitialization > xx(x, css::uno::UNO_QUERY);
+ if (xx.is())
+ {
+ css::uno::Sequence<css::uno::Any> aArgs(
+ reinterpret_cast<css::uno::Any *>(arguments->elements),
+ arguments->nElements);
+ xx->initialize(aArgs);
+ }
+ return x.get();
}
-css::uno::Reference< css::uno::XInterface > SAL_CALL MatchCaseToolboxController_createInstance(
- const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr )
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+com_sun_star_svx_UpSearchToolboxController_implementation_getFactory(
+ css::uno::XComponentContext *context, uno_Sequence * arguments)
{
- return static_cast< cppu::OWeakObject * >(
- new MatchCaseToolboxController( comphelper::getComponentContext(rSMgr) ) );
+ assert(arguments != 0);
+ css::uno::Reference<css::uno::XInterface> x(
+ static_cast<cppu::OWeakObject *>(new UpDownSearchToolboxController(
+ context, UpDownSearchToolboxController::UP )));
+ x->acquire();
+ css::uno::Reference< css::lang::XInitialization > xx(x, css::uno::UNO_QUERY);
+ if (xx.is())
+ {
+ css::uno::Sequence<css::uno::Any> aArgs(
+ reinterpret_cast<css::uno::Any *>(arguments->elements),
+ arguments->nElements);
+ xx->initialize(aArgs);
+ }
+ return x.get();
}
-css::uno::Reference< css::uno::XInterface > SAL_CALL FindAllToolboxController_createInstance(
- const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr )
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+com_sun_star_svx_DownSearchToolboxController_implementation_getFactory(
+ css::uno::XComponentContext *context, uno_Sequence * arguments)
{
- return static_cast< cppu::OWeakObject * >(
- new FindAllToolboxController( comphelper::getComponentContext(rSMgr) ) );
+ assert(arguments != 0);
+ css::uno::Reference<css::uno::XInterface> x(
+ static_cast<cppu::OWeakObject *>(new UpDownSearchToolboxController(
+ context, UpDownSearchToolboxController::DOWN )));
+ x->acquire();
+ css::uno::Reference< css::lang::XInitialization > xx(x, css::uno::UNO_QUERY);
+ if (xx.is())
+ {
+ css::uno::Sequence<css::uno::Any> aArgs(
+ reinterpret_cast<css::uno::Any *>(arguments->elements),
+ arguments->nElements);
+ xx->initialize(aArgs);
+ }
+ return x.get();
}
-css::uno::Reference< css::uno::XInterface > SAL_CALL ExitFindbarToolboxController_createInstance(
- const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr )
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+com_sun_star_svx_MatchCaseToolboxController_implementation_getFactory(
+ css::uno::XComponentContext *context, uno_Sequence * arguments)
{
- return *new ExitSearchToolboxController( comphelper::getComponentContext(rSMgr) );
+ assert(arguments != 0);
+ css::uno::Reference<css::uno::XInterface> x(
+ static_cast<cppu::OWeakObject *>(new MatchCaseToolboxController(context)));
+ x->acquire();
+ css::uno::Reference< css::lang::XInitialization > xx(x, css::uno::UNO_QUERY);
+ if (xx.is())
+ {
+ css::uno::Sequence<css::uno::Any> aArgs(
+ reinterpret_cast<css::uno::Any *>(arguments->elements),
+ arguments->nElements);
+ xx->initialize(aArgs);
+ }
+ return x.get();
}
-css::uno::Reference< css::uno::XInterface > SAL_CALL FindbarDispatcher_createInstance(
- const css::uno::Reference< css::lang::XMultiServiceFactory >& )
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+com_sun_star_svx_FindAllToolboxController_implementation_getFactory(
+ css::uno::XComponentContext *context, uno_Sequence * arguments)
{
- return static_cast< cppu::OWeakObject * >( new FindbarDispatcher );
+ assert(arguments != 0);
+ css::uno::Reference<css::uno::XInterface> x(
+ static_cast<cppu::OWeakObject *>(new FindAllToolboxController(context)));
+ x->acquire();
+ css::uno::Reference< css::lang::XInitialization > xx(x, css::uno::UNO_QUERY);
+ if (xx.is())
+ {
+ css::uno::Sequence<css::uno::Any> aArgs(
+ reinterpret_cast<css::uno::Any *>(arguments->elements),
+ arguments->nElements);
+ xx->initialize(aArgs);
+ }
+ return x.get();
}
-//-----------------------------------------------------------------------------------------------------------
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+com_sun_star_comp_svx_Impl_FindbarDispatcher_implementation_getFactory(
+ SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
+ uno_Sequence * arguments)
+{
+ assert(arguments != 0);
+ css::uno::Reference<css::uno::XInterface> x(
+ static_cast<cppu::OWeakObject *>(new FindbarDispatcher));
+ x->acquire();
+ css::uno::Reference< css::lang::XInitialization > xx(x, css::uno::UNO_QUERY);
+ if (xx.is())
+ {
+ css::uno::Sequence<css::uno::Any> aArgs(
+ reinterpret_cast<css::uno::Any *>(arguments->elements),
+ arguments->nElements);
+ xx->initialize(aArgs);
+ }
+ return x.get();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/unodraw/unoctabl.cxx b/svx/source/unodraw/unoctabl.cxx
index 8f990b7..6e4575d 100644
--- a/svx/source/unodraw/unoctabl.cxx
+++ b/svx/source/unodraw/unoctabl.cxx
@@ -28,7 +28,6 @@
#include "svx/unoshcol.hxx"
#include "recoveryui.hxx"
#include "tbunocontroller.hxx"
-#include "tbunosearchcontrollers.hxx"
using namespace ::com::sun::star;
using namespace ::rtl;
@@ -281,55 +280,6 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL svx_component_getFactory (
svx::FontHeightToolBoxControl_createInstance,
svx::FontHeightToolBoxControl::getSupportedServiceNames_Static() );
}
- else if ( svx::FindTextToolbarController::getImplementationName_Static().equalsAscii( pImplName ) )
- {
- xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
- svx::FindTextToolbarController::getImplementationName_Static(),
- svx::FindTextToolbarController_createInstance,
- svx::FindTextToolbarController::getSupportedServiceNames_Static() );
- }
- else if ( svx::UpDownSearchToolboxController::getImplementationName_Static( svx::UpDownSearchToolboxController::DOWN ).equalsAscii( pImplName ) )
- {
- xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
- svx::UpDownSearchToolboxController::getImplementationName_Static( svx::UpDownSearchToolboxController::DOWN ),
- svx::DownSearchToolboxController_createInstance,
- svx::UpDownSearchToolboxController::getSupportedServiceNames_Static() );
- }
- else if ( svx::UpDownSearchToolboxController::getImplementationName_Static( svx::UpDownSearchToolboxController::UP ).equalsAscii( pImplName ) )
- {
- xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
- svx::UpDownSearchToolboxController::getImplementationName_Static( svx::UpDownSearchToolboxController::UP ),
- svx::UpSearchToolboxController_createInstance,
- svx::UpDownSearchToolboxController::getSupportedServiceNames_Static() );
- }
- else if ( svx::MatchCaseToolboxController::getImplementationName_Static().equalsAscii( pImplName ) )
- {
- xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
- svx::MatchCaseToolboxController::getImplementationName_Static(),
- svx::MatchCaseToolboxController_createInstance,
- svx::MatchCaseToolboxController::getSupportedServiceNames_Static() );
- }
- else if ( svx::FindAllToolboxController::getImplementationName_Static().equalsAscii( pImplName ) )
- {
- xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
- svx::FindAllToolboxController::getImplementationName_Static(),
- svx::FindAllToolboxController_createInstance,
- svx::FindAllToolboxController::getSupportedServiceNames_Static() );
- }
- else if ( svx::ExitSearchToolboxController::getImplementationName_Static().equalsAscii( pImplName ) )
- {
- xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
- svx::ExitSearchToolboxController::getImplementationName_Static(),
- svx::ExitFindbarToolboxController_createInstance,
- svx::ExitSearchToolboxController::getSupportedServiceNames_Static() );
- }
- else if ( svx::FindbarDispatcher::getImplementationName_Static().equalsAscii( pImplName ) )
- {
- xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
- svx::FindbarDispatcher::getImplementationName_Static(),
- svx::FindbarDispatcher_createInstance,
- svx::FindbarDispatcher::getSupportedServiceNames_Static() );
- }
if( xFactory.is())
{
diff --git a/svx/util/svx.component b/svx/util/svx.component
index fbc4eed..b3b4df0 100644
--- a/svx/util/svx.component
+++ b/svx/util/svx.component
@@ -26,7 +26,8 @@
constructor="com_sun_star_comp_gallery_GalleryThemeProvider_implementation_getFactory">
<service name="com.sun.star.gallery.GalleryThemeProvider"/>
</implementation>
- <implementation name="com.sun.star.comp.svx.Impl.FindbarDispatcher">
+ <implementation name="com.sun.star.comp.svx.Impl.FindbarDispatcher"
+ constructor="com_sun_star_comp_svx_Impl_FindbarDispatcher_implementation_getFactory">
<service name="com.sun.star.comp.svx.FindbarDispatcher"/>
<service name="com.sun.star.frame.ProtocolHandler"/>
</implementation>
@@ -42,25 +43,31 @@
<implementation name="com.sun.star.drawing.SvxUnoColorTable">
<service name="com.sun.star.drawing.ColorTable"/>
</implementation>
- <implementation name="com.sun.star.svx.DownSearchToolboxController">
+ <implementation name="com.sun.star.svx.DownSearchToolboxController"
+ constructor="com_sun_star_svx_DownSearchToolboxController_implementation_getFactory">
<service name="com.sun.star.frame.ToolbarController"/>
</implementation>
- <implementation name="com.sun.star.svx.FindTextToolboxController">
+ <implementation name="com.sun.star.svx.FindTextToolboxController"
+ constructor="com_sun_star_svx_FindTextToolboxController_implementation_getFactory">
<service name="com.sun.star.frame.ToolbarController"/>
</implementation>
- <implementation name="com.sun.star.svx.MatchCaseToolboxController">
+ <implementation name="com.sun.star.svx.MatchCaseToolboxController"
+ constructor="com_sun_star_svx_MatchCaseToolboxController_implementation_getFactory">
<service name="com.sun.star.frame.ToolbarController"/>
</implementation>
- <implementation name="com.sun.star.svx.FindAllToolboxController">
+ <implementation name="com.sun.star.svx.FindAllToolboxController"
+ constructor="com_sun_star_svx_FindAllToolboxController_implementation_getFactory">
<service name="com.sun.star.frame.ToolbarController"/>
</implementation>
<implementation name="com.sun.star.svx.FontHeightToolBoxController">
<service name="com.sun.star.frame.ToolbarController"/>
</implementation>
- <implementation name="com.sun.star.svx.UpSearchToolboxController">
+ <implementation name="com.sun.star.svx.UpSearchToolboxController"
+ constructor="com_sun_star_svx_UpSearchToolboxController_implementation_getFactory">
<service name="com.sun.star.frame.ToolbarController"/>
</implementation>
- <implementation name="com.sun.star.svx.ExitFindbarToolboxController">
+ <implementation name="com.sun.star.svx.ExitFindbarToolboxController"
+ constructor="com_sun_star_svx_ExitFindbarToolboxController_implementation_getFactory">
<service name="com.sun.star.frame.ToolbarController"/>
</implementation>
<implementation name="org.apache.openoffice.comp.svx.sidebar.PanelFactory"
commit 2929847516a597bc20e696fdd1a260d750560584
Author: Matúš Kukan <matus.kukan at collabora.com>
Date: Mon Dec 30 10:38:29 2013 +0100
svx: Use constructor feature for GalleryThemeProvider.
Change-Id: Ifb92256b1516098d292a3ad960cb5982121998da
diff --git a/svx/source/inc/unogalthemeprovider.hxx b/svx/source/inc/unogalthemeprovider.hxx
index 8d1cd68..84980ab 100644
--- a/svx/source/inc/unogalthemeprovider.hxx
+++ b/svx/source/inc/unogalthemeprovider.hxx
@@ -25,23 +25,9 @@
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/gallery/XGalleryThemeProvider.hpp>
-#include <svx/svxdllapi.h>
-
class Gallery;
-namespace unogallery {
-
-// -------------------------
-// - some helper functions -
-// -------------------------
-
-::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL GalleryThemeProvider_createInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) throw( ::com::sun::star::uno::Exception );
- ::com::sun::star::uno::Sequence< OUString > SAL_CALL GalleryThemeProvider_getSupportedServiceNames() throw();
-OUString SAL_CALL GalleryThemeProvider_getImplementationName() throw();
-
-// -----------------
-// - GalleryThemes -
-// -----------------
+namespace {
class GalleryThemeProvider : public ::cppu::WeakImplHelper2< ::com::sun::star::lang::XInitialization,
::com::sun::star::gallery::XGalleryThemeProvider >
@@ -51,9 +37,6 @@ public:
GalleryThemeProvider();
~GalleryThemeProvider();
- SVX_DLLPUBLIC static OUString getImplementationName_Static() throw();
- SVX_DLLPUBLIC static ::com::sun::star::uno::Sequence< OUString > getSupportedServiceNames_Static() throw();
-
protected:
// XServiceInfo
diff --git a/svx/source/unodraw/unoctabl.cxx b/svx/source/unodraw/unoctabl.cxx
index 56aee06..8f990b7 100644
--- a/svx/source/unodraw/unoctabl.cxx
+++ b/svx/source/unodraw/unoctabl.cxx
@@ -223,7 +223,6 @@ uno::Reference< uno::XInterface > SAL_CALL create_EnhancedCustomShapeEngine( con
//
#include "UnoGraphicExporter.hxx"
-#include "unogalthemeprovider.hxx"
#include <com/sun/star/registry/XRegistryKey.hpp>
#include "sal/types.h"
#include "osl/diagnose.h"
@@ -331,13 +330,6 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL svx_component_getFactory (
svx::FindbarDispatcher_createInstance,
svx::FindbarDispatcher::getSupportedServiceNames_Static() );
}
- else if( ::unogallery::GalleryThemeProvider_getImplementationName().equalsAscii( pImplName ) )
- {
- xFactory = ::cppu::createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
- ::unogallery::GalleryThemeProvider_getImplementationName(),
- ::unogallery::GalleryThemeProvider_createInstance,
- ::unogallery::GalleryThemeProvider_getSupportedServiceNames() );
- }
if( xFactory.is())
{
diff --git a/svx/source/unogallery/unogalthemeprovider.cxx b/svx/source/unogallery/unogalthemeprovider.cxx
index e5ad2d8..71b0736 100644
--- a/svx/source/unogallery/unogalthemeprovider.cxx
+++ b/svx/source/unogallery/unogalthemeprovider.cxx
@@ -30,38 +30,7 @@
using namespace ::com::sun::star;
-namespace unogallery {
-
-// --------------------
-// - Helper functions -
-// --------------------
-
-uno::Reference< uno::XInterface > SAL_CALL GalleryThemeProvider_createInstance(
- const uno::Reference< lang::XMultiServiceFactory > & )
- throw( uno::Exception )
-{
- return *( new GalleryThemeProvider() );
-}
-
-// -----------------------------------------------------------------------------
-
-uno::Sequence< OUString > SAL_CALL GalleryThemeProvider_getSupportedServiceNames()
- throw()
-{
- return GalleryThemeProvider::getSupportedServiceNames_Static();
-}
-
-// -----------------------------------------------------------------------------
-
-OUString SAL_CALL GalleryThemeProvider_getImplementationName()
- throw()
-{
- return GalleryThemeProvider::getImplementationName_Static();
-}
-
-// -----------------
-// - GalleryThemeProvider -
-// -----------------
+namespace {
GalleryThemeProvider::GalleryThemeProvider() :
mbHiddenThemes( sal_False )
@@ -77,30 +46,10 @@ GalleryThemeProvider::~GalleryThemeProvider()
// ------------------------------------------------------------------------------
-SVX_DLLPUBLIC OUString GalleryThemeProvider::getImplementationName_Static()
- throw()
-{
- return OUString( "com.sun.star.comp.gallery.GalleryThemeProvider" );
-}
-
-// ------------------------------------------------------------------------------
-
-SVX_DLLPUBLIC uno::Sequence< OUString > GalleryThemeProvider::getSupportedServiceNames_Static()
- throw()
-{
- uno::Sequence< OUString > aSeq( 1 );
-
- aSeq.getArray()[ 0 ] = "com.sun.star.gallery.GalleryThemeProvider";
-
- return aSeq;
-}
-
-// ------------------------------------------------------------------------------
-
OUString SAL_CALL GalleryThemeProvider::getImplementationName()
throw( uno::RuntimeException )
{
- return getImplementationName_Static();
+ return OUString( "com.sun.star.comp.gallery.GalleryThemeProvider" );
}
// ------------------------------------------------------------------------------
@@ -123,7 +72,9 @@ sal_Bool SAL_CALL GalleryThemeProvider::supportsService( const OUString& Service
uno::Sequence< OUString > SAL_CALL GalleryThemeProvider::getSupportedServiceNames()
throw( uno::RuntimeException )
{
- return getSupportedServiceNames_Static();
+ uno::Sequence< OUString > aSeq( 1 );
+ aSeq.getArray()[ 0 ] = "com.sun.star.gallery.GalleryThemeProvider";
+ return aSeq;
}
// ------------------------------------------------------------------------------
@@ -297,4 +248,24 @@ void SAL_CALL GalleryThemeProvider::removeByName( const OUString& rName )
}
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+com_sun_star_comp_gallery_GalleryThemeProvider_implementation_getFactory(
+ SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
+ uno_Sequence * arguments)
+{
+ assert(arguments != 0);
+ css::uno::Reference<css::uno::XInterface> x(
+ static_cast<cppu::OWeakObject *>(new GalleryThemeProvider));
+ x->acquire();
+ css::uno::Reference< css::lang::XInitialization > xx(x, css::uno::UNO_QUERY);
+ if (xx.is())
+ {
+ css::uno::Sequence<css::uno::Any> aArgs(
+ reinterpret_cast<css::uno::Any *>(arguments->elements),
+ arguments->nElements);
+ xx->initialize(aArgs);
+ }
+ return x.get();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/util/svx.component b/svx/util/svx.component
index 0e985a7..fbc4eed 100644
--- a/svx/util/svx.component
+++ b/svx/util/svx.component
@@ -22,7 +22,8 @@
<implementation name="com.sun.star.comp.Draw.GraphicExporter">
<service name="com.sun.star.drawing.GraphicExportFilter"/>
</implementation>
- <implementation name="com.sun.star.comp.gallery.GalleryThemeProvider">
+ <implementation name="com.sun.star.comp.gallery.GalleryThemeProvider"
+ constructor="com_sun_star_comp_gallery_GalleryThemeProvider_implementation_getFactory">
<service name="com.sun.star.gallery.GalleryThemeProvider"/>
</implementation>
<implementation name="com.sun.star.comp.svx.Impl.FindbarDispatcher">
commit 32b64a0ff6fc54290ce5848c34e38ebb7eb5bd95
Author: Matúš Kukan <matus.kukan at collabora.com>
Date: Mon Dec 30 10:31:10 2013 +0100
svx: Use constructor feature for PrimitiveFactory2D.
Change-Id: I331602561b865a6ceb6971d0990565e5a84bb0d5
diff --git a/include/svx/sdr/primitive2d/primitiveFactory2d.hxx b/include/svx/sdr/primitive2d/primitiveFactory2d.hxx
deleted file mode 100644
index dcbdc6b..0000000
--- a/include/svx/sdr/primitive2d/primitiveFactory2d.hxx
+++ /dev/null
@@ -1,76 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef INCLUDED_SVX_SDR_PRIMITIVE2D_PRIMITIVEFACTORY2D_HXX
-#define INCLUDED_SVX_SDR_PRIMITIVE2D_PRIMITIVEFACTORY2D_HXX
-
-#include <com/sun/star/graphic/XPrimitiveFactory2D.hpp>
-#include <cppuhelper/compbase1.hxx>
-#include <comphelper/broadcasthelper.hxx>
-
-#include <svx/svxdllapi.h>
-
-//////////////////////////////////////////////////////////////////////////////
-// UNO API helper methods
-
-namespace drawinglayer
-{
- namespace primitive2d
- {
- SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL XPrimitiveFactory2DProvider_createInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) throw( ::com::sun::star::uno::Exception );
- } // end of namespace primitive2d
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-// PrimitiveFactory2D class
-
-namespace drawinglayer
-{
- namespace primitive2d
- {
- // typedef for PrimitiveFactory2DImplBase
- typedef cppu::WeakComponentImplHelper1< ::com::sun::star::graphic::XPrimitiveFactory2D > PrimitiveFactory2DImplBase;
-
- // base class for C++ implementation of com::sun::star::graphic::XPrimitiveFactory2D
- class PrimitiveFactory2D
- : protected comphelper::OBaseMutex,
- public PrimitiveFactory2DImplBase
- {
- private:
- protected:
- public:
- // constructor
- PrimitiveFactory2D();
-
- // Methods from XPrimitiveFactory2D
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XPrimitive2D > > SAL_CALL createPrimitivesFromXShape( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aParms ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XPrimitive2D > > SAL_CALL createPrimitivesFromXDrawPage( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& xDrawPage, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aParms ) throw (::com::sun::star::uno::RuntimeException);
-
- // UNO API helpers
- SVX_DLLPUBLIC static OUString getImplementationName_Static();
- SVX_DLLPUBLIC static com::sun::star::uno::Sequence< OUString > getSupportedServiceNames_Static();
- };
- } // end of namespace primitive2d
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-#endif // INCLUDED_SVX_SDR_PRIMITIVE2D_PRIMITIVEFACTORY2D_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/sdr/primitive2d/primitivefactory2d.cxx b/svx/source/sdr/primitive2d/primitivefactory2d.cxx
index e549d79..fad0b75 100644
--- a/svx/source/sdr/primitive2d/primitivefactory2d.cxx
+++ b/svx/source/sdr/primitive2d/primitivefactory2d.cxx
@@ -17,106 +17,86 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <svx/sdr/primitive2d/primitiveFactory2d.hxx>
+#include <com/sun/star/graphic/XPrimitiveFactory2D.hpp>
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
#include <svx/svdobj.hxx>
#include <svx/svdpage.hxx>
#include <svx/unoapi.hxx>
#include <svx/sdr/contact/viewcontact.hxx>
-//////////////////////////////////////////////////////////////////////////////
-
using namespace com::sun::star;
-//////////////////////////////////////////////////////////////////////////////
-// UNO API helper methods
-
-namespace drawinglayer
-{
- namespace primitive2d
- {
- uno::Reference< uno::XInterface > SAL_CALL XPrimitiveFactory2DProvider_createInstance(
- const uno::Reference< lang::XMultiServiceFactory >& /*rSMgr*/) throw( uno::Exception )
- {
- return *(new PrimitiveFactory2D());
- }
- } // end of namespace primitive2d
-} // end of namespace drawinglayer
+namespace {
-//////////////////////////////////////////////////////////////////////////////
-// UNO API helper methods
+typedef cppu::WeakComponentImplHelper1< ::com::sun::star::graphic::XPrimitiveFactory2D > PrimitiveFactory2DImplBase;
-namespace drawinglayer
+// base class for C++ implementation of com::sun::star::graphic::XPrimitiveFactory2D
+class PrimitiveFactory2D
+ : protected comphelper::OBaseMutex,
+ public PrimitiveFactory2DImplBase
{
- namespace primitive2d
- {
- PrimitiveFactory2D::PrimitiveFactory2D()
- : PrimitiveFactory2DImplBase(m_aMutex)
- {
- }
+public:
+ PrimitiveFactory2D(): PrimitiveFactory2DImplBase(m_aMutex) {}
- Primitive2DSequence SAL_CALL PrimitiveFactory2D::createPrimitivesFromXShape(
- const uno::Reference< drawing::XShape >& xShape,
- const uno::Sequence< beans::PropertyValue >& /*aParms*/ ) throw (uno::RuntimeException)
- {
- Primitive2DSequence aRetval;
+ // Methods from XPrimitiveFactory2D
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XPrimitive2D > > SAL_CALL createPrimitivesFromXShape( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aParms ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XPrimitive2D > > SAL_CALL createPrimitivesFromXDrawPage( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& xDrawPage, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aParms ) throw (::com::sun::star::uno::RuntimeException);
- if(xShape.is())
- {
- SdrObject* pSource = GetSdrObjectFromXShape(xShape);
+};
- if(pSource)
- {
- const sdr::contact::ViewContact& rSource(pSource->GetViewContact());
- aRetval = rSource.getViewIndependentPrimitive2DSequence();
- }
- }
+Primitive2DSequence SAL_CALL PrimitiveFactory2D::createPrimitivesFromXShape(
+ const uno::Reference< drawing::XShape >& xShape,
+ const uno::Sequence< beans::PropertyValue >& /*aParms*/ ) throw (uno::RuntimeException)
+{
+ Primitive2DSequence aRetval;
- return aRetval;
- }
+ if(xShape.is())
+ {
+ SdrObject* pSource = GetSdrObjectFromXShape(xShape);
- Primitive2DSequence SAL_CALL PrimitiveFactory2D::createPrimitivesFromXDrawPage(
- const uno::Reference< drawing::XDrawPage >& xDrawPage,
- const uno::Sequence< beans::PropertyValue >& /*aParms*/ ) throw (uno::RuntimeException)
+ if(pSource)
{
- Primitive2DSequence aRetval;
-
- if(xDrawPage.is())
- {
- SdrPage* pSource = GetSdrPageFromXDrawPage(xDrawPage);
+ const sdr::contact::ViewContact& rSource(pSource->GetViewContact());
+ aRetval = rSource.getViewIndependentPrimitive2DSequence();
+ }
+ }
- if(pSource)
- {
- const sdr::contact::ViewContact& rSource(pSource->GetViewContact());
+ return aRetval;
+}
- aRetval = rSource.getViewIndependentPrimitive2DSequence();
- }
- }
+Primitive2DSequence SAL_CALL PrimitiveFactory2D::createPrimitivesFromXDrawPage(
+ const uno::Reference< drawing::XDrawPage >& xDrawPage,
+ const uno::Sequence< beans::PropertyValue >& /*aParms*/ ) throw (uno::RuntimeException)
+{
+ Primitive2DSequence aRetval;
- return aRetval;
- }
+ if(xDrawPage.is())
+ {
+ SdrPage* pSource = GetSdrPageFromXDrawPage(xDrawPage);
- OUString PrimitiveFactory2D::getImplementationName_Static()
+ if(pSource)
{
- static OUString aRetval("com.sun.star.comp.graphic.PrimitiveFactory2D");
- return aRetval;
+ const sdr::contact::ViewContact& rSource(pSource->GetViewContact());
+
+ aRetval = rSource.getViewIndependentPrimitive2DSequence();
}
+ }
- uno::Sequence< OUString > PrimitiveFactory2D::getSupportedServiceNames_Static()
- {
- static uno::Sequence< OUString > aSeq;
- osl::Mutex aMutex;
- osl::MutexGuard aGuard( aMutex );
+ return aRetval;
+}
- if(!aSeq.getLength())
- {
- aSeq.realloc(1L);
- aSeq[0] = "com.sun.star.graphic.PrimitiveFactory2D";
- }
+}
- return aSeq;
- }
- } // end of namespace primitive2d
-} // end of namespace drawinglayer
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+com_sun_star_comp_graphic_PrimitiveFactory2D_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 PrimitiveFactory2D));
+ x->acquire();
+ return x.get();
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/unodraw/unoctabl.cxx b/svx/source/unodraw/unoctabl.cxx
index 1c4d5cd..56aee06 100644
--- a/svx/source/unodraw/unoctabl.cxx
+++ b/svx/source/unodraw/unoctabl.cxx
@@ -228,7 +228,6 @@ uno::Reference< uno::XInterface > SAL_CALL create_EnhancedCustomShapeEngine( con
#include "sal/types.h"
#include "osl/diagnose.h"
#include "cppuhelper/factory.hxx"
-#include <svx/sdr/primitive2d/primitiveFactory2d.hxx>
extern "C"
{
@@ -339,14 +338,6 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL svx_component_getFactory (
::unogallery::GalleryThemeProvider_createInstance,
::unogallery::GalleryThemeProvider_getSupportedServiceNames() );
}
- else if( drawinglayer::primitive2d::PrimitiveFactory2D::getImplementationName_Static().equalsAscii( pImplName ) )
- {
- // XPrimitiveFactory2D
- xFactory = ::cppu::createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
- drawinglayer::primitive2d::PrimitiveFactory2D::getImplementationName_Static(),
- drawinglayer::primitive2d::XPrimitiveFactory2DProvider_createInstance,
- drawinglayer::primitive2d::PrimitiveFactory2D::getSupportedServiceNames_Static() );
- }
if( xFactory.is())
{
diff --git a/svx/util/svx.component b/svx/util/svx.component
index b8f043c..0e985a7 100644
--- a/svx/util/svx.component
+++ b/svx/util/svx.component
@@ -25,9 +25,6 @@
<implementation name="com.sun.star.comp.gallery.GalleryThemeProvider">
<service name="com.sun.star.gallery.GalleryThemeProvider"/>
</implementation>
- <implementation name="com.sun.star.comp.graphic.PrimitiveFactory2D">
- <service name="com.sun.star.graphic.PrimitiveFactory2D"/>
- </implementation>
<implementation name="com.sun.star.comp.svx.Impl.FindbarDispatcher">
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list