diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-06-19 12:47:44 +0200 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-06-19 12:47:44 +0200 |
commit | 941020379b1ea1ec7c564c21e68ea1674cda7683 (patch) | |
tree | 40fcaf109d6d585bcdc0faf7ea6c0812b3cc9a39 /sax/source/expatwrap | |
parent | 0692507dcc62e94c7af88388961db1d7d12d6dbd (diff) | |
parent | 0d2916e03ea51529e15995830a1a8c36bd72e442 (diff) |
Merge branch 'master' into feature/gnumake4
Conflicts:
basebmp/prj/d.lst
basebmp/test/basictest.cxx
basebmp/test/makefile.mk
basegfx/inc/basegfx/basegfxdllapi.h
basegfx/inc/basegfx/tools/debugplotter.hxx
basegfx/inc/basegfx/tuple/b2ituple.hxx
basegfx/prj/d.lst
basegfx/source/numeric/makefile.mk
basegfx/source/polygon/makefile.mk
basegfx/source/range/makefile.mk
basegfx/source/raster/makefile.mk
basegfx/source/tuple/makefile.mk
basegfx/source/vector/makefile.mk
basegfx/test/basegfx1d.cxx
basegfx/test/makefile.mk
basegfx/util/makefile.mk
canvas/Library_canvasfactory.mk
canvas/Module_canvas.mk
canvas/prj/build.lst
canvas/prj/d.lst
canvas/source/cairo/cairo_canvashelper_texturefill.cxx
canvas/source/cairo/makefile.mk
canvas/source/tools/makefile.mk
comphelper/qa/string/makefile.mk
cppcanvas/Module_cppcanvas.mk
cppcanvas/inc/cppcanvas/cppcanvasdllapi.h
cppcanvas/prj/build.lst
cppcanvas/prj/d.lst
cppcanvas/source/mtfrenderer/makefile.mk
cppcanvas/util/makefile.mk
i18npool/source/search/makefile.mk
regexp/Library_regexp.mk
regexp/prj/d.lst
sax/CppunitTest_sax.mk
sax/Library_sax.mk
sax/prj/d.lst
sax/qa/cppunit/test_converter.cxx
sax/source/expatwrap/attrlistimpl.hxx
sax/util/makefile.mk
svtools/Library_svt.mk
tools/Executable_sspretty.mk
ucbhelper/prj/d.lst
ucbhelper/source/provider/configureucb.cxx
ucbhelper/source/provider/provconf.cxx
ucbhelper/util/makefile.mk
unotools/Library_utl.mk
unotools/Module_unotools.mk
unotools/Package_inc.mk
unotools/prj/build.lst
vcl/Library_desktop_detector.mk
vcl/Library_vcl.mk
vcl/Library_vclplug_gtk.mk
vcl/aqua/source/gdi/salprn.cxx
vcl/inc/aqua/saldata.hxx
vcl/unx/generic/gdi/salgdi3.cxx
Diffstat (limited to 'sax/source/expatwrap')
-rw-r--r-- | sax/source/expatwrap/attrlistimpl.cxx | 15 | ||||
-rw-r--r-- | sax/source/expatwrap/attrlistimpl.hxx | 2 | ||||
-rw-r--r-- | sax/source/expatwrap/factory.hxx | 2 | ||||
-rw-r--r-- | sax/source/expatwrap/sax_expat.cxx | 64 | ||||
-rw-r--r-- | sax/source/expatwrap/saxwriter.cxx | 31 | ||||
-rw-r--r-- | sax/source/expatwrap/xml2utf.cxx | 6 |
6 files changed, 70 insertions, 50 deletions
diff --git a/sax/source/expatwrap/attrlistimpl.cxx b/sax/source/expatwrap/attrlistimpl.cxx index 114eb653f648..f7ec5d16f664 100644 --- a/sax/source/expatwrap/attrlistimpl.cxx +++ b/sax/source/expatwrap/attrlistimpl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -111,8 +112,10 @@ OUString AttributeList::getTypeByName( const OUString& sName ) throw (RuntimeExc { vector<struct TagAttribute>::iterator ii = m_pImpl->vecAttribute.begin(); - for( ; ii != m_pImpl->vecAttribute.end() ; ii ++ ) { - if( (*ii).sName == sName ) { + for (; ii != m_pImpl->vecAttribute.end(); ++ii ) + { + if( (*ii).sName == sName ) + { return (*ii).sType; } } @@ -123,8 +126,10 @@ OUString AttributeList::getValueByName(const OUString& sName) throw (RuntimeExce { vector<struct TagAttribute>::iterator ii = m_pImpl->vecAttribute.begin(); - for( ; ii != m_pImpl->vecAttribute.end() ; ii ++ ) { - if( (*ii).sName == sName ) { + for (; ii != m_pImpl->vecAttribute.end(); ++ii) + { + if( (*ii).sName == sName ) + { return (*ii).sValue; } } @@ -166,3 +171,5 @@ void AttributeList::clear() } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sax/source/expatwrap/attrlistimpl.hxx b/sax/source/expatwrap/attrlistimpl.hxx index 3676469a67c7..58d94792dc0f 100644 --- a/sax/source/expatwrap/attrlistimpl.hxx +++ b/sax/source/expatwrap/attrlistimpl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -80,3 +81,4 @@ private: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sax/source/expatwrap/factory.hxx b/sax/source/expatwrap/factory.hxx index c6a566781044..169788a02bfe 100644 --- a/sax/source/expatwrap/factory.hxx +++ b/sax/source/expatwrap/factory.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -32,3 +33,4 @@ OUString SaxWriter_getImplementationName() throw(); Sequence< OUString > SaxWriter_getSupportedServiceNames(void) throw(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sax/source/expatwrap/sax_expat.cxx b/sax/source/expatwrap/sax_expat.cxx index 27ede854b974..06258510ceca 100644 --- a/sax/source/expatwrap/sax_expat.cxx +++ b/sax/source/expatwrap/sax_expat.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -466,7 +467,7 @@ void SaxExpatParser::parseStream( const InputSource& structSource) if( ! entity.structSource.aInputStream.is() ) { - throw SAXException( OUString::createFromAscii( "No input source" ) , + throw SAXException( OUString(RTL_CONSTASCII_USTRINGPARAM("No input source")) , Reference< XInterface > () , Any() ); } @@ -481,7 +482,7 @@ void SaxExpatParser::parseStream( const InputSource& structSource) entity.pParser = XML_ParserCreate( 0 ); if( ! entity.pParser ) { - throw SAXException( OUString::createFromAscii( "Couldn't create parser" ) , + throw SAXException( OUString(RTL_CONSTASCII_USTRINGPARAM("Couldn't create parser")) , Reference< XInterface > (), Any() ); } @@ -595,7 +596,7 @@ void SaxExpatParser::setLocale( const Locale & locale ) throw (RuntimeException) // XServiceInfo OUString SaxExpatParser::getImplementationName() throw () { - return OUString::createFromAscii( IMPLEMENTATION_NAME ); + return OUString(RTL_CONSTASCII_USTRINGPARAM( IMPLEMENTATION_NAME )); } // XServiceInfo @@ -616,7 +617,7 @@ Sequence< OUString > SaxExpatParser::getSupportedServiceNames(void) throw () { Sequence<OUString> seq(1); - seq.getArray()[0] = OUString::createFromAscii( SERVICE_NAME ); + seq.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( SERVICE_NAME )); return seq; } @@ -631,82 +632,82 @@ OUString getErrorMessage( XML_Error xmlE, OUString sSystemId , sal_Int32 nLine ) { OUString Message; if( XML_ERROR_NONE == xmlE ) { - Message = OUString::createFromAscii( "No" ); + Message = OUString(RTL_CONSTASCII_USTRINGPARAM("No")); } else if( XML_ERROR_NO_MEMORY == xmlE ) { - Message = OUString::createFromAscii( "no memory" ); + Message = OUString(RTL_CONSTASCII_USTRINGPARAM("no memory")); } else if( XML_ERROR_SYNTAX == xmlE ) { - Message = OUString::createFromAscii( "syntax" ); + Message = OUString(RTL_CONSTASCII_USTRINGPARAM("syntax")); } else if( XML_ERROR_NO_ELEMENTS == xmlE ) { - Message = OUString::createFromAscii( "no elements" ); + Message = OUString(RTL_CONSTASCII_USTRINGPARAM("no elements")); } else if( XML_ERROR_INVALID_TOKEN == xmlE ) { - Message = OUString::createFromAscii( "invalid token" ); + Message = OUString(RTL_CONSTASCII_USTRINGPARAM("invalid token")); } else if( XML_ERROR_UNCLOSED_TOKEN == xmlE ) { - Message = OUString::createFromAscii( "unclosed token" ); + Message = OUString(RTL_CONSTASCII_USTRINGPARAM("unclosed token")); } else if( XML_ERROR_PARTIAL_CHAR == xmlE ) { - Message = OUString::createFromAscii( "partial char" ); + Message = OUString(RTL_CONSTASCII_USTRINGPARAM("partial char")); } else if( XML_ERROR_TAG_MISMATCH == xmlE ) { - Message = OUString::createFromAscii( "tag mismatch" ); + Message = OUString(RTL_CONSTASCII_USTRINGPARAM("tag mismatch")); } else if( XML_ERROR_DUPLICATE_ATTRIBUTE == xmlE ) { - Message = OUString::createFromAscii( "duplicate attribute" ); + Message = OUString(RTL_CONSTASCII_USTRINGPARAM("duplicate attribute")); } else if( XML_ERROR_JUNK_AFTER_DOC_ELEMENT == xmlE ) { - Message = OUString::createFromAscii( "junk after doc element" ); + Message = OUString(RTL_CONSTASCII_USTRINGPARAM("junk after doc element")); } else if( XML_ERROR_PARAM_ENTITY_REF == xmlE ) { - Message = OUString::createFromAscii( "parameter entity reference" ); + Message = OUString(RTL_CONSTASCII_USTRINGPARAM("parameter entity reference")); } else if( XML_ERROR_UNDEFINED_ENTITY == xmlE ) { - Message = OUString::createFromAscii( "undefined entity" ); + Message = OUString(RTL_CONSTASCII_USTRINGPARAM("undefined entity")); } else if( XML_ERROR_RECURSIVE_ENTITY_REF == xmlE ) { - Message = OUString::createFromAscii( "recursive entity reference" ); + Message = OUString(RTL_CONSTASCII_USTRINGPARAM("recursive entity reference")); } else if( XML_ERROR_ASYNC_ENTITY == xmlE ) { - Message = OUString::createFromAscii( "async entity" ); + Message = OUString(RTL_CONSTASCII_USTRINGPARAM("async entity")); } else if( XML_ERROR_BAD_CHAR_REF == xmlE ) { - Message = OUString::createFromAscii( "bad char reference" ); + Message = OUString(RTL_CONSTASCII_USTRINGPARAM("bad char reference")); } else if( XML_ERROR_BINARY_ENTITY_REF == xmlE ) { - Message = OUString::createFromAscii( "binary entity reference" ); + Message = OUString(RTL_CONSTASCII_USTRINGPARAM("binary entity reference")); } else if( XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF == xmlE ) { - Message = OUString::createFromAscii( "attribute external entity reference" ); + Message = OUString(RTL_CONSTASCII_USTRINGPARAM("attribute external entity reference")); } else if( XML_ERROR_MISPLACED_XML_PI == xmlE ) { - Message = OUString::createFromAscii( "misplaced xml processing instruction" ); + Message = OUString(RTL_CONSTASCII_USTRINGPARAM("misplaced xml processing instruction")); } else if( XML_ERROR_UNKNOWN_ENCODING == xmlE ) { - Message = OUString::createFromAscii( "unknown encoding" ); + Message = OUString(RTL_CONSTASCII_USTRINGPARAM("unknown encoding")); } else if( XML_ERROR_INCORRECT_ENCODING == xmlE ) { - Message = OUString::createFromAscii( "incorrect encoding" ); + Message = OUString(RTL_CONSTASCII_USTRINGPARAM("incorrect encoding")); } else if( XML_ERROR_UNCLOSED_CDATA_SECTION == xmlE ) { - Message = OUString::createFromAscii( "unclosed cdata section" ); + Message = OUString(RTL_CONSTASCII_USTRINGPARAM("unclosed cdata section")); } else if( XML_ERROR_EXTERNAL_ENTITY_HANDLING == xmlE ) { - Message = OUString::createFromAscii( "external entity reference" ); + Message = OUString(RTL_CONSTASCII_USTRINGPARAM("external entity reference")); } else if( XML_ERROR_NOT_STANDALONE == xmlE ) { - Message = OUString::createFromAscii( "not standalone" ); + Message = OUString(RTL_CONSTASCII_USTRINGPARAM("not standalone")); } - OUString str = OUString::createFromAscii( "[" ); + OUString str(RTL_CONSTASCII_USTRINGPARAM("[")); str += sSystemId; - str += OUString::createFromAscii( " line " ); + str += OUString(RTL_CONSTASCII_USTRINGPARAM(" line ")); str += OUString::valueOf( nLine ); - str += OUString::createFromAscii( "]: " ); + str += OUString(RTL_CONSTASCII_USTRINGPARAM("]: ")); str += Message; - str += OUString::createFromAscii( "error" ); + str += OUString(RTL_CONSTASCII_USTRINGPARAM("error")); return str; } @@ -1074,3 +1075,4 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sax/source/expatwrap/saxwriter.cxx b/sax/source/expatwrap/saxwriter.cxx index 92d53700aa86..1417fb644679 100644 --- a/sax/source/expatwrap/saxwriter.cxx +++ b/sax/source/expatwrap/saxwriter.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -178,7 +179,8 @@ public: sal_Bool bDoNormalization, sal_Bool bNormalizeWhitespace) throw( SAXException ); - sal_uInt32 GetLastColumnCount() { return (sal_uInt32)(nCurrentPos - nLastLineFeedPos); } + sal_uInt32 GetLastColumnCount() const + { return (sal_uInt32)(nCurrentPos - nLastLineFeedPos); } inline void startDocument() throw( SAXException ); @@ -244,7 +246,7 @@ inline sal_uInt32 SaxWriterHelper::writeSequence() throw( SAXException ) Any a; a <<= e; throw SAXException( - OUString::createFromAscii( "io exception during writing" ), + OUString(RTL_CONSTASCII_USTRINGPARAM("io exception during writing")), Reference< XInterface > (), a ); } @@ -455,7 +457,7 @@ inline sal_Bool SaxWriterHelper::convertToXML( const sal_Unicode * pStr, } else { - OSL_ENSURE( false, "illegal Unicode character" ); + OSL_FAIL( "illegal Unicode character" ); bRet = sal_False; } @@ -1001,7 +1003,7 @@ public: // XServiceInfo private: void writeSequence( const Sequence<sal_Int8> & seq ); - sal_Int32 getIndentPrefixLength( sal_Int32 nFirstLineBreakOccurence ) throw(); + sal_Int32 getIndentPrefixLength( sal_Int32 nFirstLineBreakOccurrence ) throw(); Reference< XOutputStream > m_out; Sequence < sal_Int8 > m_seqStartElement; @@ -1029,12 +1031,12 @@ Reference < XInterface > SAL_CALL SaxWriter_CreateInstance( OUString SaxWriter_getServiceName() throw() { - return OUString::createFromAscii( "com.sun.star.xml.sax.Writer" ); + return OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Writer")); } OUString SaxWriter_getImplementationName() throw() { - return OUString::createFromAscii( "com.sun.star.extensions.xml.sax.Writer" ); + return OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.extensions.xml.sax.Writer")); } Sequence< OUString > SaxWriter_getSupportedServiceNames(void) throw() @@ -1045,14 +1047,14 @@ Sequence< OUString > SaxWriter_getSupportedServiceNames(void) throw() } -sal_Int32 SAXWriter::getIndentPrefixLength( sal_Int32 nFirstLineBreakOccurence ) throw() +sal_Int32 SAXWriter::getIndentPrefixLength( sal_Int32 nFirstLineBreakOccurrence ) throw() { sal_Int32 nLength =-1; if (mp_SaxWriterHelper) { if ( m_bForceLineBreak || (m_bAllowLineBreak && - ((nFirstLineBreakOccurence + mp_SaxWriterHelper->GetLastColumnCount()) > MAXCOLUMNCOUNT)) ) + ((nFirstLineBreakOccurrence + mp_SaxWriterHelper->GetLastColumnCount()) > MAXCOLUMNCOUNT)) ) nLength = m_nLevel; } m_bForceLineBreak = sal_False; @@ -1110,12 +1112,12 @@ void SAXWriter::endDocument(void) throw(SAXException, RuntimeE if( ! m_bDocStarted ) { throw SAXException( - OUString::createFromAscii( "endDocument called before startDocument" ), + OUString(RTL_CONSTASCII_USTRINGPARAM("endDocument called before startDocument")), Reference< XInterface >() , Any() ); } if( m_nLevel ) { throw SAXException( - OUString::createFromAscii( "unexpected end of document" ), + OUString(RTL_CONSTASCII_USTRINGPARAM("unexpected end of document")), Reference< XInterface >() , Any() ); } mp_SaxWriterHelper->endDocument(); @@ -1128,7 +1130,7 @@ void SAXWriter::endDocument(void) throw(SAXException, RuntimeE Any a; a <<= e; throw SAXException( - OUString::createFromAscii( "IO exception during closing the IO Stream" ), + OUString(RTL_CONSTASCII_USTRINGPARAM("IO exception during closing the IO Stream")), Reference< XInterface > (), a ); } @@ -1256,19 +1258,19 @@ void SAXWriter::characters(const OUString& aChars) throw(SAXException, RuntimeE bThrowException = !mp_SaxWriterHelper->writeString( aChars, sal_False, sal_False ); else { - // Note : nFirstLineBreakOccurence is not exact, because we don't know, how + // Note : nFirstLineBreakOccurrence is not exact, because we don't know, how // many 2 and 3 byte chars are inbetween. However this whole stuff // is eitherway for pretty printing only, so it does not need to be exact. sal_Int32 nLength(0); sal_Int32 nIndentPrefix(-1); if (m_bAllowLineBreak) { - sal_Int32 nFirstLineBreakOccurence = getFirstLineBreak( aChars ); + sal_Int32 nFirstLineBreakOccurrence = getFirstLineBreak( aChars ); nLength = calcXMLByteLength( aChars.getStr(), aChars.getLength(), ! m_bIsCDATA , sal_False ); nIndentPrefix = getIndentPrefixLength( - nFirstLineBreakOccurence >= 0 ? nFirstLineBreakOccurence : nLength ); + nFirstLineBreakOccurrence >= 0 ? nFirstLineBreakOccurrence : nLength ); } else nIndentPrefix = getIndentPrefixLength(nLength); @@ -1452,3 +1454,4 @@ void SAXWriter::unknown(const OUString& sString) throw (SAXException, RuntimeExc } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sax/source/expatwrap/xml2utf.cxx b/sax/source/expatwrap/xml2utf.cxx index bbd72b2a0d8b..b7aa1cad0424 100644 --- a/sax/source/expatwrap/xml2utf.cxx +++ b/sax/source/expatwrap/xml2utf.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,10 +35,11 @@ #include <com/sun/star/io/XInputStream.hpp> -using namespace rtl; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::io; +using ::rtl::OString; + #include "xml2utf.hxx" namespace sax_expatwrap { @@ -568,3 +570,5 @@ void Unicode2TextConverter::init( rtl_TextEncoding encoding ) } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |