From 73eca35b0a8e01a7be2ce1775d1937154b5efb9e Mon Sep 17 00:00:00 2001 From: Matúš Kukan Date: Sat, 18 Jan 2014 10:51:50 +0100 Subject: Unify ctor functions for component implementations. There is no need to use different styles for writing the same thing. It also makes it easier in future to use search & replace. But of course, there are also some more complicated functions. Change-Id: I773da20378af0e0d5a27689d3903df7063fb8ac0 --- .../customshapes/EnhancedCustomShapeEngine.cxx | 8 ++--- svx/source/sdr/primitive2d/primitivefactory2d.cxx | 8 ++--- svx/source/sidebar/PanelFactory.cxx | 7 ++-- svx/source/tbxctrls/tbunocontroller.cxx | 6 ++-- svx/source/tbxctrls/tbunosearchcontrollers.cxx | 40 +++++++++------------- svx/source/unodraw/UnoGraphicExporter.cxx | 7 ++-- svx/source/unodraw/recoveryui.cxx | 6 ++-- svx/source/unodraw/unoctabl.cxx | 8 ++--- svx/source/unodraw/unoshcol.cxx | 8 ++--- svx/source/unogallery/unogalthemeprovider.cxx | 8 ++--- svx/source/xml/xmlgrhlp.cxx | 20 +++++------ 11 files changed, 58 insertions(+), 68 deletions(-) (limited to 'svx') diff --git a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx index 861c42a9eeb9..2c3cd3e3f978 100644 --- a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx @@ -25,6 +25,7 @@ #include #include #include +#include #include "svx/EnhancedCustomShape2d.hxx" #include "EnhancedCustomShape3d.hxx" #include "EnhancedCustomShapeFontWork.hxx" @@ -490,13 +491,12 @@ Sequence< Reference< drawing::XCustomShapeHandle > > SAL_CALL EnhancedCustomShap extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_drawing_EnhancedCustomShapeEngine_get_implementation( - SAL_UNUSED_PARAMETER css::uno::XComponentContext *, + css::uno::XComponentContext *, css::uno::Sequence const &) { - css::uno::Reference x( - static_cast(new EnhancedCustomShapeEngine)); + rtl::Reference x(new EnhancedCustomShapeEngine); x->acquire(); - return x.get(); + return static_cast(x.get()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/sdr/primitive2d/primitivefactory2d.cxx b/svx/source/sdr/primitive2d/primitivefactory2d.cxx index abcdd911dc0d..ded21f9db57b 100644 --- a/svx/source/sdr/primitive2d/primitivefactory2d.cxx +++ b/svx/source/sdr/primitive2d/primitivefactory2d.cxx @@ -19,6 +19,7 @@ #include #include +#include #include #include #include @@ -89,13 +90,12 @@ Primitive2DSequence SAL_CALL PrimitiveFactory2D::createPrimitivesFromXDrawPage( extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_comp_graphic_PrimitiveFactory2D_get_implementation( - SAL_UNUSED_PARAMETER css::uno::XComponentContext *, + css::uno::XComponentContext *, css::uno::Sequence const &) { - css::uno::Reference x( - static_cast(new PrimitiveFactory2D)); + rtl::Reference x(new PrimitiveFactory2D); x->acquire(); - return x.get(); + return static_cast(x.get()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/sidebar/PanelFactory.cxx b/svx/source/sidebar/PanelFactory.cxx index dbf9c08363fc..26352c004ae1 100644 --- a/svx/source/sidebar/PanelFactory.cxx +++ b/svx/source/sidebar/PanelFactory.cxx @@ -206,11 +206,10 @@ Reference SAL_CALL PanelFactory::createUIElement ( extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL org_apache_openoffice_comp_svx_sidebar_PanelFactory_get_implementation( - SAL_UNUSED_PARAMETER css::uno::XComponentContext *, + css::uno::XComponentContext *, css::uno::Sequence const &) { - css::uno::Reference x( - static_cast(new PanelFactory)); + rtl::Reference x(new PanelFactory); x->acquire(); - return x.get(); + return static_cast(x.get()); } diff --git a/svx/source/tbxctrls/tbunocontroller.cxx b/svx/source/tbxctrls/tbunocontroller.cxx index b20337fb88c1..d93065ea531a 100644 --- a/svx/source/tbxctrls/tbunocontroller.cxx +++ b/svx/source/tbxctrls/tbunocontroller.cxx @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -443,10 +444,9 @@ com_sun_star_svx_FontHeightToolBoxController_get_implementation( css::uno::XComponentContext *rxContext, css::uno::Sequence const &) { - css::uno::Reference x( - static_cast(new FontHeightToolBoxControl(rxContext))); + rtl::Reference x(new FontHeightToolBoxControl(rxContext)); x->acquire(); - return x.get(); + return static_cast(x.get()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx index b3fdbfbf8c7f..05c6bfe80d8c 100644 --- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx +++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx @@ -39,6 +39,7 @@ #include #include #include +#include #include using namespace css; @@ -1054,10 +1055,9 @@ com_sun_star_svx_FindTextToolboxController_get_implementation( css::uno::XComponentContext *context, css::uno::Sequence const &) { - css::uno::Reference x( - static_cast(new FindTextToolbarController(context))); + rtl::Reference x(new FindTextToolbarController(context)); x->acquire(); - return x.get(); + return static_cast(x.get()); } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL @@ -1065,10 +1065,9 @@ com_sun_star_svx_ExitFindbarToolboxController_get_implementation( css::uno::XComponentContext *context, css::uno::Sequence const &) { - css::uno::Reference x( - static_cast(new ExitSearchToolboxController(context))); + rtl::Reference x(new ExitSearchToolboxController(context)); x->acquire(); - return x.get(); + return static_cast(x.get()); } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL @@ -1076,11 +1075,10 @@ com_sun_star_svx_UpSearchToolboxController_get_implementation( css::uno::XComponentContext *context, css::uno::Sequence const &) { - css::uno::Reference x( - static_cast(new UpDownSearchToolboxController( - context, UpDownSearchToolboxController::UP ))); + rtl::Reference x(new UpDownSearchToolboxController( + context, UpDownSearchToolboxController::UP)); x->acquire(); - return x.get(); + return static_cast(x.get()); } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL @@ -1088,11 +1086,10 @@ com_sun_star_svx_DownSearchToolboxController_get_implementation( css::uno::XComponentContext *context, css::uno::Sequence const &) { - css::uno::Reference x( - static_cast(new UpDownSearchToolboxController( - context, UpDownSearchToolboxController::DOWN ))); + rtl::Reference x(new UpDownSearchToolboxController( + context, UpDownSearchToolboxController::DOWN)); x->acquire(); - return x.get(); + return static_cast(x.get()); } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL @@ -1100,10 +1097,9 @@ com_sun_star_svx_MatchCaseToolboxController_get_implementation( css::uno::XComponentContext *context, css::uno::Sequence const &) { - css::uno::Reference x( - static_cast(new MatchCaseToolboxController(context))); + rtl::Reference x(new MatchCaseToolboxController(context)); x->acquire(); - return x.get(); + return static_cast(x.get()); } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL @@ -1111,10 +1107,9 @@ com_sun_star_svx_FindAllToolboxController_get_implementation( css::uno::XComponentContext *context, css::uno::Sequence const &) { - css::uno::Reference x( - static_cast(new FindAllToolboxController(context))); + rtl::Reference x(new FindAllToolboxController(context)); x->acquire(); - return x.get(); + return static_cast(x.get()); } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL @@ -1122,10 +1117,9 @@ com_sun_star_comp_svx_Impl_FindbarDispatcher_get_implementation( SAL_UNUSED_PARAMETER css::uno::XComponentContext *, css::uno::Sequence const &) { - css::uno::Reference x( - static_cast(new FindbarDispatcher)); + rtl::Reference x(new FindbarDispatcher); x->acquire(); - return x.get(); + return static_cast(x.get()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx index 9a21919750b2..7a611be3cf3b 100644 --- a/svx/source/unodraw/UnoGraphicExporter.cxx +++ b/svx/source/unodraw/UnoGraphicExporter.cxx @@ -1282,13 +1282,12 @@ Graphic SvxGetGraphicForShape( SdrObject& rShape, bool bVector ) extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_comp_Draw_GraphicExporter_get_implementation( - SAL_UNUSED_PARAMETER css::uno::XComponentContext *, + css::uno::XComponentContext *, css::uno::Sequence const &) { - css::uno::Reference x( - static_cast(new GraphicExporter)); + rtl::Reference x(new GraphicExporter); x->acquire(); - return x.get(); + return static_cast(x.get()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/unodraw/recoveryui.cxx b/svx/source/unodraw/recoveryui.cxx index 1644601e76e3..5fdb5f228eaa 100644 --- a/svx/source/unodraw/recoveryui.cxx +++ b/svx/source/unodraw/recoveryui.cxx @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -424,10 +425,9 @@ com_sun_star_comp_svx_RecoveryUI_get_implementation( css::uno::XComponentContext *context, css::uno::Sequence const &) { - css::uno::Reference x( - static_cast(new RecoveryUI(context))); + rtl::Reference x(new RecoveryUI(context)); x->acquire(); - return x.get(); + return static_cast(x.get()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/unodraw/unoctabl.cxx b/svx/source/unodraw/unoctabl.cxx index 019654c5fd91..b707904edd52 100644 --- a/svx/source/unodraw/unoctabl.cxx +++ b/svx/source/unodraw/unoctabl.cxx @@ -23,6 +23,7 @@ #include #include #include +#include #include using namespace ::com::sun::star; @@ -186,13 +187,12 @@ sal_Bool SAL_CALL SvxUnoColorTable::hasElements() extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_drawing_SvxUnoColorTable_get_implementation( - SAL_UNUSED_PARAMETER css::uno::XComponentContext *, + css::uno::XComponentContext *, css::uno::Sequence const &) { - css::uno::Reference x( - static_cast(new SvxUnoColorTable)); + rtl::Reference x(new SvxUnoColorTable); x->acquire(); - return x.get(); + return static_cast(x.get()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/unodraw/unoshcol.cxx b/svx/source/unodraw/unoshcol.cxx index 916d1f07a001..8b873acf6ed1 100644 --- a/svx/source/unodraw/unoshcol.cxx +++ b/svx/source/unodraw/unoshcol.cxx @@ -27,6 +27,7 @@ #include #include #include +#include #include using namespace ::com::sun::star; @@ -270,13 +271,12 @@ uno::Sequence< OUString > SAL_CALL SvxShapeCollection::getSupportedServiceNames( extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_drawing_SvxShapeCollection_get_implementation( - SAL_UNUSED_PARAMETER css::uno::XComponentContext *, + css::uno::XComponentContext *, css::uno::Sequence const &) { - css::uno::Reference x( - static_cast(new SvxShapeCollection)); + rtl::Reference x(new SvxShapeCollection); x->acquire(); - return x.get(); + return static_cast(x.get()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/unogallery/unogalthemeprovider.cxx b/svx/source/unogallery/unogalthemeprovider.cxx index 7878e906ecd7..2fcaec8ff295 100644 --- a/svx/source/unogallery/unogalthemeprovider.cxx +++ b/svx/source/unogallery/unogalthemeprovider.cxx @@ -22,6 +22,7 @@ #include "unogaltheme.hxx" #include "svx/gallery1.hxx" #include +#include #include #include #include @@ -232,13 +233,12 @@ void SAL_CALL GalleryThemeProvider::removeByName( const OUString& rName ) extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_comp_gallery_GalleryThemeProvider_get_implementation( - SAL_UNUSED_PARAMETER css::uno::XComponentContext *, + css::uno::XComponentContext *, css::uno::Sequence const &) { - css::uno::Reference x( - static_cast(new GalleryThemeProvider)); + rtl::Reference x(new GalleryThemeProvider); x->acquire(); - return x.get(); + return static_cast(x.get()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx index b95d38fdb0f6..f9bad053927c 100644 --- a/svx/source/xml/xmlgrhlp.cxx +++ b/svx/source/xml/xmlgrhlp.cxx @@ -19,7 +19,6 @@ #include #include -#include #include #include #include @@ -29,6 +28,7 @@ #include #include +#include #include #include #include @@ -1052,14 +1052,13 @@ Sequence< OUString > SAL_CALL SvXMLGraphicImportExportHelper::getSupportedServic */ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_comp_Svx_GraphicImportHelper_get_implementation( - SAL_UNUSED_PARAMETER css::uno::XComponentContext *, + css::uno::XComponentContext *, css::uno::Sequence const &) { - css::uno::Reference x( - static_cast(new SvXMLGraphicImportExportHelper( - GRAPHICHELPER_MODE_READ))); + rtl::Reference x( + new SvXMLGraphicImportExportHelper(GRAPHICHELPER_MODE_READ)); x->acquire(); - return x.get(); + return static_cast(x.get()); } /** Create this with createInstanceWithArguments. service name @@ -1076,14 +1075,13 @@ com_sun_star_comp_Svx_GraphicImportHelper_get_implementation( */ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_comp_Svx_GraphicExportHelper_get_implementation( - SAL_UNUSED_PARAMETER css::uno::XComponentContext *, + css::uno::XComponentContext *, css::uno::Sequence const &) { - css::uno::Reference x( - static_cast(new SvXMLGraphicImportExportHelper( - GRAPHICHELPER_MODE_WRITE ))); + rtl::Reference x( + new SvXMLGraphicImportExportHelper(GRAPHICHELPER_MODE_WRITE)); x->acquire(); - return x.get(); + return static_cast(x.get()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3