Kaydet (Commit) 28dc7c3c authored tarafından Miklos Vajna's avatar Miklos Vajna

oox: create FastTokenHandler instances with an uno constructor

Change-Id: I1d7bca67c493d31a2a833a8254a9c01c76f1d286
Reviewed-on: https://gerrit.libreoffice.org/58495
Tested-by: Jenkins
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
üst 1da9761c
...@@ -23,13 +23,6 @@ ...@@ -23,13 +23,6 @@
#include <sal/config.h> #include <sal/config.h>
namespace oox { namespace oox {
namespace core {
extern OUString FastTokenHandler_getImplementationName();
extern css::uno::Sequence< OUString > FastTokenHandler_getSupportedServiceNames();
/// @throws css::uno::Exception
extern css::uno::Reference< css::uno::XInterface > FastTokenHandler_createInstance(
const css::uno::Reference< css::uno::XComponentContext >& rxContext );
}
namespace core { namespace core {
extern OUString FilterDetect_getImplementationName(); extern OUString FilterDetect_getImplementationName();
extern css::uno::Sequence< OUString > FilterDetect_getSupportedServiceNames(); extern css::uno::Sequence< OUString > FilterDetect_getSupportedServiceNames();
......
...@@ -26,27 +26,13 @@ ...@@ -26,27 +26,13 @@
#include <services.hxx> #include <services.hxx>
using namespace ::com::sun::star;
namespace oox { namespace oox {
namespace core { namespace core {
using namespace ::com::sun::star::uno; using namespace ::com::sun::star::uno;
OUString FastTokenHandler_getImplementationName()
{
return OUString( "com.sun.star.comp.oox.core.FastTokenHandler" );
}
Sequence< OUString > FastTokenHandler_getSupportedServiceNames()
{
Sequence<OUString> aServiceNames { "com.sun.star.xml.sax.FastTokenHandler" };
return aServiceNames;
}
Reference< XInterface > FastTokenHandler_createInstance( const Reference< XComponentContext >& /*rxContext*/ )
{
return static_cast< ::cppu::OWeakObject* >( new FastTokenHandler );
}
FastTokenHandler::FastTokenHandler() : FastTokenHandler::FastTokenHandler() :
mrTokenMap( StaticTokenMap::get() ) mrTokenMap( StaticTokenMap::get() )
{ {
...@@ -59,7 +45,7 @@ FastTokenHandler::~FastTokenHandler() ...@@ -59,7 +45,7 @@ FastTokenHandler::~FastTokenHandler()
// XServiceInfo // XServiceInfo
OUString SAL_CALL FastTokenHandler::getImplementationName() OUString SAL_CALL FastTokenHandler::getImplementationName()
{ {
return FastTokenHandler_getImplementationName(); return OUString( "com.sun.star.comp.oox.core.FastTokenHandler" );
} }
sal_Bool SAL_CALL FastTokenHandler::supportsService( const OUString& rServiceName ) sal_Bool SAL_CALL FastTokenHandler::supportsService( const OUString& rServiceName )
...@@ -69,7 +55,8 @@ sal_Bool SAL_CALL FastTokenHandler::supportsService( const OUString& rServiceNam ...@@ -69,7 +55,8 @@ sal_Bool SAL_CALL FastTokenHandler::supportsService( const OUString& rServiceNam
Sequence< OUString > SAL_CALL FastTokenHandler::getSupportedServiceNames() Sequence< OUString > SAL_CALL FastTokenHandler::getSupportedServiceNames()
{ {
return FastTokenHandler_getSupportedServiceNames(); Sequence<OUString> aServiceNames { "com.sun.star.xml.sax.FastTokenHandler" };
return aServiceNames;
} }
Sequence< sal_Int8 > FastTokenHandler::getUTF8Identifier( sal_Int32 nToken ) Sequence< sal_Int8 > FastTokenHandler::getUTF8Identifier( sal_Int32 nToken )
...@@ -90,4 +77,11 @@ sal_Int32 FastTokenHandler::getTokenDirect( const char *pToken, sal_Int32 nLengt ...@@ -90,4 +77,11 @@ sal_Int32 FastTokenHandler::getTokenDirect( const char *pToken, sal_Int32 nLengt
} // namespace core } // namespace core
} // namespace oox } // namespace oox
extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
com_sun_star_comp_oox_core_FastTokenHandler_get_implementation(
uno::XComponentContext* /*pCtx*/, uno::Sequence<uno::Any> const& /*rSeq*/)
{
return cppu::acquire(new oox::core::FastTokenHandler());
}
/* 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::FastTokenHandler ),
IMPLEMENTATION_ENTRY( ::oox::core::FilterDetect ), 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 ),
......
...@@ -19,7 +19,8 @@ ...@@ -19,7 +19,8 @@
<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@" <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
prefix="oox" xmlns="http://openoffice.org/2010/uno-components"> prefix="oox" xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.oox.core.FastTokenHandler"> <implementation name="com.sun.star.comp.oox.core.FastTokenHandler"
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">
......
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