diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-09-28 12:09:58 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-09-28 15:10:45 +0200 |
commit | ff4a319f51fc0ea4eb2baafa22d59f51b6e46a6f (patch) | |
tree | c15d936893b7367cd179870da3b0209b78bb3ee5 /oox | |
parent | 1e6b6f038af656b475cb87844822287fd4e6c166 (diff) |
oox: create ShapeContextHandler instances with an uno constructor
Change-Id: Ie780ff9f3a8c61d13ad10cc2dbe24d3ec165470e
Reviewed-on: https://gerrit.libreoffice.org/61063
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins
Diffstat (limited to 'oox')
-rw-r--r-- | oox/Library_oox.mk | 1 | ||||
-rw-r--r-- | oox/inc/pch/precompiled_oox.hxx | 1 | ||||
-rw-r--r-- | oox/inc/services.hxx | 37 | ||||
-rw-r--r-- | oox/source/core/fasttokenhandler.cxx | 2 | ||||
-rw-r--r-- | oox/source/core/filterdetect.cxx | 2 | ||||
-rw-r--r-- | oox/source/core/services.cxx | 51 | ||||
-rw-r--r-- | oox/source/docprop/ooxmldocpropimport.cxx | 1 | ||||
-rw-r--r-- | oox/source/ppt/dgmimport.cxx | 2 | ||||
-rw-r--r-- | oox/source/ppt/dgmlayout.cxx | 2 | ||||
-rw-r--r-- | oox/source/ppt/pptimport.cxx | 2 | ||||
-rw-r--r-- | oox/source/shape/ShapeContextHandler.cxx | 35 | ||||
-rw-r--r-- | oox/util/oox.component | 5 |
12 files changed, 15 insertions, 126 deletions
diff --git a/oox/Library_oox.mk b/oox/Library_oox.mk index e917a9b866d3..941b3a1d270a 100644 --- a/oox/Library_oox.mk +++ b/oox/Library_oox.mk @@ -96,7 +96,6 @@ $(eval $(call gb_Library_add_exception_objects,oox,\ oox/source/core/recordparser \ oox/source/core/relations \ oox/source/core/relationshandler \ - oox/source/core/services \ oox/source/core/xmlfilterbase \ oox/source/crypto/AgileEngine \ oox/source/crypto/CryptTools \ diff --git a/oox/inc/pch/precompiled_oox.hxx b/oox/inc/pch/precompiled_oox.hxx index 2bfc8539945a..222e9663fca5 100644 --- a/oox/inc/pch/precompiled_oox.hxx +++ b/oox/inc/pch/precompiled_oox.hxx @@ -187,7 +187,6 @@ #include <sax/fastattribs.hxx> #include <sax/fshelper.hxx> #include <sax/saxdllapi.h> -#include <services.hxx> #include <svtools/svtdllapi.h> #include <svx/msdffdef.hxx> #include <svx/svxdllapi.h> diff --git a/oox/inc/services.hxx b/oox/inc/services.hxx deleted file mode 100644 index f790ce525a6b..000000000000 --- a/oox/inc/services.hxx +++ /dev/null @@ -1,37 +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_OOX_INC_SERVICES_HXX -#define INCLUDED_OOX_INC_SERVICES_HXX - -#include <sal/config.h> - -namespace oox { - namespace shape { - extern OUString ShapeContextHandler_getImplementationName(); - extern css::uno::Sequence< OUString > ShapeContextHandler_getSupportedServiceNames(); - /// @throws css::uno::Exception - extern css::uno::Reference< css::uno::XInterface > ShapeContextHandler_createInstance( - const css::uno::Reference< css::uno::XComponentContext >& rxContext ); - } -} - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/core/fasttokenhandler.cxx b/oox/source/core/fasttokenhandler.cxx index 9925204fef46..489044bbbd97 100644 --- a/oox/source/core/fasttokenhandler.cxx +++ b/oox/source/core/fasttokenhandler.cxx @@ -24,8 +24,6 @@ #include <oox/token/tokenmap.hxx> #include <cppuhelper/supportsservice.hxx> -#include <services.hxx> - using namespace ::com::sun::star; namespace oox { diff --git a/oox/source/core/filterdetect.cxx b/oox/source/core/filterdetect.cxx index cbbaae3ed333..a2e34ecd7168 100644 --- a/oox/source/core/filterdetect.cxx +++ b/oox/source/core/filterdetect.cxx @@ -36,8 +36,6 @@ #include <com/sun/star/uri/UriReferenceFactory.hpp> -#include <services.hxx> - using namespace ::com::sun::star; namespace oox { diff --git a/oox/source/core/services.cxx b/oox/source/core/services.cxx deleted file mode 100644 index 5c18b9544767..000000000000 --- a/oox/source/core/services.cxx +++ /dev/null @@ -1,51 +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 . - */ - -#include <cppuhelper/implementationentry.hxx> - -#include <services.hxx> - -using namespace ::com::sun::star::uno; - -namespace { - -#define IMPLEMENTATION_ENTRY( className ) \ - { &className##_createInstance, &className##_getImplementationName, &className##_getSupportedServiceNames, ::cppu::createSingleComponentFactory, nullptr, 0 } - -//TODO: QuickDiagrammingImport and QuickDiagrammingLayout are not listed in -// oox/util/oox.component (and not directly referenced from anywhere in the code -// either); it is unclear whether they are dead code or whether -// a81327ff2faaf21c22f1a902bea170942d5207e6 "Import SmartArt graphics to -// Impress" would actually want to make use of them: -static ::cppu::ImplementationEntry const spServices[] = -{ - IMPLEMENTATION_ENTRY( ::oox::shape::ShapeContextHandler ), - { nullptr, nullptr, nullptr, nullptr, nullptr, 0 } -}; - -#undef IMPLEMENTATION_ENTRY - -} // namespace - -extern "C" SAL_DLLPUBLIC_EXPORT void* oox_component_getFactory( const char* pImplName, void* pServiceManager, void* pRegistryKey ) -{ - return ::cppu::component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey, spServices ); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/docprop/ooxmldocpropimport.cxx b/oox/source/docprop/ooxmldocpropimport.cxx index 6129030f7c4e..00f138f6d551 100644 --- a/oox/source/docprop/ooxmldocpropimport.cxx +++ b/oox/source/docprop/ooxmldocpropimport.cxx @@ -18,7 +18,6 @@ */ #include "ooxmldocpropimport.hxx" -#include <services.hxx> #include <vector> #include <com/sun/star/embed/ElementModes.hpp> diff --git a/oox/source/ppt/dgmimport.cxx b/oox/source/ppt/dgmimport.cxx index 2439ca6daa72..04e6e0a90788 100644 --- a/oox/source/ppt/dgmimport.cxx +++ b/oox/source/ppt/dgmimport.cxx @@ -27,8 +27,6 @@ #include <com/sun/star/drawing/XShapes.hpp> #include <com/sun/star/uno/XComponentContext.hpp> -#include <services.hxx> - using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::xml::sax; diff --git a/oox/source/ppt/dgmlayout.cxx b/oox/source/ppt/dgmlayout.cxx index 6d941dee0f4d..8857bc0da6de 100644 --- a/oox/source/ppt/dgmlayout.cxx +++ b/oox/source/ppt/dgmlayout.cxx @@ -33,8 +33,6 @@ #include <com/sun/star/xml/sax/XFastSAXSerializable.hpp> #include <com/sun/star/container/XChild.hpp> -#include <services.hxx> - using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::xml::sax; diff --git a/oox/source/ppt/pptimport.cxx b/oox/source/ppt/pptimport.cxx index 8d5a6aa03f67..bfc58430840d 100644 --- a/oox/source/ppt/pptimport.cxx +++ b/oox/source/ppt/pptimport.cxx @@ -42,8 +42,6 @@ #include <oox/ppt/presentationfragmenthandler.hxx> #include <oox/token/tokens.hxx> -#include <services.hxx> - using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::xml::sax; diff --git a/oox/source/shape/ShapeContextHandler.cxx b/oox/source/shape/ShapeContextHandler.cxx index 104f92882c27..b80af12ac15e 100644 --- a/oox/source/shape/ShapeContextHandler.cxx +++ b/oox/source/shape/ShapeContextHandler.cxx @@ -26,7 +26,6 @@ #include "LockedCanvasContext.hxx" #include "WpsContext.hxx" #include "WpgContext.hxx" -#include <services.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <oox/vml/vmldrawingfragment.hxx> #include <oox/vml/vmlshape.hxx> @@ -37,30 +36,12 @@ #include <cppuhelper/supportsservice.hxx> #include <memory> -namespace oox { namespace shape { - using namespace ::com::sun::star; + +namespace oox { namespace shape { using namespace core; using namespace drawingml; -OUString ShapeContextHandler_getImplementationName() -{ - return OUString( "com.sun.star.comp.oox.ShapeContextHandler" ); -} - -uno::Sequence< OUString > -ShapeContextHandler_getSupportedServiceNames() -{ - uno::Sequence< OUString > s { "com.sun.star.xml.sax.FastShapeContextHandler" }; - return s; -} - -uno::Reference< uno::XInterface > -ShapeContextHandler_createInstance( const uno::Reference< uno::XComponentContext > & context) -{ - return static_cast< ::cppu::OWeakObject* >( new ShapeContextHandler(context) ); -} - ShapeContextHandler::ShapeContextHandler(uno::Reference< uno::XComponentContext > const & context) : mnStartToken(0) { @@ -616,12 +597,13 @@ void SAL_CALL ShapeContextHandler::setMediaDescriptor(const uno::Sequence<beans: OUString ShapeContextHandler::getImplementationName() { - return ShapeContextHandler_getImplementationName(); + return OUString( "com.sun.star.comp.oox.ShapeContextHandler" ); } uno::Sequence< OUString > ShapeContextHandler::getSupportedServiceNames() { - return ShapeContextHandler_getSupportedServiceNames(); + uno::Sequence< OUString > s { "com.sun.star.xml.sax.FastShapeContextHandler" }; + return s; } sal_Bool SAL_CALL ShapeContextHandler::supportsService(const OUString & ServiceName) @@ -631,4 +613,11 @@ sal_Bool SAL_CALL ShapeContextHandler::supportsService(const OUString & ServiceN }} +extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface* +com_sun_star_comp_oox_ShapeContextHandler_get_implementation( + uno::XComponentContext* pCtx, uno::Sequence<uno::Any> const& /*rSeq*/) +{ + return cppu::acquire(new oox::shape::ShapeContextHandler(pCtx)); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/util/oox.component b/oox/util/oox.component index 09952c7abdf4..32a8100b8fb8 100644 --- a/oox/util/oox.component +++ b/oox/util/oox.component @@ -18,7 +18,7 @@ --> <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@" - prefix="oox" xmlns="http://openoffice.org/2010/uno-components"> + xmlns="http://openoffice.org/2010/uno-components"> <implementation name="com.sun.star.comp.oox.core.FastTokenHandler" constructor="com_sun_star_comp_oox_core_FastTokenHandler_get_implementation"> <service name="com.sun.star.xml.sax.FastTokenHandler"/> @@ -36,7 +36,8 @@ <service name="com.sun.star.document.ImportFilter"/> <service name="com.sun.star.document.ExportFilter"/> </implementation> - <implementation name="com.sun.star.comp.oox.ShapeContextHandler"> + <implementation name="com.sun.star.comp.oox.ShapeContextHandler" + constructor="com_sun_star_comp_oox_ShapeContextHandler_get_implementation"> <service name="com.sun.star.xml.sax.FastShapeContextHandler"/> </implementation> </component> |