summaryrefslogtreecommitdiff
path: root/sax
diff options
context:
space:
mode:
authorMarcos Paulo de Souza <marcos.souza.org@gmail.com>2013-12-11 12:01:21 -0200
committerMichael Stahl <mstahl@redhat.com>2013-12-11 20:45:30 +0000
commiteebc1e9a8a5c7fd04b795c62791a70eed65995e4 (patch)
tree56c34f36141f9f670c76bb3658b7c068f20b7990 /sax
parentbbb9f4f74724213d62154bb17876953064cd2d62 (diff)
fdo#60698: Merge fastsax and sax_shared into expwrap
Change-Id: I6f8c6827c00db50184a46f39968f882b944d18d4 Reviewed-on: https://gerrit.libreoffice.org/6967 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Diffstat (limited to 'sax')
-rw-r--r--sax/CppunitTest_sax_parser.mk2
-rw-r--r--sax/Library_expwrap.mk14
-rw-r--r--sax/Library_fastsax.mk48
-rw-r--r--sax/Module_sax.mk2
-rw-r--r--sax/StaticLibrary_sax_shared.mk23
-rw-r--r--sax/source/expatwrap/expwrap.component3
-rw-r--r--sax/source/expatwrap/sax_expat.cxx18
-rw-r--r--sax/source/fastparser/fastparser.cxx35
-rw-r--r--sax/source/fastparser/fastsax.component25
9 files changed, 30 insertions, 140 deletions
diff --git a/sax/CppunitTest_sax_parser.mk b/sax/CppunitTest_sax_parser.mk
index fe411d551fca..b94b826059b1 100644
--- a/sax/CppunitTest_sax_parser.mk
+++ b/sax/CppunitTest_sax_parser.mk
@@ -34,7 +34,7 @@ $(eval $(call gb_CppunitTest_use_components,sax_parser,\
framework/util/fwk \
i18npool/util/i18npool \
oox/util/oox \
- sax/source/fastparser/fastsax \
+ sax/source/expatwrap/expwrap \
sfx2/util/sfx \
ucb/source/core/ucb1 \
ucb/source/ucp/file/ucpfile1 \
diff --git a/sax/Library_expwrap.mk b/sax/Library_expwrap.mk
index 67eeb7742e4b..7e3b53e5bfba 100644
--- a/sax/Library_expwrap.mk
+++ b/sax/Library_expwrap.mk
@@ -16,27 +16,33 @@ $(eval $(call gb_Library_set_include,expwrap,\
$$(INCLUDE) \
))
+$(eval $(call gb_Library_add_defs,expwrap,\
+ -DFASTSAX_DLLIMPLEMENTATION \
+))
+
$(eval $(call gb_Library_use_sdk_api,expwrap))
$(eval $(call gb_Library_use_externals,expwrap,\
+ boost_headers \
expat \
+ zlib \
))
$(eval $(call gb_Library_use_libraries,expwrap,\
cppu \
cppuhelper \
sal \
+ salhelper \
+ sax \
$(gb_UWINAPI) \
))
-$(eval $(call gb_Library_use_static_libraries,expwrap,\
- sax_shared \
-))
-
$(eval $(call gb_Library_add_exception_objects,expwrap,\
sax/source/expatwrap/attrlistimpl \
sax/source/expatwrap/sax_expat \
sax/source/expatwrap/saxwriter \
+ sax/source/expatwrap/xml2utf \
+ sax/source/fastparser/fastparser \
))
# vim: set noet sw=4 ts=4:
diff --git a/sax/Library_fastsax.mk b/sax/Library_fastsax.mk
deleted file mode 100644
index 1fcb5039da15..000000000000
--- a/sax/Library_fastsax.mk
+++ /dev/null
@@ -1,48 +0,0 @@
-# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
-#
-# 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/.
-#
-
-$(eval $(call gb_Library_Library,fastsax))
-
-$(eval $(call gb_Library_set_componentfile,fastsax,sax/source/fastparser/fastsax))
-
-$(eval $(call gb_Library_set_include,fastsax,\
- -I$(SRCDIR)/sax/inc \
- $$(INCLUDE) \
-))
-
-$(eval $(call gb_Library_add_defs,fastsax,\
- -DFASTSAX_DLLIMPLEMENTATION \
-))
-
-$(eval $(call gb_Library_use_sdk_api,fastsax))
-
-$(eval $(call gb_Library_use_externals,fastsax,\
- boost_headers \
- expat \
- zlib \
-))
-
-$(eval $(call gb_Library_use_libraries,fastsax,\
- cppu \
- cppuhelper \
- sal \
- salhelper \
- sax \
- $(gb_UWINAPI) \
-))
-
-$(eval $(call gb_Library_use_static_libraries,fastsax,\
- sax_shared \
-))
-
-$(eval $(call gb_Library_add_exception_objects,fastsax,\
- sax/source/fastparser/fastparser \
-))
-
-# vim: set noet sw=4 ts=4:
diff --git a/sax/Module_sax.mk b/sax/Module_sax.mk
index 63c993a46db5..ae8ab9c6db5e 100644
--- a/sax/Module_sax.mk
+++ b/sax/Module_sax.mk
@@ -11,9 +11,7 @@ $(eval $(call gb_Module_Module,sax))
$(eval $(call gb_Module_add_targets,sax,\
Library_expwrap \
- Library_fastsax \
Library_sax \
- StaticLibrary_sax_shared \
))
$(eval $(call gb_Module_add_check_targets,sax,\
diff --git a/sax/StaticLibrary_sax_shared.mk b/sax/StaticLibrary_sax_shared.mk
deleted file mode 100644
index cdbc3c88843f..000000000000
--- a/sax/StaticLibrary_sax_shared.mk
+++ /dev/null
@@ -1,23 +0,0 @@
-# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
-#
-# 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/.
-#
-
-$(eval $(call gb_StaticLibrary_StaticLibrary,sax_shared))
-
-$(eval $(call gb_StaticLibrary_set_include,sax_shared,\
- -I$(SRCDIR)/sax/inc \
- $$(INCLUDE) \
-))
-
-$(eval $(call gb_StaticLibrary_use_sdk_api,sax_shared))
-
-$(eval $(call gb_StaticLibrary_add_exception_objects,sax_shared,\
- sax/source/expatwrap/xml2utf \
-))
-
-# vim: set noet sw=4 ts=4:
diff --git a/sax/source/expatwrap/expwrap.component b/sax/source/expatwrap/expwrap.component
index cc822665b942..e3e474bfd5ec 100644
--- a/sax/source/expatwrap/expwrap.component
+++ b/sax/source/expatwrap/expwrap.component
@@ -25,4 +25,7 @@
<implementation name="com.sun.star.extensions.xml.sax.Writer">
<service name="com.sun.star.xml.sax.Writer"/>
</implementation>
+ <implementation name="com.sun.star.comp.extensions.xml.sax.FastParser">
+ <service name="com.sun.star.xml.sax.FastParser"/>
+ </implementation>
</component>
diff --git a/sax/source/expatwrap/sax_expat.cxx b/sax/source/expatwrap/sax_expat.cxx
index e58f75aae97c..8e066e85ee46 100644
--- a/sax/source/expatwrap/sax_expat.cxx
+++ b/sax/source/expatwrap/sax_expat.cxx
@@ -37,7 +37,6 @@
#include <expat.h>
-using namespace ::rtl;
using namespace ::std;
using namespace ::osl;
using namespace ::cppu;
@@ -50,6 +49,9 @@ using namespace ::com::sun::star::io;
#include "factory.hxx"
#include "attrlistimpl.hxx"
#include "xml2utf.hxx"
+#include <sax/fastparser.hxx>
+
+#define PARSER_IMPLEMENTATION_NAME "com.sun.star.comp.extensions.xml.sax.FastParser"
namespace sax_expatwrap {
@@ -195,7 +197,13 @@ Reference< XInterface > SAL_CALL SaxExpatParser_CreateInstance(
return Reference< XInterface > ( (OWeakObject * ) p );
}
-
+Reference< XInterface > SAL_CALL FastSaxParser_CreateInstance(
+ SAL_UNUSED_PARAMETER const Reference< XMultiServiceFactory > & )
+ throw(Exception)
+{
+ ::sax_fastparser::FastSaxParser *p = new ::sax_fastparser::FastSaxParser;
+ return Reference< XInterface > ( (OWeakObject * ) p );
+}
Sequence< OUString > SaxExpatParser::getSupportedServiceNames_Static(void) throw ()
{
@@ -1084,6 +1092,12 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL expwrap_component_getFactory(
SaxWriter_CreateInstance,
SaxWriter_getSupportedServiceNames() );
}
+ else if ( aImplementationName == PARSER_IMPLEMENTATION_NAME)
+ {
+ xRet = createSingleFactory( xSMgr, aImplementationName,
+ FastSaxParser_CreateInstance,
+ sax_fastparser::FastSaxParser::getSupportedServiceNames_Static() );
+ }
if (xRet.is())
{
diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx
index 4f835d5c2dd5..af73f238274f 100644
--- a/sax/source/fastparser/fastparser.cxx
+++ b/sax/source/fastparser/fastparser.cxx
@@ -1490,39 +1490,4 @@ Reference< XInterface > SAL_CALL FastSaxParser_CreateInstance(
return Reference< XInterface > ( (OWeakObject * ) p );
}
-extern "C" {
-
-SAL_DLLPUBLIC_EXPORT void * SAL_CALL fastsax_component_getFactory(
- const sal_Char * pImplName, void * pServiceManager,
- SAL_UNUSED_PARAMETER void * /*pRegistryKey*/ )
-{
- void * pRet = 0;
-
- if (pServiceManager )
- {
- Reference< XSingleServiceFactory > xRet;
- Reference< XMultiServiceFactory > xSMgr( reinterpret_cast< XMultiServiceFactory * > ( pServiceManager ) );
-
- OUString aImplementationName( OUString::createFromAscii( pImplName ) );
-
- if ( aImplementationName == PARSER_IMPLEMENTATION_NAME )
- {
- xRet = createSingleFactory(
- xSMgr, aImplementationName,
- FastSaxParser_CreateInstance,
- sax_fastparser::FastSaxParserImpl::getSupportedServiceNames_Static() );
- }
-
- if (xRet.is())
- {
- xRet->acquire();
- pRet = xRet.get();
- }
- }
-
- return pRet;
-}
-
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sax/source/fastparser/fastsax.component b/sax/source/fastparser/fastsax.component
deleted file mode 100644
index cc130e080160..000000000000
--- a/sax/source/fastparser/fastsax.component
+++ /dev/null
@@ -1,25 +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" prefix="fastsax"
- xmlns="http://openoffice.org/2010/uno-components">
- <implementation name="com.sun.star.comp.extensions.xml.sax.FastParser">
- <service name="com.sun.star.xml.sax.FastParser"/>
- </implementation>
-</component>