summaryrefslogtreecommitdiff
path: root/reportdesign
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2020-07-22 21:21:20 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-07-24 08:32:55 +0200
commitae5afcea076d2e90dcc48771c1008320f0334f06 (patch)
tree0f00188ef71b705ef41acfe7292f207416c46057 /reportdesign
parentd5e37fd8461cd07eeb0cbc69464fc106c5ef16b4 (diff)
reportdesign: create instances with uno constructors
See tdf#74608 for motivation. Also delete dead .component file Change-Id: I682009587e116bde88e43e80875f8051414ba447 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99257 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'reportdesign')
-rw-r--r--reportdesign/Library_rptxml.mk1
-rw-r--r--reportdesign/source/filter/xml/dbloader2.cxx23
-rw-r--r--reportdesign/source/filter/xml/dbloader2.hxx17
-rw-r--r--reportdesign/source/filter/xml/rptxml.component58
-rw-r--r--reportdesign/source/filter/xml/xmlExport.cxx142
-rw-r--r--reportdesign/source/filter/xml/xmlExport.hxx80
-rw-r--r--reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx29
-rw-r--r--reportdesign/source/filter/xml/xmlExportDocumentHandler.hxx8
-rw-r--r--reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx20
-rw-r--r--reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx8
-rw-r--r--reportdesign/source/filter/xml/xmlfilter.cxx120
-rw-r--r--reportdesign/source/filter/xml/xmlfilter.hxx69
-rw-r--r--reportdesign/source/filter/xml/xmlservices.cxx80
-rw-r--r--reportdesign/util/rptxml.component44
14 files changed, 162 insertions, 537 deletions
diff --git a/reportdesign/Library_rptxml.mk b/reportdesign/Library_rptxml.mk
index 244815408fae..dff99605f0bc 100644
--- a/reportdesign/Library_rptxml.mk
+++ b/reportdesign/Library_rptxml.mk
@@ -69,7 +69,6 @@ $(eval $(call gb_Library_add_exception_objects,rptxml,\
reportdesign/source/filter/xml/xmlReportElement \
reportdesign/source/filter/xml/xmlReportElementBase \
reportdesign/source/filter/xml/xmlSection \
- reportdesign/source/filter/xml/xmlservices \
reportdesign/source/filter/xml/xmlStyleImport \
reportdesign/source/filter/xml/xmlSubDocument \
reportdesign/source/filter/xml/xmlTable \
diff --git a/reportdesign/source/filter/xml/dbloader2.cxx b/reportdesign/source/filter/xml/dbloader2.cxx
index 92fcdc8f0342..67ba9b489470 100644
--- a/reportdesign/source/filter/xml/dbloader2.cxx
+++ b/reportdesign/source/filter/xml/dbloader2.cxx
@@ -77,16 +77,10 @@ OUString SAL_CALL ORptTypeDetection::detect( Sequence< css::beans::PropertyValue
return OUString();
}
-Reference< XInterface >
- ORptTypeDetection::create(Reference< XComponentContext > const & xContext)
-{
- return *(new ORptTypeDetection(xContext));
-}
-
// XServiceInfo
OUString SAL_CALL ORptTypeDetection::getImplementationName()
{
- return getImplementationName_Static();
+ return "com.sun.star.comp.report.ORptTypeDetection";
}
@@ -99,18 +93,19 @@ sal_Bool SAL_CALL ORptTypeDetection::supportsService(const OUString& ServiceName
// XServiceInfo
Sequence< OUString > SAL_CALL ORptTypeDetection::getSupportedServiceNames()
{
- return getSupportedServiceNames_Static();
+ return { "com.sun.star.document.ExtendedTypeDetection" };
}
-// ORegistryServiceManager_Static
-Sequence< OUString > ORptTypeDetection::getSupportedServiceNames_Static()
+
+}//rptxml
+
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+reportdesign_ORptTypeDetection_get_implementation(
+ css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
{
- Sequence<OUString> aSNS { "com.sun.star.document.ExtendedTypeDetection" };
- return aSNS;
+ return cppu::acquire(new rptxml::ORptTypeDetection(context));
}
-}//rptxml
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/reportdesign/source/filter/xml/dbloader2.hxx b/reportdesign/source/filter/xml/dbloader2.hxx
index 59da948ef826..3f5d3d8770ea 100644
--- a/reportdesign/source/filter/xml/dbloader2.hxx
+++ b/reportdesign/source/filter/xml/dbloader2.hxx
@@ -29,28 +29,17 @@
namespace rptxml
{
- class ORptTypeDetection : public ::cppu::WeakImplHelper< css::document::XExtendedFilterDetection, css::lang::XServiceInfo>
+class ORptTypeDetection : public ::cppu::WeakImplHelper< css::document::XExtendedFilterDetection, css::lang::XServiceInfo>
{
css::uno::Reference< css::uno::XComponentContext > m_xContext;
public:
explicit ORptTypeDetection(css::uno::Reference< css::uno::XComponentContext > const & xContext);
// XServiceInfo
- OUString SAL_CALL getImplementationName() override;
- sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
+ OUString SAL_CALL getImplementationName() override;
+ sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
- // static methods
- /// @throws css::uno::RuntimeException
- static OUString getImplementationName_Static()
- {
- return "com.sun.star.comp.report.ORptTypeDetection";
- }
- /// @throws css::uno::RuntimeException
- static css::uno::Sequence< OUString > getSupportedServiceNames_Static();
- static css::uno::Reference< css::uno::XInterface >
- create(css::uno::Reference< css::uno::XComponentContext > const & xContext);
-
virtual OUString SAL_CALL detect( css::uno::Sequence< css::beans::PropertyValue >& Descriptor ) override;
};
}
diff --git a/reportdesign/source/filter/xml/rptxml.component b/reportdesign/source/filter/xml/rptxml.component
deleted file mode 100644
index 8f48bbbe2f0f..000000000000
--- a/reportdesign/source/filter/xml/rptxml.component
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * 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 .
- -->
-
-<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
- xmlns="http://openoffice.org/2010/uno-components">
- <implementation name="com.sun.star.comp.report.XMLSettingsExporter">
- <service name="com.sun.star.document.ExportFilter"/>
- </implementation>
- <implementation name="com.sun.star.comp.report.XMLContentExporter">
- <service name="com.sun.star.document.ExportFilter"/>
- </implementation>
- <implementation name="com.sun.star.comp.report.XMLStylesExporter">
- <service name="com.sun.star.document.ExportFilter"/>
- </implementation>
- <implementation name="com.sun.star.comp.report.XMLMetaExporter">
- <service name="com.sun.star.document.ExportFilter"/>
- </implementation>
- <implementation name="com.sun.star.comp.report.XMLFullExporter">
- <service name="com.sun.star.document.ExportFilter"/>
- </implementation>
- <implementation name="com.sun.star.comp.report.ExportFilter">
- <service name="com.sun.star.document.ExportFilter"/>
- </implementation>
- <implementation name="com.sun.star.comp.report.ORptTypeDetection">
- <service name="com.sun.star.document.ExtendedTypeDetection"/>
- </implementation>
- <implementation name="com.sun.star.comp.Report.XMLOasisSettingsImporter">
- <service name="com.sun.star.document.ImportFilter"/>
- </implementation>
- <implementation name="com.sun.star.comp.Report.XMLOasisStylesImporter">
- <service name="com.sun.star.document.ImportFilter"/>
- </implementation>
- <implementation name="com.sun.star.comp.Report.XMLOasisContentImporter">
- <service name="com.sun.star.document.ImportFilter"/>
- </implementation>
- <implementation name="com.sun.star.comp.Report.XMLOasisMetaImporter">
- <service name="com.sun.star.document.ImportFilter"/>
- </implementation>
- <implementation name="com.sun.star.comp.report.OReportFilter">
- <service name="com.sun.star.document.ImportFilter"/>
- </implementation>
-</component>
diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx
index bd93ff3a54e7..5dcdecef5cb9 100644
--- a/reportdesign/source/filter/xml/xmlExport.cxx
+++ b/reportdesign/source/filter/xml/xmlExport.cxx
@@ -60,88 +60,70 @@ namespace rptxml
using namespace ::com::sun::star::xml;
- Reference< XInterface > ORptExportHelper::create(Reference< XComponentContext > const & xContext)
+ /** Exports only settings
+ * \ingroup reportdesign_source_filter_xml
+ *
+ */
+ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+ reportdesign_ORptExportHelper_get_implementation(
+ css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
{
- return static_cast< XServiceInfo* >(new ORptExport(xContext, getImplementationName_Static(), SvXMLExportFlags::SETTINGS ));
+ return cppu::acquire(new ORptExport(context,
+ "com.sun.star.comp.report.XMLSettingsExporter",
+ SvXMLExportFlags::SETTINGS ));
}
- OUString ORptExportHelper::getImplementationName_Static( )
+ /** Exports only content
+ * \ingroup reportdesign_source_filter_xml
+ *
+ */
+ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+ reportdesign_ORptContentExportHelper_get_implementation(
+ css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
{
- return "com.sun.star.comp.report.XMLSettingsExporter";
+ return cppu::acquire(new ORptExport(context,
+ "com.sun.star.comp.report.XMLContentExporter",
+ SvXMLExportFlags::CONTENT ));
}
- Sequence< OUString > ORptExportHelper::getSupportedServiceNames_Static( )
+ /** Exports only styles
+ * \ingroup reportdesign_source_filter_xml
+ *
+ */
+ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+ reportdesign_ORptStylesExportHelper_get_implementation(
+ css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
{
- Sequence< OUString > aSupported { "com.sun.star.document.ExportFilter" };
- return aSupported;
+ return cppu::acquire(new ORptExport(context,
+ "com.sun.star.comp.report.XMLStylesExporter",
+ SvXMLExportFlags::STYLES | SvXMLExportFlags::MASTERSTYLES | SvXMLExportFlags::AUTOSTYLES |
+ SvXMLExportFlags::FONTDECLS|SvXMLExportFlags::OASIS ));
}
- Reference< XInterface > ORptContentExportHelper::create(Reference< XComponentContext > const & xContext)
+ /** Exports only meta data
+ * \ingroup reportdesign_source_filter_xml
+ *
+ */
+ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+ reportdesign_ORptMetaExportHelper_get_implementation(
+ css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
{
- return static_cast< XServiceInfo* >(new ORptExport(xContext, getImplementationName_Static(), SvXMLExportFlags::CONTENT ));
+ return cppu::acquire(new ORptExport(context,
+ "com.sun.star.comp.report.XMLMetaExporter",
+ SvXMLExportFlags::META ));
}
- OUString ORptContentExportHelper::getImplementationName_Static( )
+ /** Exports all
+ * \ingroup reportdesign_source_filter_xml
+ *
+ */
+ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+ reportdesign_ODBFullExportHelper_get_implementation(
+ css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
{
- return "com.sun.star.comp.report.XMLContentExporter";
- }
-
- Sequence< OUString > ORptContentExportHelper::getSupportedServiceNames_Static( )
- {
- Sequence< OUString > aSupported { "com.sun.star.document.ExportFilter" };
- return aSupported;
- }
-
-
- Reference< XInterface > ORptStylesExportHelper::create(Reference< XComponentContext > const & xContext)
- {
- return static_cast< XServiceInfo* >(new ORptExport(xContext, getImplementationName_Static(), SvXMLExportFlags::STYLES | SvXMLExportFlags::MASTERSTYLES | SvXMLExportFlags::AUTOSTYLES |
- SvXMLExportFlags::FONTDECLS|SvXMLExportFlags::OASIS ));
- }
-
- OUString ORptStylesExportHelper::getImplementationName_Static( )
- {
- return "com.sun.star.comp.report.XMLStylesExporter";
- }
-
- Sequence< OUString > ORptStylesExportHelper::getSupportedServiceNames_Static( )
- {
- Sequence< OUString > aSupported { "com.sun.star.document.ExportFilter" };
- return aSupported;
- }
-
-
- Reference< XInterface > ORptMetaExportHelper::create(Reference< XComponentContext > const & xContext)
- {
- return static_cast< XServiceInfo* >(new ORptExport(xContext, getImplementationName_Static(), SvXMLExportFlags::META ));
- }
-
- OUString ORptMetaExportHelper::getImplementationName_Static( )
- {
- return "com.sun.star.comp.report.XMLMetaExporter";
- }
-
- Sequence< OUString > ORptMetaExportHelper::getSupportedServiceNames_Static( )
- {
- Sequence< OUString > aSupported { "com.sun.star.document.ExportFilter" };
- return aSupported;
- }
-
-
- Reference< XInterface > ODBFullExportHelper::create(Reference< XComponentContext > const & xContext)
- {
- return static_cast< XServiceInfo* >(new ORptExport(xContext, getImplementationName_Static(), SvXMLExportFlags::ALL));
- }
-
- OUString ODBFullExportHelper::getImplementationName_Static( )
- {
- return "com.sun.star.comp.report.XMLFullExporter";
- }
-
- Sequence< OUString > ODBFullExportHelper::getSupportedServiceNames_Static( )
- {
- Sequence< OUString > aSupported { "com.sun.star.document.ExportFilter" };
- return aSupported;
+ return cppu::acquire(new ORptExport(context,
+ "com.sun.star.comp.report.XMLFullExporter",
+ SvXMLExportFlags::ALL));
}
namespace {
@@ -291,23 +273,13 @@ ORptExport::ORptExport(const Reference< XComponentContext >& _rxContext, OUStrin
m_xTableStylesExportPropertySetMapper, XML_STYLE_FAMILY_TABLE_TABLE_STYLES_PREFIX);
}
-Reference< XInterface > ORptExport::create(Reference< XComponentContext > const & xContext)
-{
- return *(new ORptExport(xContext, getImplementationName_Static(), SvXMLExportFlags::CONTENT | SvXMLExportFlags::AUTOSTYLES | SvXMLExportFlags::FONTDECLS));
-}
-
-
-OUString ORptExport::getImplementationName_Static( )
-{
- return "com.sun.star.comp.report.ExportFilter";
-}
-
-
-uno::Sequence< OUString > ORptExport::getSupportedServiceNames_Static( )
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+reportdesign_ORptExport_get_implementation(
+ css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
{
- uno::Sequence< OUString > aServices { "com.sun.star.document.ExportFilter" };
-
- return aServices;
+ return cppu::acquire(new ORptExport(context,
+ "com.sun.star.comp.report.ExportFilter",
+ SvXMLExportFlags::CONTENT | SvXMLExportFlags::AUTOSTYLES | SvXMLExportFlags::FONTDECLS));
}
diff --git a/reportdesign/source/filter/xml/xmlExport.hxx b/reportdesign/source/filter/xml/xmlExport.hxx
index baf4fc401d84..348bb75a2b9c 100644
--- a/reportdesign/source/filter/xml/xmlExport.hxx
+++ b/reportdesign/source/filter/xml/xmlExport.hxx
@@ -145,13 +145,6 @@ public:
ORptExport(const Reference< XComponentContext >& _rxContext, OUString const & implementationName, SvXMLExportFlags nExportFlag);
- /// @throws css::uno::RuntimeException
- static css::uno::Sequence< OUString > getSupportedServiceNames_Static();
- /// @throws css::uno::RuntimeException
- static OUString getImplementationName_Static();
- static css::uno::Reference< css::uno::XInterface >
- create(css::uno::Reference< css::uno::XComponentContext > const & xContext);
-
// XExporter
virtual void SAL_CALL setSourceDocument( const css::uno::Reference< css::lang::XComponent >& xDoc ) override;
@@ -160,79 +153,6 @@ public:
const rtl::Reference < XMLPropertySetMapper >& GetCellStylePropertyMapper() const { return m_xCellStylesPropertySetMapper;}
};
-/** Exports only settings
- * \ingroup reportdesign_source_filter_xml
- *
- */
-class ORptExportHelper
-{
-public:
- /// @throws css::uno::RuntimeException
- static OUString getImplementationName_Static( );
- /// @throws css::uno::RuntimeException
- static Sequence< OUString > getSupportedServiceNames_Static( );
- static css::uno::Reference< css::uno::XInterface >
- create(css::uno::Reference< css::uno::XComponentContext > const & xContext);
-};
-
-/** Exports only content
- * \ingroup reportdesign_source_filter_xml
- *
- */
-class ORptContentExportHelper
-{
-public:
- /// @throws css::uno::RuntimeException
- static OUString getImplementationName_Static( );
- /// @throws css::uno::RuntimeException
- static Sequence< OUString > getSupportedServiceNames_Static( );
- static css::uno::Reference< css::uno::XInterface >
- create(css::uno::Reference< css::uno::XComponentContext > const & xContext);
-};
-
-/** Exports only styles
- * \ingroup reportdesign_source_filter_xml
- *
- */
-class ORptStylesExportHelper
-{
-public:
- /// @throws css::uno::RuntimeException
- static OUString getImplementationName_Static( );
- /// @throws css::uno::RuntimeException
- static Sequence< OUString > getSupportedServiceNames_Static( );
- static css::uno::Reference< css::uno::XInterface >
- create(css::uno::Reference< css::uno::XComponentContext > const & xContext);
-};
-
-/** Exports only meta data
- * \ingroup reportdesign_source_filter_xml
- *
- */
-class ORptMetaExportHelper
-{
-public:
- /// @throws css::uno::RuntimeException
- static OUString getImplementationName_Static( );
- /// @throws css::uno::RuntimeException
- static Sequence< OUString > getSupportedServiceNames_Static( );
- static css::uno::Reference< css::uno::XInterface >
- create(css::uno::Reference< css::uno::XComponentContext > const & xContext);
-};
-/** Exports all
- * \ingroup reportdesign_source_filter_xml
- *
- */
-class ODBFullExportHelper
-{
-public:
- /// @throws css::uno::RuntimeException
- static OUString getImplementationName_Static( );
- /// @throws css::uno::RuntimeException
- static Sequence< OUString > getSupportedServiceNames_Static( );
- static css::uno::Reference< css::uno::XInterface >
- create(css::uno::Reference< css::uno::XComponentContext > const & xContext);
-};
} // rptxml
diff --git a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx
index 7ba132baf335..5e02ded4d7b9 100644
--- a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx
+++ b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx
@@ -90,7 +90,7 @@ IMPLEMENT_GET_IMPLEMENTATION_ID(ExportDocumentHandler)
OUString SAL_CALL ExportDocumentHandler::getImplementationName( )
{
- return getImplementationName_Static();
+ return "com.sun.star.comp.report.ExportDocumentHandler";
}
sal_Bool SAL_CALL ExportDocumentHandler::supportsService( const OUString& ServiceName )
@@ -103,26 +103,9 @@ uno::Sequence< OUString > SAL_CALL ExportDocumentHandler::getSupportedServiceNam
uno::Sequence< OUString > aSupported;
if ( m_xServiceInfo.is() )
aSupported = m_xServiceInfo->getSupportedServiceNames();
- return ::comphelper::concatSequences(getSupportedServiceNames_static(),aSupported);
-}
-
-OUString ExportDocumentHandler::getImplementationName_Static( )
-{
- return "com.sun.star.comp.report.ExportDocumentHandler";
-}
-
-
-uno::Sequence< OUString > ExportDocumentHandler::getSupportedServiceNames_static( )
-{
- uno::Sequence< OUString > aSupported { "com.sun.star.report.ExportDocumentHandler" };
- return aSupported;
+ return ::comphelper::concatSequences(uno::Sequence< OUString > { "com.sun.star.report.ExportDocumentHandler" },aSupported);
}
-
-uno::Reference< uno::XInterface > ExportDocumentHandler::create( const uno::Reference< uno::XComponentContext >& _rxContext )
-{
- return *(new ExportDocumentHandler( _rxContext ));
-}
// xml::sax::XDocumentHandler:
void SAL_CALL ExportDocumentHandler::startDocument()
{
@@ -419,4 +402,12 @@ void ExportDocumentHandler::exportTableRows()
} // namespace rptxml
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+reportdesign_ExportDocumentHandler_get_implementation(
+ css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
+{
+ return cppu::acquire(new rptxml::ExportDocumentHandler(context));
+}
+
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/reportdesign/source/filter/xml/xmlExportDocumentHandler.hxx b/reportdesign/source/filter/xml/xmlExportDocumentHandler.hxx
index 25fc2ad8ba43..9e7afe347da2 100644
--- a/reportdesign/source/filter/xml/xmlExportDocumentHandler.hxx
+++ b/reportdesign/source/filter/xml/xmlExportDocumentHandler.hxx
@@ -43,14 +43,6 @@ typedef ::cppu::WeakAggImplHelper3< css::xml::sax::XDocumentHandler
class ExportDocumentHandler : public ExportDocumentHandler_BASE
{
public:
- // XServiceInfo - static versions
- /// @throws css::uno::RuntimeException
- static OUString getImplementationName_Static( );
- /// @throws css::uno::RuntimeException
- static css::uno::Sequence< OUString > getSupportedServiceNames_static( );
- static css::uno::Reference< css::uno::XInterface >
- create(const css::uno::Reference< css::uno::XComponentContext >&);
-public:
explicit ExportDocumentHandler(css::uno::Reference< css::uno::XComponentContext > const & context);
private:
diff --git a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
index b4533aa337cb..95fd297bc657 100644
--- a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
+++ b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
@@ -63,7 +63,7 @@ IMPLEMENT_GET_IMPLEMENTATION_ID(ImportDocumentHandler)
OUString SAL_CALL ImportDocumentHandler::getImplementationName( )
{
- return getImplementationName_Static();
+ return "com.sun.star.comp.report.ImportDocumentHandler";
}
sal_Bool SAL_CALL ImportDocumentHandler::supportsService( const OUString& ServiceName )
@@ -76,25 +76,17 @@ uno::Sequence< OUString > SAL_CALL ImportDocumentHandler::getSupportedServiceNam
uno::Sequence< OUString > aSupported;
if ( m_xServiceInfo.is() )
aSupported = m_xServiceInfo->getSupportedServiceNames();
- return ::comphelper::concatSequences(getSupportedServiceNames_static(),aSupported);
+ return ::comphelper::concatSequences( uno::Sequence<OUString> { "com.sun.star.report.ImportDocumentHandler" }, aSupported);
}
-OUString ImportDocumentHandler::getImplementationName_Static( )
-{
- return "com.sun.star.comp.report.ImportDocumentHandler";
-}
-uno::Sequence< OUString > ImportDocumentHandler::getSupportedServiceNames_static( )
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+reportdesign_ImportDocumentHandler_get_implementation(
+ css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
{
- uno::Sequence< OUString > aSupported { "com.sun.star.report.ImportDocumentHandler" };
- return aSupported;
+ return cppu::acquire(new ImportDocumentHandler(context));
}
-
-uno::Reference< uno::XInterface > ImportDocumentHandler::create( const uno::Reference< uno::XComponentContext >& _rxContext )
-{
- return *(new ImportDocumentHandler( _rxContext ));
-}
// xml::sax::XDocumentHandler:
void SAL_CALL ImportDocumentHandler::startDocument()
{
diff --git a/reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx b/reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx
index 4f05bf0d8858..342194a9612a 100644
--- a/reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx
+++ b/reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx
@@ -41,14 +41,6 @@ typedef ::cppu::WeakAggImplHelper3< css::xml::sax::XDocumentHandler
class ImportDocumentHandler : public ImportDocumentHandler_BASE
{
public:
- // XServiceInfo - static versions
- /// @throws css::uno::RuntimeException
- static OUString getImplementationName_Static( );
- /// @throws css::uno::RuntimeException
- static css::uno::Sequence< OUString > getSupportedServiceNames_static( );
- static css::uno::Reference< css::uno::XInterface >
- create(const css::uno::Reference< css::uno::XComponentContext >&);
-public:
explicit ImportDocumentHandler(css::uno::Reference< css::uno::XComponentContext > const & context);
private:
diff --git a/reportdesign/source/filter/xml/xmlfilter.cxx b/reportdesign/source/filter/xml/xmlfilter.cxx
index 311bbcbff367..34cf5c49cba2 100644
--- a/reportdesign/source/filter/xml/xmlfilter.cxx
+++ b/reportdesign/source/filter/xml/xmlfilter.cxx
@@ -249,79 +249,62 @@ static ErrCode ReadThroughComponent(
}
-uno::Reference< uno::XInterface > ORptImportHelper::create(uno::Reference< uno::XComponentContext > const & xContext)
-{
- return static_cast< XServiceInfo* >(new ORptFilter(xContext, SvXMLImportFlags::SETTINGS ));
-}
-
-OUString ORptImportHelper::getImplementationName_Static( )
-{
- return SERVICE_SETTINGSIMPORTER;
-}
-
-Sequence< OUString > ORptImportHelper::getSupportedServiceNames_Static( )
-{
- Sequence< OUString > aSupported { SERVICE_IMPORTFILTER };
- return aSupported;
-}
-
-Reference< XInterface > ORptContentImportHelper::create(const Reference< XComponentContext > & xContext)
-{
- return static_cast< XServiceInfo* >(new ORptFilter(xContext, SvXMLImportFlags::AUTOSTYLES | SvXMLImportFlags::CONTENT | SvXMLImportFlags::SCRIPTS |
- SvXMLImportFlags::FONTDECLS ));
-}
-
-OUString ORptContentImportHelper::getImplementationName_Static( )
+/** Imports only settings
+ * \ingroup reportdesign_source_filter_xml
+ *
+ */
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+reportdesign_ORptImportHelper_get_implementation(
+ css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
{
- return SERVICE_CONTENTIMPORTER;
+ return cppu::acquire(new ORptFilter(context,
+ SERVICE_SETTINGSIMPORTER,
+ SvXMLImportFlags::SETTINGS ));
}
-Sequence< OUString > ORptContentImportHelper::getSupportedServiceNames_Static( )
+/** Imports only content
+ * \ingroup reportdesign_source_filter_xml
+ *
+ */
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+reportdesign_XMLOasisContentImporter_get_implementation(
+ css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
{
- Sequence< OUString > aSupported { SERVICE_IMPORTFILTER };
- return aSupported;
+ return cppu::acquire(new ORptFilter(context,
+ SERVICE_CONTENTIMPORTER,
+ SvXMLImportFlags::AUTOSTYLES | SvXMLImportFlags::CONTENT | SvXMLImportFlags::SCRIPTS | SvXMLImportFlags::FONTDECLS ));
}
-
-Reference< XInterface > ORptStylesImportHelper::create(Reference< XComponentContext > const & xContext)
+/** Imports only styles
+ * \ingroup reportdesign_source_filter_xml
+ *
+ */
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+reportdesign_ORptStylesImportHelper_get_implementation(
+ css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
{
- return static_cast< XServiceInfo* >(new ORptFilter(xContext,
+ return cppu::acquire(new ORptFilter(context,
+ SERVICE_STYLESIMPORTER,
SvXMLImportFlags::STYLES | SvXMLImportFlags::MASTERSTYLES | SvXMLImportFlags::AUTOSTYLES |
SvXMLImportFlags::FONTDECLS ));
}
-OUString ORptStylesImportHelper::getImplementationName_Static( )
-{
- return SERVICE_STYLESIMPORTER;
-}
-
-Sequence< OUString > ORptStylesImportHelper::getSupportedServiceNames_Static( )
-{
- Sequence< OUString > aSupported { SERVICE_IMPORTFILTER };
- return aSupported;
-}
-
-
-Reference< XInterface > ORptMetaImportHelper::create(Reference< XComponentContext > const & xContext)
-{
- return static_cast< XServiceInfo* >(new ORptFilter(xContext,
- SvXMLImportFlags::META));
-}
-
-OUString ORptMetaImportHelper::getImplementationName_Static( )
-{
- return SERVICE_METAIMPORTER;
-}
-
-Sequence< OUString > ORptMetaImportHelper::getSupportedServiceNames_Static( )
+/** Imports only meta data
+ * \ingroup reportdesign_source_filter_xml
+ *
+ */
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+reportdesign_ORptMetaImportHelper_get_implementation(
+ css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
{
- Sequence< OUString > aSupported { SERVICE_IMPORTFILTER };
- return aSupported;
+ return cppu::acquire(new ORptFilter(context,
+ SERVICE_METAIMPORTER,
+ SvXMLImportFlags::META ));
}
-ORptFilter::ORptFilter( const uno::Reference< XComponentContext >& _rxContext, SvXMLImportFlags nImportFlags )
- :SvXMLImport(_rxContext, getImplementationName_Static(), nImportFlags)
+ORptFilter::ORptFilter( const uno::Reference< XComponentContext >& _rxContext, OUString const & rImplementationName, SvXMLImportFlags nImportFlags )
+ :SvXMLImport(_rxContext, rImplementationName, nImportFlags)
{
GetMM100UnitConverter().SetCoreMeasureUnit(util::MeasureUnit::MM_100TH);
GetMM100UnitConverter().SetXMLMeasureUnit(util::MeasureUnit::CM);
@@ -344,22 +327,13 @@ ORptFilter::~ORptFilter() throw()
{
}
-uno::Reference< XInterface > ORptFilter::create(uno::Reference< XComponentContext > const & xContext)
-{
- return *(new ORptFilter(xContext));
-}
-
-
-OUString ORptFilter::getImplementationName_Static( )
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+reportdesign_OReportFilter_get_implementation(
+ css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
{
- return "com.sun.star.comp.report.OReportFilter";
-}
-
-uno::Sequence< OUString > ORptFilter::getSupportedServiceNames_Static( )
-{
- uno::Sequence< OUString > aServices { SERVICE_IMPORTFILTER };
-
- return aServices;
+ return cppu::acquire(new ORptFilter(context,
+ "com.sun.star.comp.report.OReportFilter",
+ SvXMLImportFlags::ALL ));
}
sal_Bool SAL_CALL ORptFilter::filter( const Sequence< PropertyValue >& rDescriptor )
diff --git a/reportdesign/source/filter/xml/xmlfilter.hxx b/reportdesign/source/filter/xml/xmlfilter.hxx
index eb1b8f715e36..5165da21884f 100644
--- a/reportdesign/source/filter/xml/xmlfilter.hxx
+++ b/reportdesign/source/filter/xml/xmlfilter.hxx
@@ -87,18 +87,11 @@ protected:
virtual ~ORptFilter() throw() override;
public:
- ORptFilter( const Reference< XComponentContext >& _rxContext, SvXMLImportFlags nImportFlags = SvXMLImportFlags::ALL );
+ ORptFilter( const Reference< XComponentContext >& _rxContext, OUString const & rImplementationName, SvXMLImportFlags nImportFlags );
// XFilter
virtual sal_Bool SAL_CALL filter( const Sequence< PropertyValue >& rDescriptor ) override;
- /// @throws css::uno::RuntimeException
- static css::uno::Sequence< OUString > getSupportedServiceNames_Static();
- /// @throws css::uno::RuntimeException
- static OUString getImplementationName_Static();
- static css::uno::Reference< css::uno::XInterface >
- create(css::uno::Reference< css::uno::XComponentContext > const & xContext);
-
const Reference<XReportDefinition>& getReportDefinition() const {
return m_xReportDefinition;
}
@@ -133,66 +126,6 @@ public:
bool isOldFormat() const;
};
-/** Imports only settings
- * \ingroup reportdesign_source_filter_xml
- *
- */
-class ORptImportHelper
-{
-public:
- /// @throws css::uno::RuntimeException
- static OUString getImplementationName_Static( );
- /// @throws css::uno::RuntimeException
- static Sequence< OUString > getSupportedServiceNames_Static( );
- static css::uno::Reference< css::uno::XInterface >
- create(css::uno::Reference< css::uno::XComponentContext > const & xContext);
-};
-
-/** Imports only content
- * \ingroup reportdesign_source_filter_xml
- *
- */
-class ORptContentImportHelper
-{
-public:
- /// @throws css::uno::RuntimeException
- static OUString getImplementationName_Static( );
- /// @throws css::uno::RuntimeException
- static Sequence< OUString > getSupportedServiceNames_Static( );
- static css::uno::Reference< css::uno::XInterface >
- create(css::uno::Reference< css::uno::XComponentContext > const & xContext);
-};
-
-/** Imports only styles
- * \ingroup reportdesign_source_filter_xml
- *
- */
-class ORptStylesImportHelper
-{
-public:
- /// @throws css::uno::RuntimeException
- static OUString getImplementationName_Static( );
- /// @throws css::uno::RuntimeException
- static Sequence< OUString > getSupportedServiceNames_Static( );
- static css::uno::Reference< css::uno::XInterface >
- create(css::uno::Reference< css::uno::XComponentContext > const & xContext);
-};
-
-/** Imports only meta data
- * \ingroup reportdesign_source_filter_xml
- *
- */
-class ORptMetaImportHelper
-{
-public:
- /// @throws css::uno::RuntimeException
- static OUString getImplementationName_Static( );
- /// @throws css::uno::RuntimeException
- static Sequence< OUString > getSupportedServiceNames_Static( );
- static css::uno::Reference< css::uno::XInterface >
- create(css::uno::Reference< css::uno::XComponentContext > const & xContext);
-};
-
class RptXMLDocumentBodyContext : public SvXMLImportContext
{
diff --git a/reportdesign/source/filter/xml/xmlservices.cxx b/reportdesign/source/filter/xml/xmlservices.cxx
deleted file mode 100644
index 7ec5ff019ac9..000000000000
--- a/reportdesign/source/filter/xml/xmlservices.cxx
+++ /dev/null
@@ -1,80 +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/factory.hxx>
-#include <cppuhelper/implementationentry.hxx>
-#include "xmlfilter.hxx"
-#include "xmlExport.hxx"
-#include "dbloader2.hxx"
-#include "xmlExportDocumentHandler.hxx"
-#include "xmlImportDocumentHandler.hxx"
-
-
-/********************************************************************************************/
-
-using namespace ::rptxml;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::registry;
-/********************************************************************************************/
-// registry functions
-namespace
-{
-
-cppu::ImplementationEntry const entries[] = {
- { &ORptFilter::create, &ORptFilter::getImplementationName_Static, &ORptFilter::getSupportedServiceNames_Static,
- &cppu::createSingleComponentFactory, nullptr, 0 },
- { &ORptTypeDetection::create, &ORptTypeDetection::getImplementationName_Static, &ORptTypeDetection::getSupportedServiceNames_Static,
- &cppu::createSingleComponentFactory, nullptr, 0 },
- { &ODBFullExportHelper::create, &ODBFullExportHelper::getImplementationName_Static, &ODBFullExportHelper::getSupportedServiceNames_Static,
- &cppu::createSingleComponentFactory, nullptr, 0 },
- { &ORptExportHelper::create, &ORptExportHelper::getImplementationName_Static, &ORptExportHelper::getSupportedServiceNames_Static,
- &cppu::createSingleComponentFactory, nullptr, 0 },
- { &ORptExport::create, &ORptExport::getImplementationName_Static, &ORptExport::getSupportedServiceNames_Static,
- &cppu::createSingleComponentFactory, nullptr, 0 },
- { &ORptContentExportHelper::create, &ORptContentExportHelper::getImplementationName_Static, &ORptContentExportHelper::getSupportedServiceNames_Static,
- &cppu::createSingleComponentFactory, nullptr, 0 },
- { &ORptStylesExportHelper::create, &ORptStylesExportHelper::getImplementationName_Static, &ORptStylesExportHelper::getSupportedServiceNames_Static,
- &cppu::createSingleComponentFactory, nullptr, 0 },
- { &ORptMetaExportHelper::create, &ORptMetaExportHelper::getImplementationName_Static, &ORptMetaExportHelper::getSupportedServiceNames_Static,
- &cppu::createSingleComponentFactory, nullptr, 0 },
-
- { &ORptImportHelper::create, &ORptImportHelper::getImplementationName_Static, &ORptImportHelper::getSupportedServiceNames_Static,
- &cppu::createSingleComponentFactory, nullptr, 0 },
- { &ORptContentImportHelper::create, &ORptContentImportHelper::getImplementationName_Static, &ORptContentImportHelper::getSupportedServiceNames_Static,
- &cppu::createSingleComponentFactory, nullptr, 0 },
- { &ORptStylesImportHelper::create, &ORptStylesImportHelper::getImplementationName_Static, &ORptStylesImportHelper::getSupportedServiceNames_Static,
- &cppu::createSingleComponentFactory, nullptr, 0 },
- { &ExportDocumentHandler::create, &ExportDocumentHandler::getImplementationName_Static, &ExportDocumentHandler::getSupportedServiceNames_static,
- &cppu::createSingleComponentFactory, nullptr, 0 },
- { &ImportDocumentHandler::create, &ImportDocumentHandler::getImplementationName_Static, &ImportDocumentHandler::getSupportedServiceNames_static,
- &cppu::createSingleComponentFactory, nullptr, 0 },
- { &ORptMetaImportHelper::create, &ORptMetaImportHelper::getImplementationName_Static, &ORptMetaImportHelper::getSupportedServiceNames_Static,
- &cppu::createSingleComponentFactory, nullptr, 0 },
- { nullptr, nullptr, nullptr, nullptr, nullptr, 0 }
-};
-}
-
-extern "C" SAL_DLLPUBLIC_EXPORT void * rptxml_component_getFactory(
- char const * implName, void * serviceManager, void * registryKey)
-{
- return cppu::component_getFactoryHelper(
- implName, serviceManager, registryKey, entries);
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/reportdesign/util/rptxml.component b/reportdesign/util/rptxml.component
index 936625fcda82..7e9c3817c113 100644
--- a/reportdesign/util/rptxml.component
+++ b/reportdesign/util/rptxml.component
@@ -18,47 +18,61 @@
-->
<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
- prefix="rptxml" xmlns="http://openoffice.org/2010/uno-components">
- <implementation name="com.sun.star.comp.Report.XMLOasisContentImporter">
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.Report.XMLOasisContentImporter"
+ constructor="reportdesign_XMLOasisContentImporter_get_implementation">
<service name="com.sun.star.comp.document.ImportFilter"/>
</implementation>
- <implementation name="com.sun.star.comp.Report.XMLOasisMetaImporter">
+ <implementation name="com.sun.star.comp.Report.XMLOasisMetaImporter"
+ constructor="reportdesign_ORptMetaImportHelper_get_implementation">
<service name="com.sun.star.comp.document.ImportFilter"/>
</implementation>
- <implementation name="com.sun.star.comp.Report.XMLOasisSettingsImporter">
+ <implementation name="com.sun.star.comp.Report.XMLOasisSettingsImporter"
+ constructor="reportdesign_ORptImportHelper_get_implementation">
<service name="com.sun.star.comp.document.ImportFilter"/>
</implementation>
- <implementation name="com.sun.star.comp.Report.XMLOasisStylesImporter">
+ <implementation name="com.sun.star.comp.Report.XMLOasisStylesImporter"
+ constructor="reportdesign_ORptStylesImportHelper_get_implementation">
<service name="com.sun.star.comp.document.ImportFilter"/>
</implementation>
- <implementation name="com.sun.star.comp.report.ExportDocumentHandler">
+ <implementation name="com.sun.star.comp.report.ExportDocumentHandler"
+ constructor="reportdesign_ExportDocumentHandler_get_implementation">
<service name="com.sun.star.report.ExportDocumentHandler"/>
</implementation>
- <implementation name="com.sun.star.comp.report.ExportFilter">
+ <implementation name="com.sun.star.comp.report.ExportFilter"
+ constructor="reportdesign_ORptExport_get_implementation">
<service name="com.sun.star.document.ExportFilter"/>
</implementation>
- <implementation name="com.sun.star.comp.report.ImportDocumentHandler">
+ <implementation name="com.sun.star.comp.report.ImportDocumentHandler"
+ constructor="reportdesign_ImportDocumentHandler_get_implementation">
<service name="com.sun.star.report.ImportDocumentHandler"/>
</implementation>
- <implementation name="com.sun.star.comp.report.OReportFilter">
+ <implementation name="com.sun.star.comp.report.OReportFilter"
+ constructor="reportdesign_OReportFilter_get_implementation">
<service name="com.sun.star.comp.document.ImportFilter"/>
</implementation>
- <implementation name="com.sun.star.comp.report.ORptTypeDetection">
+ <implementation name="com.sun.star.comp.report.ORptTypeDetection"
+ constructor="reportdesign_ORptTypeDetection_get_implementation">
<service name="com.sun.star.document.ExtendedTypeDetection"/>
</implementation>
- <implementation name="com.sun.star.comp.report.XMLContentExporter">
+ <implementation name="com.sun.star.comp.report.XMLContentExporter"
+ constructor="reportdesign_ORptContentExportHelper_get_implementation">
<service name="com.sun.star.document.ExportFilter"/>
</implementation>
- <implementation name="com.sun.star.comp.report.XMLFullExporter">
+ <implementation name="com.sun.star.comp.report.XMLFullExporter"
+ constructor="reportdesign_ODBFullExportHelper_get_implementation">
<service name="com.sun.star.document.ExportFilter"/>
</implementation>
- <implementation name="com.sun.star.comp.report.XMLMetaExporter">
+ <implementation name="com.sun.star.comp.report.XMLMetaExporter"
+ constructor="reportdesign_ORptMetaExportHelper_get_implementation">
<service name="com.sun.star.document.ExportFilter"/>
</implementation>
- <implementation name="com.sun.star.comp.report.XMLSettingsExporter">
+ <implementation name="com.sun.star.comp.report.XMLSettingsExporter"
+ constructor="reportdesign_ORptExportHelper_get_implementation">
<service name="com.sun.star.document.ExportFilter"/>
</implementation>
- <implementation name="com.sun.star.comp.report.XMLStylesExporter">
+ <implementation name="com.sun.star.comp.report.XMLStylesExporter"
+ constructor="reportdesign_ORptStylesExportHelper_get_implementation">
<service name="com.sun.star.document.ExportFilter"/>
</implementation>
</component>