summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-06-09 21:10:34 +0200
committerMiklos Vajna <vmiklos@collabora.com>2020-06-10 09:27:48 +0200
commit192721b6c7698d1db2d9d404c6f30b2eb9224796 (patch)
tree7772e1117701c121d4f0432b07bd92cd15a47df4 /xmloff
parenta3b65fdb439560b3917f880629ed0737368c8f5c (diff)
xmloff: create XMLAutoTextEventExportOOO instances with an uno constructor
See tdf#74608 for motivation. Change-Id: Ibb3bc2afba00ff962e3ed4f14a5e5a3c735a1a29 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95963 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/Library_xo.mk1
-rw-r--r--xmloff/inc/facreg.hxx43
-rw-r--r--xmloff/inc/pch/precompiled_xo.hxx1
-rw-r--r--xmloff/source/chart/SchXMLExport.cxx1
-rw-r--r--xmloff/source/chart/SchXMLImport.cxx1
-rw-r--r--xmloff/source/core/facreg.cxx71
-rw-r--r--xmloff/source/draw/animationimport.cxx1
-rw-r--r--xmloff/source/draw/sdxmlexp.cxx1
-rw-r--r--xmloff/source/meta/MetaExportComponent.cxx1
-rw-r--r--xmloff/source/text/XMLAutoTextEventExport.cxx24
-rw-r--r--xmloff/source/text/XMLAutoTextEventImport.cxx1
-rw-r--r--xmloff/util/xo.component3
12 files changed, 8 insertions, 141 deletions
diff --git a/xmloff/Library_xo.mk b/xmloff/Library_xo.mk
index 3ea643c4be8f..d101fb6a02e8 100644
--- a/xmloff/Library_xo.mk
+++ b/xmloff/Library_xo.mk
@@ -104,7 +104,6 @@ $(eval $(call gb_Library_add_exception_objects,xo,\
xmloff/source/core/XMLEmbeddedObjectExportFilter \
xmloff/source/core/XMLEmbeddedObjectImportContext \
xmloff/source/core/attrlist \
- xmloff/source/core/facreg \
xmloff/source/core/i18nmap \
xmloff/source/core/nmspmap \
xmloff/source/core/unoatrcn \
diff --git a/xmloff/inc/facreg.hxx b/xmloff/inc/facreg.hxx
deleted file mode 100644
index 2a98fb344721..000000000000
--- a/xmloff/inc/facreg.hxx
+++ /dev/null
@@ -1,43 +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_XMLOFF_INC_FACREG_HXX
-#define INCLUDED_XMLOFF_INC_FACREG_HXX
-
-#include <sal/config.h>
-
-#include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
-#include <rtl/ustring.hxx>
-
-namespace com::sun::star {
- namespace lang { class XMultiServiceFactory; }
- namespace uno { class XInterface; }
-}
-
-// writer autotext event export OOo
-OUString XMLAutoTextEventExportOOO_getImplementationName() throw();
-css::uno::Sequence<OUString> XMLAutoTextEventExportOOO_getSupportedServiceNames() throw();
-/// @throws css::uno::Exception
-css::uno::Reference<css::uno::XInterface> XMLAutoTextEventExportOOO_createInstance(
- css::uno::Reference<css::lang::XMultiServiceFactory> const & rSMgr);
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/inc/pch/precompiled_xo.hxx b/xmloff/inc/pch/precompiled_xo.hxx
index aec33d71a5b3..bd99331f986b 100644
--- a/xmloff/inc/pch/precompiled_xo.hxx
+++ b/xmloff/inc/pch/precompiled_xo.hxx
@@ -197,7 +197,6 @@
#if PCH_LEVEL >= 4
#include <PageMasterStyleMap.hxx>
#include <XMLStringBufferImportContext.hxx>
-#include <facreg.hxx>
#include <xexptran.hxx>
#include <xmloff/ProgressBarHelper.hxx>
#include <xmloff/XMLBase64ImportContext.hxx>
diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx
index 6ddc083b5db5..12e97512e615 100644
--- a/xmloff/source/chart/SchXMLExport.cxx
+++ b/xmloff/source/chart/SchXMLExport.cxx
@@ -30,7 +30,6 @@
#include "ColorPropertySet.hxx"
#include "SchXMLTools.hxx"
#include "SchXMLEnumConverter.hxx"
-#include <facreg.hxx>
#include <comphelper/processfactory.hxx>
#include <tools/globname.hxx>
diff --git a/xmloff/source/chart/SchXMLImport.cxx b/xmloff/source/chart/SchXMLImport.cxx
index e03a2d3c203c..e44e908c365c 100644
--- a/xmloff/source/chart/SchXMLImport.cxx
+++ b/xmloff/source/chart/SchXMLImport.cxx
@@ -21,7 +21,6 @@
#include "SchXMLChartContext.hxx"
#include "contexts.hxx"
#include "SchXMLTools.hxx"
-#include <facreg.hxx>
#include <sal/log.hxx>
#include <comphelper/processfactory.hxx>
diff --git a/xmloff/source/core/facreg.cxx b/xmloff/source/core/facreg.cxx
deleted file mode 100644
index cdc52d6c6a6e..000000000000
--- a/xmloff/source/core/facreg.cxx
+++ /dev/null
@@ -1,71 +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 <sal/config.h>
-
-#include <xmloff/dllapi.h>
-
-#include <string.h>
-#include <com/sun/star/lang/XSingleServiceFactory.hpp>
-
-#include <cppuhelper/factory.hxx>
-
-#include <facreg.hxx>
-
-using namespace com::sun::star;
-
-extern "C"
-{
-
-#define SINGLEFACTORY(classname)\
- if( classname##_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )\
- {\
- xFactory = ::cppu::createSingleFactory( xMSF,\
- classname##_getImplementationName(),\
- classname##_createInstance,\
- classname##_getSupportedServiceNames() );\
- }
-
-XMLOFF_DLLPUBLIC void * xo_component_getFactory( const char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ )
-{
- void * pRet = nullptr;
- if( pServiceManager )
- {
- uno::Reference< lang::XMultiServiceFactory > xMSF( static_cast< lang::XMultiServiceFactory * >( pServiceManager ) );
-
- uno::Reference< lang::XSingleServiceFactory > xFactory;
-
- const sal_Int32 nImplNameLen = strlen( pImplName );
-
- // auto text export
- SINGLEFACTORY( XMLAutoTextEventExportOOO )
-
- if( xFactory.is())
- {
- xFactory->acquire();
- pRet = xFactory.get();
- }
- }
- return pRet;
-}
-
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/source/draw/animationimport.cxx b/xmloff/source/draw/animationimport.cxx
index ebccff3d1a22..b05d6e398b79 100644
--- a/xmloff/source/draw/animationimport.cxx
+++ b/xmloff/source/draw/animationimport.cxx
@@ -63,7 +63,6 @@
#include <osl/diagnose.h>
#include <xmloff/nmspmap.hxx>
#include <xmloff/xmlprhdl.hxx>
-#include <facreg.hxx>
#include <xmlsdtypes.hxx>
#include <animations.hxx>
diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx
index 99c5fcc4917d..417aac6d75c2 100644
--- a/xmloff/source/draw/sdxmlexp.cxx
+++ b/xmloff/source/draw/sdxmlexp.cxx
@@ -58,7 +58,6 @@
#include <xmloff/ProgressBarHelper.hxx>
#include "sdpropls.hxx"
#include <xmloff/xmlexppr.hxx>
-#include <facreg.hxx>
#include <comphelper/processfactory.hxx>
#include <PropertySetMerger.hxx>
diff --git a/xmloff/source/meta/MetaExportComponent.cxx b/xmloff/source/meta/MetaExportComponent.cxx
index 228de2fe94e9..218918183511 100644
--- a/xmloff/source/meta/MetaExportComponent.cxx
+++ b/xmloff/source/meta/MetaExportComponent.cxx
@@ -18,7 +18,6 @@
*/
#include <MetaExportComponent.hxx>
-#include <facreg.hxx>
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/uno/Sequence.hxx>
diff --git a/xmloff/source/text/XMLAutoTextEventExport.cxx b/xmloff/source/text/XMLAutoTextEventExport.cxx
index e5e1b220cb1f..5afa1f19ef61 100644
--- a/xmloff/source/text/XMLAutoTextEventExport.cxx
+++ b/xmloff/source/text/XMLAutoTextEventExport.cxx
@@ -18,7 +18,6 @@
*/
#include "XMLAutoTextEventExport.hxx"
-#include <facreg.hxx>
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
#include <com/sun/star/util/MeasureUnit.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -208,24 +207,13 @@ com_sun_star_comp_Writer_XMLOasisAutotextEventsExporter_get_implementation(
SvXMLExportFlags::ALL | SvXMLExportFlags::OASIS));
}
-// methods to support the component registration
-
-Sequence< OUString > XMLAutoTextEventExportOOO_getSupportedServiceNames()
- throw()
-{
- Sequence<OUString> aSeq { XMLAutoTextEventExportOOO_getImplementationName() };
- return aSeq;
-}
-
-OUString XMLAutoTextEventExportOOO_getImplementationName() throw()
-{
- return "com.sun.star.comp.Writer.XMLAutotextEventsExporter";
-}
-
-Reference< XInterface > XMLAutoTextEventExportOOO_createInstance(
- const Reference< XMultiServiceFactory > & rSMgr)
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+com_sun_star_comp_Writer_XMLAutotextEventsExporter_get_implementation(
+ css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
{
- return static_cast<cppu::OWeakObject*>(new XMLAutoTextEventExport( comphelper::getComponentContext(rSMgr), XMLAutoTextEventExportOOO_getImplementationName(), SvXMLExportFlags::ALL));
+ return cppu::acquire(new XMLAutoTextEventExport(
+ context, "com.sun.star.comp.Writer.XMLAutotextEventsExporter",
+ SvXMLExportFlags::ALL));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/source/text/XMLAutoTextEventImport.cxx b/xmloff/source/text/XMLAutoTextEventImport.cxx
index bf6b9af0118d..54b28273fe81 100644
--- a/xmloff/source/text/XMLAutoTextEventImport.cxx
+++ b/xmloff/source/text/XMLAutoTextEventImport.cxx
@@ -23,7 +23,6 @@
#include <com/sun/star/document/XEventsSupplier.hpp>
#include <com/sun/star/uno/XInterface.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <facreg.hxx>
#include "XMLAutoTextContainerEventImport.hxx"
#include <xmloff/xmlnmspe.hxx>
#include <xmloff/xmltoken.hxx>
diff --git a/xmloff/util/xo.component b/xmloff/util/xo.component
index 2e43c129673d..f0130e8cd84d 100644
--- a/xmloff/util/xo.component
+++ b/xmloff/util/xo.component
@@ -207,7 +207,8 @@
constructor="XMLVersionListPersistence_get_implementation">
<service name="com.sun.star.document.DocumentRevisionListPersistence"/>
</implementation>
- <implementation name="com.sun.star.comp.Writer.XMLAutotextEventsExporter">
+ <implementation name="com.sun.star.comp.Writer.XMLAutotextEventsExporter"
+ constructor="com_sun_star_comp_Writer_XMLAutotextEventsExporter_get_implementation">
<service name="com.sun.star.comp.Writer.XMLAutotextEventsExporter"/>
</implementation>
<implementation