summaryrefslogtreecommitdiff
path: root/sax
diff options
context:
space:
mode:
authorMichael Stahl <mst@openoffice.org>2010-10-04 18:09:56 +0200
committerMichael Stahl <mst@openoffice.org>2010-10-04 18:09:56 +0200
commit62a803cc1aec63b9a6b0f665f1d5ecfe2ad27349 (patch)
tree8f42d40df84e97cf3f15be2a9ae4982047d832f6 /sax
parentbe6d65ae721090df56376ac75946f8645815a8ff (diff)
parent525de6f8eeac6e357167467da0f9a9448433bb25 (diff)
merge DEV300_m89
Diffstat (limited to 'sax')
-rw-r--r--sax/prj/d.lst3
-rw-r--r--sax/qa/cppunit/makefile.mk7
-rw-r--r--sax/qa/cppunit/test_converter.cxx2
-rw-r--r--sax/source/expatwrap/makefile.mk11
-rw-r--r--sax/source/expatwrap/sax.component37
-rw-r--r--sax/source/expatwrap/sax_expat.cxx31
-rw-r--r--sax/source/fastparser/facreg.cxx28
-rw-r--r--sax/source/fastparser/fastsax.component37
-rw-r--r--sax/source/fastparser/makefile.mk7
-rw-r--r--sax/source/tools/fastserializer.cxx66
10 files changed, 137 insertions, 92 deletions
diff --git a/sax/prj/d.lst b/sax/prj/d.lst
index 87f01348163c..76177f554909 100644
--- a/sax/prj/d.lst
+++ b/sax/prj/d.lst
@@ -2,6 +2,9 @@
..\%__SRC%\lib\*.so %_DEST%\lib%_EXT%\*.so
..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib
..\%__SRC%\lib\*.lib %_DEST%\lib%_EXT%\*.lib
+..\%__SRC%\misc\fastsax.component %_DEST%\xml%_EXT%\fastsax.component
+..\%__SRC%\misc\sax.component %_DEST%\xml%_EXT%\sax.component
+..\%__SRC%\misc\sax.inbuild.component %_DEST%\xml%_EXT%\sax.inbuild.component
mkdir: %_DEST%\inc%_EXT%\sax
mkdir: %_DEST%\inc%_EXT%\sax\tools
diff --git a/sax/qa/cppunit/makefile.mk b/sax/qa/cppunit/makefile.mk
index e06eca25a737..b28f0cbac2ab 100644
--- a/sax/qa/cppunit/makefile.mk
+++ b/sax/qa/cppunit/makefile.mk
@@ -35,6 +35,13 @@ ENABLE_EXCEPTIONS=TRUE
.INCLUDE : settings.mk
+#building with stlport, but cppunit was not built with stlport
+.IF "$(USE_SYSTEM_STL)"!="YES"
+.IF "$(SYSTEM_CPPUNIT)"=="YES"
+CFLAGSCXX+=-DADAPT_EXT_STL
+.ENDIF
+.ENDIF
+
CFLAGSCXX += $(CPPUNIT_CFLAGS)
DLLPRE = # no leading "lib" on .so files
diff --git a/sax/qa/cppunit/test_converter.cxx b/sax/qa/cppunit/test_converter.cxx
index 1ea781afff95..b1881f248c0c 100644
--- a/sax/qa/cppunit/test_converter.cxx
+++ b/sax/qa/cppunit/test_converter.cxx
@@ -25,10 +25,12 @@
*
************************************************************************/
+#include "preextstl.h"
#include <cppunit/TestAssert.h>
#include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/plugin/TestPlugIn.h>
+#include "postextstl.h"
#include <rtl/ustrbuf.hxx>
diff --git a/sax/source/expatwrap/makefile.mk b/sax/source/expatwrap/makefile.mk
index bcb73b0443ac..6e1348c0d403 100644
--- a/sax/source/expatwrap/makefile.mk
+++ b/sax/source/expatwrap/makefile.mk
@@ -72,5 +72,16 @@ DEF1NAME= $(SHL1TARGET)
.INCLUDE : target.mk
+ALLTAR : $(MISC)/sax.component $(MISC)/sax.inbuild.component
+$(MISC)/sax.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ sax.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt sax.component
+$(MISC)/sax.inbuild.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt sax.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_INBUILD_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt sax.component
diff --git a/sax/source/expatwrap/sax.component b/sax/source/expatwrap/sax.component
new file mode 100644
index 000000000000..5e6699d9dd33
--- /dev/null
+++ b/sax/source/expatwrap/sax.component
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.extensions.xml.sax.ParserExpat">
+ <service name="com.sun.star.xml.sax.Parser"/>
+ </implementation>
+ <implementation name="com.sun.star.extensions.xml.sax.Writer">
+ <service name="com.sun.star.xml.sax.Writer"/>
+ </implementation>
+</component>
diff --git a/sax/source/expatwrap/sax_expat.cxx b/sax/source/expatwrap/sax_expat.cxx
index 4ffebfa3590d..aaaac6bd564e 100644
--- a/sax/source/expatwrap/sax_expat.cxx
+++ b/sax/source/expatwrap/sax_expat.cxx
@@ -1034,37 +1034,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-
-sal_Bool SAL_CALL component_writeInfo(
- void * /*pServiceManager*/, void * pRegistryKey )
-{
- if (pRegistryKey)
- {
- try
- {
- Reference< XRegistryKey > xKey(
- reinterpret_cast< XRegistryKey * >( pRegistryKey ) );
-
- Reference< XRegistryKey > xNewKey = xKey->createKey(
- OUString::createFromAscii( "/" IMPLEMENTATION_NAME "/UNO/SERVICES" ) );
- xNewKey->createKey( OUString::createFromAscii( SERVICE_NAME ) );
-
- xNewKey = xKey->createKey( OUString::createFromAscii("/") +
- SaxWriter_getImplementationName()+
- OUString::createFromAscii( "/UNO/SERVICES" ) );
- xNewKey->createKey( SaxWriter_getServiceName() );
-
- return sal_True;
- }
- catch (InvalidRegistryException &)
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
- return sal_False;
-}
-
-
void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ )
{
diff --git a/sax/source/fastparser/facreg.cxx b/sax/source/fastparser/facreg.cxx
index 1916a9740f1a..98a55823271e 100644
--- a/sax/source/fastparser/facreg.cxx
+++ b/sax/source/fastparser/facreg.cxx
@@ -40,34 +40,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-
-sal_Bool SAL_CALL component_writeInfo(
- void * /*pServiceManager*/, void * pRegistryKey )
-{
- if (pRegistryKey)
- {
- try
- {
- Reference< XRegistryKey > xKey( reinterpret_cast< XRegistryKey * >( pRegistryKey ) );
-
- Reference< XRegistryKey > xNewKey( xKey->createKey(
- OUString::createFromAscii( "/" PARSER_IMPLEMENTATION_NAME "/UNO/SERVICES" ) ) );
- xNewKey->createKey( OUString::createFromAscii( PARSER_SERVICE_NAME ) );
-
- Reference< XRegistryKey > xNewKey1( xKey->createKey(
- OUString::createFromAscii( "/" SERIALIZER_IMPLEMENTATION_NAME "/UNO/SERVICES" ) ) );
- xNewKey1->createKey( OUString::createFromAscii( SERIALIZER_SERVICE_NAME ) );
-
- return sal_True;
- }
- catch (InvalidRegistryException &)
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
- return sal_False;
-}
-
void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ )
{
void * pRet = 0;
diff --git a/sax/source/fastparser/fastsax.component b/sax/source/fastparser/fastsax.component
new file mode 100644
index 000000000000..a184a76d2d83
--- /dev/null
+++ b/sax/source/fastparser/fastsax.component
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ 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>
+ <implementation name="com.sun.star.comp.extensions.xml.sax.FastSerializer">
+ <service name="com.sun.star.xml.sax.FastSerializer"/>
+ </implementation>
+</component>
diff --git a/sax/source/fastparser/makefile.mk b/sax/source/fastparser/makefile.mk
index 7f70b7aee7bf..d8f9378c19b9 100644
--- a/sax/source/fastparser/makefile.mk
+++ b/sax/source/fastparser/makefile.mk
@@ -70,5 +70,10 @@ DEF1NAME= $(SHL1TARGET)
.INCLUDE : target.mk
+ALLTAR : $(MISC)/fastsax.component
-
+$(MISC)/fastsax.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ fastsax.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt fastsax.component
diff --git a/sax/source/tools/fastserializer.cxx b/sax/source/tools/fastserializer.cxx
index b0318516b72c..af89761a2c86 100644
--- a/sax/source/tools/fastserializer.cxx
+++ b/sax/source/tools/fastserializer.cxx
@@ -27,6 +27,7 @@
#include "fastserializer.hxx"
#include <rtl/ustrbuf.hxx>
+#include <rtl/byteseq.hxx>
#include <com/sun/star/xml/Attribute.hpp>
#include <com/sun/star/xml/FastAttribute.hpp>
@@ -41,6 +42,7 @@ using ::rtl::OUStringToOString;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::RuntimeException;
using ::com::sun::star::uno::Sequence;
+using ::com::sun::star::uno::toUnoSequence;
using ::com::sun::star::xml::FastAttribute;
using ::com::sun::star::xml::Attribute;
using ::com::sun::star::xml::sax::SAXException;
@@ -52,15 +54,15 @@ using ::com::sun::star::io::NotConnectedException;
using ::com::sun::star::io::IOException;
using ::com::sun::star::io::BufferSizeExceededException;
-static Sequence< sal_Int8 > aClosingBracket((sal_Int8 *)">", 1);
-static Sequence< sal_Int8 > aSlashAndClosingBracket((sal_Int8 *)"/>", 2);
-static Sequence< sal_Int8 > aColon((sal_Int8 *)":", 1);
-static Sequence< sal_Int8 > aOpeningBracket((sal_Int8 *)"<", 1);
-static Sequence< sal_Int8 > aOpeningBracketAndSlash((sal_Int8 *)"</", 2);
-static Sequence< sal_Int8 > aQuote((sal_Int8 *)"\"", 1);
-static Sequence< sal_Int8 > aEqualSignAndQuote((sal_Int8 *)"=\"", 2);
-static Sequence< sal_Int8 > aSpace((sal_Int8 *)" ", 1);
-static Sequence< sal_Int8 > aXmlHeader((sal_Int8*) "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n", 56);
+static rtl::ByteSequence aClosingBracket((const sal_Int8 *)">", 1);
+static rtl::ByteSequence aSlashAndClosingBracket((const sal_Int8 *)"/>", 2);
+static rtl::ByteSequence aColon((const sal_Int8 *)":", 1);
+static rtl::ByteSequence aOpeningBracket((const sal_Int8 *)"<", 1);
+static rtl::ByteSequence aOpeningBracketAndSlash((const sal_Int8 *)"</", 2);
+static rtl::ByteSequence aQuote((const sal_Int8 *)"\"", 1);
+static rtl::ByteSequence aEqualSignAndQuote((const sal_Int8 *)"=\"", 2);
+static rtl::ByteSequence aSpace((const sal_Int8 *)" ", 1);
+static rtl::ByteSequence aXmlHeader((const sal_Int8*) "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n", 56);
#define HAS_NAMESPACE(x) ((x & 0xffff0000) != 0)
#define NAMESPACE(x) (x >> 16)
@@ -74,7 +76,7 @@ namespace sax_fastparser {
{
if (!mxOutputStream.is())
return;
- writeBytes(aXmlHeader);
+ writeBytes(toUnoSequence(aXmlHeader));
}
OUString FastSaxSerializer::escapeXml( const OUString& s )
@@ -116,7 +118,7 @@ namespace sax_fastparser {
{
if( HAS_NAMESPACE( nElement ) ) {
writeBytes(mxFastTokenHandler->getUTF8Identifier(NAMESPACE(nElement)));
- writeBytes(aColon);
+ writeBytes(toUnoSequence(aColon));
writeBytes(mxFastTokenHandler->getUTF8Identifier(TOKEN(nElement)));
} else
writeBytes(mxFastTokenHandler->getUTF8Identifier(nElement));
@@ -128,12 +130,12 @@ namespace sax_fastparser {
if (!mxOutputStream.is())
return;
- writeBytes(aOpeningBracket);
+ writeBytes(toUnoSequence(aOpeningBracket));
writeId(Element);
writeFastAttributeList(Attribs);
- writeBytes(aClosingBracket);
+ writeBytes(toUnoSequence(aClosingBracket));
}
void SAL_CALL FastSaxSerializer::startUnknownElement( const OUString& Namespace, const OUString& Name, const Reference< XFastAttributeList >& Attribs )
@@ -142,19 +144,19 @@ namespace sax_fastparser {
if (!mxOutputStream.is())
return;
- writeBytes(aOpeningBracket);
+ writeBytes(toUnoSequence(aOpeningBracket));
if (Namespace.getLength())
{
write(Namespace);
- writeBytes(aColon);
+ writeBytes(toUnoSequence(aColon));
}
write(Name);
writeFastAttributeList(Attribs);
- writeBytes(aClosingBracket);
+ writeBytes(toUnoSequence(aClosingBracket));
}
void SAL_CALL FastSaxSerializer::endFastElement( ::sal_Int32 Element )
@@ -163,11 +165,11 @@ namespace sax_fastparser {
if (!mxOutputStream.is())
return;
- writeBytes(aOpeningBracketAndSlash);
+ writeBytes(toUnoSequence(aOpeningBracketAndSlash));
writeId(Element);
- writeBytes(aClosingBracket);
+ writeBytes(toUnoSequence(aClosingBracket));
}
void SAL_CALL FastSaxSerializer::endUnknownElement( const OUString& Namespace, const OUString& Name )
@@ -176,17 +178,17 @@ namespace sax_fastparser {
if (!mxOutputStream.is())
return;
- writeBytes(aOpeningBracketAndSlash);
+ writeBytes(toUnoSequence(aOpeningBracketAndSlash));
if (Namespace.getLength())
{
write(Namespace);
- writeBytes(aColon);
+ writeBytes(toUnoSequence(aColon));
}
write(Name);
- writeBytes(aClosingBracket);
+ writeBytes(toUnoSequence(aClosingBracket));
}
void SAL_CALL FastSaxSerializer::singleFastElement( ::sal_Int32 Element, const Reference< XFastAttributeList >& Attribs )
@@ -195,12 +197,12 @@ namespace sax_fastparser {
if (!mxOutputStream.is())
return;
- writeBytes(aOpeningBracket);
+ writeBytes(toUnoSequence(aOpeningBracket));
writeId(Element);
writeFastAttributeList(Attribs);
- writeBytes(aSlashAndClosingBracket);
+ writeBytes(toUnoSequence(aSlashAndClosingBracket));
}
void SAL_CALL FastSaxSerializer::singleUnknownElement( const OUString& Namespace, const OUString& Name, const Reference< XFastAttributeList >& Attribs )
@@ -209,19 +211,19 @@ namespace sax_fastparser {
if (!mxOutputStream.is())
return;
- writeBytes(aOpeningBracket);
+ writeBytes(toUnoSequence(aOpeningBracket));
if (Namespace.getLength())
{
write(Namespace);
- writeBytes(aColon);
+ writeBytes(toUnoSequence(aColon));
}
write(Name);
writeFastAttributeList(Attribs);
- writeBytes(aSlashAndClosingBracket);
+ writeBytes(toUnoSequence(aSlashAndClosingBracket));
}
void SAL_CALL FastSaxSerializer::characters( const OUString& aChars )
@@ -251,12 +253,12 @@ namespace sax_fastparser {
sal_Int32 nAttrLength = aAttrSeq.getLength();
for (sal_Int32 i = 0; i < nAttrLength; i++)
{
- writeBytes(aSpace);
+ writeBytes(toUnoSequence(aSpace));
write(pAttr[i].Name);
- writeBytes(aEqualSignAndQuote);
+ writeBytes(toUnoSequence(aEqualSignAndQuote));
write(escapeXml(pAttr[i].Value));
- writeBytes(aQuote);
+ writeBytes(toUnoSequence(aQuote));
}
Sequence< FastAttribute > aFastAttrSeq = Attribs->getFastAttributes();
@@ -264,16 +266,16 @@ namespace sax_fastparser {
sal_Int32 nFastAttrLength = aFastAttrSeq.getLength();
for (sal_Int32 j = 0; j < nFastAttrLength; j++)
{
- writeBytes(aSpace);
+ writeBytes(toUnoSequence(aSpace));
sal_Int32 nToken = pFastAttr[j].Token;
writeId(nToken);
- writeBytes(aEqualSignAndQuote);
+ writeBytes(toUnoSequence(aEqualSignAndQuote));
write(escapeXml(Attribs->getValue(pFastAttr[j].Token)));
- writeBytes(aQuote);
+ writeBytes(toUnoSequence(aQuote));
}
}