Kaydet (Commit) ff4a319f authored tarafından Miklos Vajna's avatar Miklos Vajna

oox: create ShapeContextHandler instances with an uno constructor

Change-Id: Ie780ff9f3a8c61d13ad10cc2dbe24d3ec165470e
Reviewed-on: https://gerrit.libreoffice.org/61063Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins
üst 1e6b6f03
......@@ -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 \
......
......@@ -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>
......
/* -*- 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: */
......@@ -24,8 +24,6 @@
#include <oox/token/tokenmap.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <services.hxx>
using namespace ::com::sun::star;
namespace oox {
......
......@@ -36,8 +36,6 @@
#include <com/sun/star/uri/UriReferenceFactory.hpp>
#include <services.hxx>
using namespace ::com::sun::star;
namespace oox {
......
/* -*- 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: */
......@@ -18,7 +18,6 @@
*/
#include "ooxmldocpropimport.hxx"
#include <services.hxx>
#include <vector>
#include <com/sun/star/embed/ElementModes.hpp>
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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: */
......@@ -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>
......@@ -36,7 +36,6 @@ core_factory_list = [
("liblnglo.a", "lng_component_getFactory"),
("liblnthlo.a", "lnth_component_getFactory"),
("liblocalebe1lo.a", "localebe1_component_getFactory"),
("libooxlo.a", "oox_component_getFactory"),
("libpackage2.a", "package2_component_getFactory"),
("libsmlo.a", "sm_component_getFactory"),
("libsrtrs1.a", "srtrs1_component_getFactory"),
......@@ -257,6 +256,7 @@ core_constructor_list = [
"com_sun_star_comp_oox_FormatDetector_get_implementation",
"com_sun_star_comp_oox_docprop_DocumentPropertiesImporter_get_implementation",
"com_sun_star_comp_oox_ppt_PowerPointImport_get_implementation",
"com_sun_star_comp_oox_ShapeContextHandler_get_implementation"
]
# edit group for apps, where you can edit documents
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment