From 5273557c66ccb1d7ab0a4e0ecd4196e6e3c63238 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 20 Jul 2010 18:01:48 +0200 Subject: sw34bf01: #i77438#: xmloff: apply patch by cyhawk --- sax/source/tools/converter.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sax/source') diff --git a/sax/source/tools/converter.cxx b/sax/source/tools/converter.cxx index 5df3044bd6d3..26b3c48998f3 100644 --- a/sax/source/tools/converter.cxx +++ b/sax/source/tools/converter.cxx @@ -66,7 +66,7 @@ bool Converter::convertMeasure( sal_Int32& rValue, bool bNeg = false; double nVal = 0; - sal_Int32 nPos = 0L; + sal_Int32 nPos = 0; sal_Int32 nLen = rString.getLength(); // skip white space @@ -579,7 +579,7 @@ bool Converter::convertNumber( sal_Int32& rValue, bool bNeg = false; rValue = 0; - sal_Int32 nPos = 0L; + sal_Int32 nPos = 0; sal_Int32 nLen = rString.getLength(); // skip white space -- cgit From d6f27116f1cf8356382b3211fe8dbca4f52cd1be Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Mon, 30 Aug 2010 16:10:01 +0200 Subject: dr77: change all exported services in oox module from MultiServiceFactory to ComponentContext --- sax/source/tools/fshelper.cxx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'sax/source') diff --git a/sax/source/tools/fshelper.cxx b/sax/source/tools/fshelper.cxx index 743f499fb4f0..6956e5b32bf3 100644 --- a/sax/source/tools/fshelper.cxx +++ b/sax/source/tools/fshelper.cxx @@ -12,8 +12,9 @@ namespace sax_fastparser { FastSerializerHelper::FastSerializerHelper(const Reference< io::XOutputStream >& xOutputStream ) : mpSerializer(new FastSaxSerializer()) { - Reference< lang::XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory(); - mxTokenHandler = Reference ( xFactory->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xml.sax.FastTokenHandler") ) ), UNO_QUERY_THROW ); + Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext(), UNO_SET_THROW ); + Reference< lang::XMultiComponentFactory > xFactory( xContext->getServiceManager(), UNO_SET_THROW ); + mxTokenHandler.set( xFactory->createInstanceWithContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xml.sax.FastTokenHandler") ), xContext ), UNO_QUERY_THROW ); mpSerializer->setFastTokenHandler( mxTokenHandler ); mpSerializer->setOutputStream( xOutputStream ); @@ -23,11 +24,7 @@ FastSerializerHelper::FastSerializerHelper(const Reference< io::XOutputStream >& FastSerializerHelper::~FastSerializerHelper() { mpSerializer->endDocument(); - - if (mpSerializer) { - delete mpSerializer; - mpSerializer = NULL; - } + delete mpSerializer; } void FastSerializerHelper::startElement(const char* elementName, ...) -- cgit From fddc07c4e769a17dd80201ad62cebb3946b5ddce Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 6 Sep 2010 09:27:11 +0100 Subject: cmcfixes78: #i113054# use rtl::ByteSequence instead of Sequence< sal_Int8 > for trivial pre-main sequences --- sax/source/tools/fastserializer.cxx | 66 +++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 32 deletions(-) (limited to 'sax/source') 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 +#include #include #include @@ -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 *)" 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*) "\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 *)"\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)); } } -- cgit From a3c8a0ed0c5c6be1cb5c940750222f6381608bd7 Mon Sep 17 00:00:00 2001 From: sb Date: Fri, 10 Sep 2010 13:10:07 +0200 Subject: sb129: #i113189# change UNO components to use passive registration --- sax/source/expatwrap/makefile.mk | 11 ++++++++++ sax/source/expatwrap/sax.component | 37 +++++++++++++++++++++++++++++++++ sax/source/expatwrap/sax_expat.cxx | 31 --------------------------- sax/source/fastparser/facreg.cxx | 28 ------------------------- sax/source/fastparser/fastsax.component | 37 +++++++++++++++++++++++++++++++++ sax/source/fastparser/makefile.mk | 7 ++++++- 6 files changed, 91 insertions(+), 60 deletions(-) create mode 100644 sax/source/expatwrap/sax.component create mode 100644 sax/source/fastparser/fastsax.component (limited to 'sax/source') diff --git a/sax/source/expatwrap/makefile.mk b/sax/source/expatwrap/makefile.mk index bcb73b0443ac..0b2c0571ae2b 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)$(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 @@ + + + + + + + + + + + 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 @@ + + + + + + + + + + + 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 -- cgit From 2881adacaa7005d5047f508f3ed8737e5c6efa1b Mon Sep 17 00:00:00 2001 From: sb Date: Tue, 14 Sep 2010 09:15:02 +0200 Subject: sb129: #i113189# adapted tests; improved subsequenttests --- sax/source/expatwrap/makefile.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sax/source') diff --git a/sax/source/expatwrap/makefile.mk b/sax/source/expatwrap/makefile.mk index 0b2c0571ae2b..6e1348c0d403 100644 --- a/sax/source/expatwrap/makefile.mk +++ b/sax/source/expatwrap/makefile.mk @@ -83,5 +83,5 @@ $(MISC)/sax.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ $(MISC)/sax.inbuild.component .ERRREMOVE : \ $(SOLARENV)/bin/createcomponent.xslt sax.component $(XSLTPROC) --nonet --stringparam uri \ - '$(COMPONENTPREFIX_INBUILD)$(SHL1TARGETN:f)' -o $@ \ + '$(COMPONENTPREFIX_INBUILD_NATIVE)$(SHL1TARGETN:f)' -o $@ \ $(SOLARENV)/bin/createcomponent.xslt sax.component -- cgit