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

oox: create FilterDetect instances with an uno constructor

Change-Id: Ic9baba6a4ca37af18c5f5175aadcc59bf47c7b64
Reviewed-on: https://gerrit.libreoffice.org/58798
Tested-by: Jenkins
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
üst d977e02e
...@@ -23,13 +23,6 @@ ...@@ -23,13 +23,6 @@
#include <sal/config.h> #include <sal/config.h>
namespace oox { namespace oox {
namespace core {
extern OUString FilterDetect_getImplementationName();
extern css::uno::Sequence< OUString > FilterDetect_getSupportedServiceNames();
/// @throws css::uno::Exception
extern css::uno::Reference< css::uno::XInterface > FilterDetect_createInstance(
const css::uno::Reference< css::uno::XComponentContext >& rxContext );
}
namespace docprop { namespace docprop {
extern OUString DocumentPropertiesImport_getImplementationName(); extern OUString DocumentPropertiesImport_getImplementationName();
extern css::uno::Sequence< OUString > DocumentPropertiesImport_getSupportedServiceNames(); extern css::uno::Sequence< OUString > DocumentPropertiesImport_getSupportedServiceNames();
......
...@@ -38,6 +38,8 @@ ...@@ -38,6 +38,8 @@
#include <services.hxx> #include <services.hxx>
using namespace ::com::sun::star;
namespace oox { namespace oox {
namespace core { namespace core {
...@@ -228,25 +230,6 @@ void FilterDetectDocHandler::parseContentTypesOverride( const AttributeList& rAt ...@@ -228,25 +230,6 @@ void FilterDetectDocHandler::parseContentTypesOverride( const AttributeList& rAt
mrFilterName = getFilterNameFromContentType( rAttribs.getString( XML_ContentType, OUString() ), maFileName ); mrFilterName = getFilterNameFromContentType( rAttribs.getString( XML_ContentType, OUString() ), maFileName );
} }
/* Helper for XServiceInfo */
Sequence< OUString > FilterDetect_getSupportedServiceNames()
{
Sequence<OUString> aServiceNames { "com.sun.star.frame.ExtendedTypeDetection" };
return aServiceNames;
}
/* Helper for XServiceInfo */
OUString FilterDetect_getImplementationName()
{
return OUString( "com.sun.star.comp.oox.FormatDetector" );
}
/* Helper for registry */
Reference< XInterface > FilterDetect_createInstance( const Reference< XComponentContext >& rxContext )
{
return static_cast< ::cppu::OWeakObject* >( new FilterDetect( rxContext ) );
}
FilterDetect::FilterDetect( const Reference< XComponentContext >& rxContext ) : FilterDetect::FilterDetect( const Reference< XComponentContext >& rxContext ) :
mxContext( rxContext, UNO_SET_THROW ) mxContext( rxContext, UNO_SET_THROW )
{ {
...@@ -377,7 +360,7 @@ Reference< XInputStream > FilterDetect::extractUnencryptedPackage( MediaDescript ...@@ -377,7 +360,7 @@ Reference< XInputStream > FilterDetect::extractUnencryptedPackage( MediaDescript
OUString SAL_CALL FilterDetect::getImplementationName() OUString SAL_CALL FilterDetect::getImplementationName()
{ {
return FilterDetect_getImplementationName(); return OUString( "com.sun.star.comp.oox.FormatDetector" );
} }
sal_Bool SAL_CALL FilterDetect::supportsService( const OUString& rServiceName ) sal_Bool SAL_CALL FilterDetect::supportsService( const OUString& rServiceName )
...@@ -387,7 +370,8 @@ sal_Bool SAL_CALL FilterDetect::supportsService( const OUString& rServiceName ) ...@@ -387,7 +370,8 @@ sal_Bool SAL_CALL FilterDetect::supportsService( const OUString& rServiceName )
Sequence< OUString > SAL_CALL FilterDetect::getSupportedServiceNames() Sequence< OUString > SAL_CALL FilterDetect::getSupportedServiceNames()
{ {
return FilterDetect_getSupportedServiceNames(); Sequence<OUString> aServiceNames { "com.sun.star.frame.ExtendedTypeDetection" };
return aServiceNames;
} }
// com.sun.star.document.XExtendedFilterDetection interface ------------------- // com.sun.star.document.XExtendedFilterDetection interface -------------------
...@@ -452,4 +436,11 @@ OUString SAL_CALL FilterDetect::detect( Sequence< PropertyValue >& rMediaDescSeq ...@@ -452,4 +436,11 @@ OUString SAL_CALL FilterDetect::detect( Sequence< PropertyValue >& rMediaDescSeq
} // namespace core } // namespace core
} // namespace oox } // namespace oox
extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
com_sun_star_comp_oox_FormatDetector_get_implementation(uno::XComponentContext* pCtx,
uno::Sequence<uno::Any> const& /*rSeq*/)
{
return cppu::acquire(new oox::core::FilterDetect(pCtx));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -35,7 +35,6 @@ namespace { ...@@ -35,7 +35,6 @@ namespace {
// Impress" would actually want to make use of them: // Impress" would actually want to make use of them:
static ::cppu::ImplementationEntry const spServices[] = static ::cppu::ImplementationEntry const spServices[] =
{ {
IMPLEMENTATION_ENTRY( ::oox::core::FilterDetect ),
IMPLEMENTATION_ENTRY( ::oox::docprop::DocumentPropertiesImport ), IMPLEMENTATION_ENTRY( ::oox::docprop::DocumentPropertiesImport ),
IMPLEMENTATION_ENTRY( ::oox::ppt::PowerPointImport ), IMPLEMENTATION_ENTRY( ::oox::ppt::PowerPointImport ),
IMPLEMENTATION_ENTRY( ::oox::ppt::QuickDiagrammingImport ), IMPLEMENTATION_ENTRY( ::oox::ppt::QuickDiagrammingImport ),
......
...@@ -23,7 +23,8 @@ ...@@ -23,7 +23,8 @@
constructor="com_sun_star_comp_oox_core_FastTokenHandler_get_implementation"> constructor="com_sun_star_comp_oox_core_FastTokenHandler_get_implementation">
<service name="com.sun.star.xml.sax.FastTokenHandler"/> <service name="com.sun.star.xml.sax.FastTokenHandler"/>
</implementation> </implementation>
<implementation name="com.sun.star.comp.oox.FormatDetector"> <implementation name="com.sun.star.comp.oox.FormatDetector"
constructor="com_sun_star_comp_oox_FormatDetector_get_implementation">
<service name="com.sun.star.frame.ExtendedTypeDetection"/> <service name="com.sun.star.frame.ExtendedTypeDetection"/>
</implementation> </implementation>
<implementation name="com.sun.star.comp.oox.docprop.DocumentPropertiesImporter"> <implementation name="com.sun.star.comp.oox.docprop.DocumentPropertiesImporter">
......
...@@ -254,6 +254,7 @@ core_constructor_list = [ ...@@ -254,6 +254,7 @@ core_constructor_list = [
("com_sun_star_xml_crypto_XMLSignature_get_implementation", "#if HAVE_FEATURE_NSS"), ("com_sun_star_xml_crypto_XMLSignature_get_implementation", "#if HAVE_FEATURE_NSS"),
# oox/util/oox.component # oox/util/oox.component
"com_sun_star_comp_oox_core_FastTokenHandler_get_implementation", "com_sun_star_comp_oox_core_FastTokenHandler_get_implementation",
"com_sun_star_comp_oox_FormatDetector_get_implementation",
] ]
# edit group for apps, where you can edit documents # 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