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

oox: create DocumentPropertiesImporter instances with an uno constructor

Change-Id: I2600a59e4eac7375882aff0491ecf16bad449520
Reviewed-on: https://gerrit.libreoffice.org/59841
Tested-by: Jenkins
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
üst ba259064
......@@ -23,13 +23,6 @@
#include <sal/config.h>
namespace oox {
namespace docprop {
extern OUString DocumentPropertiesImport_getImplementationName();
extern css::uno::Sequence< OUString > DocumentPropertiesImport_getSupportedServiceNames();
/// @throws css::uno::Exception
extern css::uno::Reference< css::uno::XInterface > DocumentPropertiesImport_createInstance(
const css::uno::Reference< css::uno::XComponentContext >& rxContext );
}
namespace ppt {
extern OUString PowerPointImport_getImplementationName();
extern css::uno::Sequence< OUString > PowerPointImport_getSupportedServiceNames();
......
......@@ -35,7 +35,6 @@ namespace {
// Impress" would actually want to make use of them:
static ::cppu::ImplementationEntry const spServices[] =
{
IMPLEMENTATION_ENTRY( ::oox::docprop::DocumentPropertiesImport ),
IMPLEMENTATION_ENTRY( ::oox::ppt::PowerPointImport ),
IMPLEMENTATION_ENTRY( ::oox::ppt::QuickDiagrammingImport ),
IMPLEMENTATION_ENTRY( ::oox::ppt::QuickDiagrammingLayout ),
......
......@@ -33,6 +33,8 @@
#include <cppuhelper/supportsservice.hxx>
using namespace ::com::sun::star;
namespace oox {
namespace docprop {
......@@ -44,22 +46,6 @@ using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::xml::sax;
OUString DocumentPropertiesImport_getImplementationName()
{
return OUString( "com.sun.star.comp.oox.docprop.DocumentPropertiesImporter" );
}
Sequence< OUString > DocumentPropertiesImport_getSupportedServiceNames()
{
Sequence<OUString> aServices { "com.sun.star.document.OOXMLDocumentPropertiesImporter" };
return aServices;
}
Reference< XInterface > DocumentPropertiesImport_createInstance( const Reference< XComponentContext >& rxContext )
{
return static_cast< ::cppu::OWeakObject* >( new DocumentPropertiesImport( rxContext ) );
}
namespace {
/// @throws RuntimeException
......@@ -113,7 +99,7 @@ DocumentPropertiesImport::DocumentPropertiesImport( const Reference< XComponentC
// XServiceInfo
OUString SAL_CALL DocumentPropertiesImport::getImplementationName()
{
return DocumentPropertiesImport_getImplementationName();
return OUString( "com.sun.star.comp.oox.docprop.DocumentPropertiesImporter" );
}
sal_Bool SAL_CALL DocumentPropertiesImport::supportsService( const OUString& rServiceName )
......@@ -123,7 +109,8 @@ sal_Bool SAL_CALL DocumentPropertiesImport::supportsService( const OUString& rSe
Sequence< OUString > SAL_CALL DocumentPropertiesImport::getSupportedServiceNames()
{
return DocumentPropertiesImport_getSupportedServiceNames();
Sequence<OUString> aServices { "com.sun.star.document.OOXMLDocumentPropertiesImporter" };
return aServices;
}
// XOOXMLDocumentPropertiesImporter
......@@ -179,4 +166,11 @@ void SAL_CALL DocumentPropertiesImport::importProperties(
} // namespace docprop
} // namespace oox
extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
com_sun_star_comp_oox_docprop_DocumentPropertiesImporter_get_implementation(
uno::XComponentContext* pCtx, uno::Sequence<uno::Any> const& /*rSeq*/)
{
return cppu::acquire(new oox::docprop::DocumentPropertiesImport(pCtx));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -27,7 +27,8 @@
constructor="com_sun_star_comp_oox_FormatDetector_get_implementation">
<service name="com.sun.star.frame.ExtendedTypeDetection"/>
</implementation>
<implementation name="com.sun.star.comp.oox.docprop.DocumentPropertiesImporter">
<implementation name="com.sun.star.comp.oox.docprop.DocumentPropertiesImporter"
constructor="com_sun_star_comp_oox_docprop_DocumentPropertiesImporter_get_implementation">
<service name="com.sun.star.document.OOXMLDocumentPropertiesImporter"/>
</implementation>
<implementation name="com.sun.star.comp.oox.ppt.PowerPointImport">
......
......@@ -255,6 +255,7 @@ core_constructor_list = [
# oox/util/oox.component
"com_sun_star_comp_oox_core_FastTokenHandler_get_implementation",
"com_sun_star_comp_oox_FormatDetector_get_implementation",
"com_sun_star_comp_oox_docprop_DocumentPropertiesImporter_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