[Libreoffice-commits] core.git: solenv/bin solenv/clang-format xmloff/inc xmloff/Library_xo.mk xmloff/source xmloff/util

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Wed Jun 10 07:28:20 UTC 2020


 solenv/bin/native-code.py                     |    1 
 solenv/clang-format/blacklist                 |    2 
 xmloff/Library_xo.mk                          |    1 
 xmloff/inc/facreg.hxx                         |   43 ---------------
 xmloff/inc/pch/precompiled_xo.hxx             |    1 
 xmloff/source/chart/SchXMLExport.cxx          |    1 
 xmloff/source/chart/SchXMLImport.cxx          |    1 
 xmloff/source/core/facreg.cxx                 |   71 --------------------------
 xmloff/source/draw/animationimport.cxx        |    1 
 xmloff/source/draw/sdxmlexp.cxx               |    1 
 xmloff/source/meta/MetaExportComponent.cxx    |    1 
 xmloff/source/text/XMLAutoTextEventExport.cxx |   24 ++------
 xmloff/source/text/XMLAutoTextEventImport.cxx |    1 
 xmloff/util/xo.component                      |    3 -
 14 files changed, 9 insertions(+), 143 deletions(-)

New commits:
commit 192721b6c7698d1db2d9d404c6f30b2eb9224796
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Tue Jun 9 21:10:34 2020 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Wed Jun 10 09:27:48 2020 +0200

    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 at collabora.com>

diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index ce4fcdec6d1f..d828d81630a4 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -338,6 +338,7 @@ core_constructor_list = [
     "com_sun_star_comp_Chart_XMLOasisContentImporter_get_implementation",
     "com_sun_star_comp_Chart_XMLOasisExporter_get_implementation",
     "com_sun_star_comp_Writer_XMLOasisAutotextEventsExporter_get_implementation",
+    "com_sun_star_comp_Writer_XMLAutotextEventsExporter_get_implementation",
     "com_sun_star_comp_Writer_XMLOasisAutotextEventsImporter_get_implementation",
 # xmlscript/util/xmlscript.component
     "com_sun_star_comp_xmlscript_XMLBasicExporter",
diff --git a/solenv/clang-format/blacklist b/solenv/clang-format/blacklist
index a9c77a4b8c10..566479f935ad 100644
--- a/solenv/clang-format/blacklist
+++ b/solenv/clang-format/blacklist
@@ -17789,7 +17789,6 @@ xmloff/inc/XMLTextColumnsPropertyHandler.hxx
 xmloff/inc/XMLTextHeaderFooterContext.hxx
 xmloff/inc/animationimport.hxx
 xmloff/inc/animimp.hxx
-xmloff/inc/facreg.hxx
 xmloff/inc/fasttokenhandler.hxx
 xmloff/inc/forms/form_handler_factory.hxx
 xmloff/inc/forms/property_handler.hxx
@@ -17881,7 +17880,6 @@ xmloff/source/core/XMLBasicExportFilter.cxx
 xmloff/source/core/XMLEmbeddedObjectExportFilter.cxx
 xmloff/source/core/XMLEmbeddedObjectImportContext.cxx
 xmloff/source/core/attrlist.cxx
-xmloff/source/core/facreg.cxx
 xmloff/source/core/fasttokenhandler.cxx
 xmloff/source/core/i18nmap.cxx
 xmloff/source/core/nmspmap.cxx
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


More information about the Libreoffice-commits mailing list