summaryrefslogtreecommitdiff
path: root/sax/source
diff options
context:
space:
mode:
authoros <os@openoffice.org>2009-11-10 15:32:07 +0100
committeros <os@openoffice.org>2009-11-10 15:32:07 +0100
commit001cc8fcaaa5614aa63bbd3184b6f1780ab57dbb (patch)
tree5d98a4730af6d3066b98a63280a7407823d125e9 /sax/source
parent59cfb5db4135f4e57e40143cb03f944982c6eff8 (diff)
parent24534f00dd8799b3c2b2365ccd8c0009e19cddd5 (diff)
rebase
Diffstat (limited to 'sax/source')
-rw-r--r--sax/source/expatwrap/sax_expat.cxx13
-rw-r--r--sax/source/expatwrap/saxwriter.cxx4
2 files changed, 14 insertions, 3 deletions
diff --git a/sax/source/expatwrap/sax_expat.cxx b/sax/source/expatwrap/sax_expat.cxx
index 662d58d3f28a..e1f5161b7e3a 100644
--- a/sax/source/expatwrap/sax_expat.cxx
+++ b/sax/source/expatwrap/sax_expat.cxx
@@ -136,6 +136,11 @@ OUString XmlChar2OUString( const XML_Char *p )
pThis->rDocumentLocator->getColumnNumber()\
) );\
}\
+ catch( com::sun::star::uno::RuntimeException &e ) {\
+ pThis->bExceptionWasThrown = sal_True; \
+ pThis->bRTExceptionWasThrown = sal_True; \
+ pImpl->rtexception = e; \
+ }\
}\
((void)0)
@@ -256,7 +261,9 @@ public: // module scope
// Exception cannot be thrown through the C-XmlParser (possible resource leaks),
// therefor the exception must be saved somewhere.
SAXParseException exception;
- sal_Bool bExceptionWasThrown;
+ RuntimeException rtexception;
+ sal_Bool bExceptionWasThrown;
+ sal_Bool bRTExceptionWasThrown;
Locale locale;
@@ -437,6 +444,7 @@ SaxExpatParser::SaxExpatParser( )
m_pImpl->rAttrList = Reference< XAttributeList > ( m_pImpl->pAttrList );
m_pImpl->bExceptionWasThrown = sal_False;
+ m_pImpl->bRTExceptionWasThrown = sal_False;
}
SaxExpatParser::~SaxExpatParser()
@@ -737,6 +745,9 @@ void SaxExpatParser_Impl::parse( )
if( ! bContinue || this->bExceptionWasThrown ) {
+ if ( this->bRTExceptionWasThrown )
+ throw rtexception;
+
// Error during parsing !
XML_Error xmlE = XML_GetErrorCode( getEntity().pParser );
OUString sSystemId = rDocumentLocator->getSystemId();
diff --git a/sax/source/expatwrap/saxwriter.cxx b/sax/source/expatwrap/saxwriter.cxx
index b3fba10cc911..717767d86e11 100644
--- a/sax/source/expatwrap/saxwriter.cxx
+++ b/sax/source/expatwrap/saxwriter.cxx
@@ -436,7 +436,7 @@ inline sal_Bool SaxWriterHelper::convertToXML( const sal_Unicode * pStr,
OSL_ENSURE( nSurrogate != 0, "lone 2nd Unicode surrogate" );
nSurrogate = ( nSurrogate << 10 ) | ( c & 0x03ff );
- if( nSurrogate > 0x00010000 && nSurrogate <= 0x001FFFFF )
+ if( nSurrogate >= 0x00010000 && nSurrogate <= 0x0010FFFF )
{
sal_Int8 aBytes[] = { sal_Int8(0xF0 | ((nSurrogate >> 18) & 0x0F)),
sal_Int8(0x80 | ((nSurrogate >> 12) & 0x3F)),
@@ -864,7 +864,7 @@ inline sal_Int32 calcXMLByteLength( const sal_Unicode *pStr, sal_Int32 nStrLen,
{
// 2. surrogate: write as UTF-8 (if range is OK
nSurrogate = ( nSurrogate << 10 ) | ( c & 0x03ff );
- if( nSurrogate > 0x00010000 && nSurrogate <= 0x001FFFFF )
+ if( nSurrogate >= 0x00010000 && nSurrogate <= 0x0010FFFF )
nOutputLength += 4;
nSurrogate = 0;
}