summaryrefslogtreecommitdiff
path: root/sax
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2012-05-31 21:35:45 -0500
committerNorbert Thiebaud <nthiebaud@gmail.com>2012-05-31 21:35:45 -0500
commit31cc01a5ffe32c1c7b8226d09d799ea83f6a8d30 (patch)
treef404d5ae14f35e11d9ec31e1c0a71fee8464b5a9 /sax
parent43c0c12369f379ec1c851486883a855f8f445d70 (diff)
targeted string re-work
Change-Id: Ifd6b90778725d94a9338a53a4cdc514cdb595052
Diffstat (limited to 'sax')
-rw-r--r--sax/source/expatwrap/sax_expat.cxx69
-rw-r--r--sax/source/expatwrap/saxwriter.cxx34
-rw-r--r--sax/test/sax/testsax.cxx30
-rw-r--r--sax/test/sax/testwriter.cxx68
-rw-r--r--sax/test/saxdemo.cxx50
-rw-r--r--sax/test/testcomponent.cxx16
6 files changed, 133 insertions, 134 deletions
diff --git a/sax/source/expatwrap/sax_expat.cxx b/sax/source/expatwrap/sax_expat.cxx
index 360611f10ba4..42e4371f7882 100644
--- a/sax/source/expatwrap/sax_expat.cxx
+++ b/sax/source/expatwrap/sax_expat.cxx
@@ -207,7 +207,7 @@ Reference< XInterface > SAL_CALL SaxExpatParser_CreateInstance(
Sequence< OUString > SaxExpatParser::getSupportedServiceNames_Static(void) throw ()
{
Sequence<OUString> aRet(1);
- aRet.getArray()[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(SERVICE_NAME) );
+ aRet.getArray()[0] = ::rtl::OUString( SERVICE_NAME );
return aRet;
}
@@ -476,7 +476,7 @@ void SaxExpatParser::parseStream( const InputSource& structSource)
if( ! entity.structSource.aInputStream.is() )
{
- throw SAXException( OUString(RTL_CONSTASCII_USTRINGPARAM("No input source")) ,
+ throw SAXException( OUString("No input source") ,
Reference< XInterface > () , Any() );
}
@@ -491,7 +491,7 @@ void SaxExpatParser::parseStream( const InputSource& structSource)
entity.pParser = XML_ParserCreate( 0 );
if( ! entity.pParser )
{
- throw SAXException( OUString(RTL_CONSTASCII_USTRINGPARAM("Couldn't create parser")) ,
+ throw SAXException( OUString("Couldn't create parser") ,
Reference< XInterface > (), Any() );
}
@@ -604,7 +604,7 @@ void SaxExpatParser::setLocale( const Locale & locale ) throw (RuntimeException)
// XServiceInfo
OUString SaxExpatParser::getImplementationName() throw ()
{
- return OUString(RTL_CONSTASCII_USTRINGPARAM( IMPLEMENTATION_NAME ));
+ return OUString( IMPLEMENTATION_NAME );
}
// XServiceInfo
@@ -625,7 +625,7 @@ Sequence< OUString > SaxExpatParser::getSupportedServiceNames(void) throw ()
{
Sequence<OUString> seq(1);
- seq.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( SERVICE_NAME ));
+ seq.getArray()[0] = OUString( SERVICE_NAME );
return seq;
}
@@ -640,82 +640,82 @@ OUString getErrorMessage( XML_Error xmlE, OUString sSystemId , sal_Int32 nLine )
{
OUString Message;
if( XML_ERROR_NONE == xmlE ) {
- Message = OUString(RTL_CONSTASCII_USTRINGPARAM("No"));
+ Message = OUString("No");
}
else if( XML_ERROR_NO_MEMORY == xmlE ) {
- Message = OUString(RTL_CONSTASCII_USTRINGPARAM("no memory"));
+ Message = OUString("no memory");
}
else if( XML_ERROR_SYNTAX == xmlE ) {
- Message = OUString(RTL_CONSTASCII_USTRINGPARAM("syntax"));
+ Message = OUString("syntax");
}
else if( XML_ERROR_NO_ELEMENTS == xmlE ) {
- Message = OUString(RTL_CONSTASCII_USTRINGPARAM("no elements"));
+ Message = OUString("no elements");
}
else if( XML_ERROR_INVALID_TOKEN == xmlE ) {
- Message = OUString(RTL_CONSTASCII_USTRINGPARAM("invalid token"));
+ Message = OUString("invalid token");
}
else if( XML_ERROR_UNCLOSED_TOKEN == xmlE ) {
- Message = OUString(RTL_CONSTASCII_USTRINGPARAM("unclosed token"));
+ Message = OUString("unclosed token");
}
else if( XML_ERROR_PARTIAL_CHAR == xmlE ) {
- Message = OUString(RTL_CONSTASCII_USTRINGPARAM("partial char"));
+ Message = OUString("partial char");
}
else if( XML_ERROR_TAG_MISMATCH == xmlE ) {
- Message = OUString(RTL_CONSTASCII_USTRINGPARAM("tag mismatch"));
+ Message = OUString("tag mismatch");
}
else if( XML_ERROR_DUPLICATE_ATTRIBUTE == xmlE ) {
- Message = OUString(RTL_CONSTASCII_USTRINGPARAM("duplicate attribute"));
+ Message = OUString("duplicate attribute");
}
else if( XML_ERROR_JUNK_AFTER_DOC_ELEMENT == xmlE ) {
- Message = OUString(RTL_CONSTASCII_USTRINGPARAM("junk after doc element"));
+ Message = OUString("junk after doc element");
}
else if( XML_ERROR_PARAM_ENTITY_REF == xmlE ) {
- Message = OUString(RTL_CONSTASCII_USTRINGPARAM("parameter entity reference"));
+ Message = OUString("parameter entity reference");
}
else if( XML_ERROR_UNDEFINED_ENTITY == xmlE ) {
- Message = OUString(RTL_CONSTASCII_USTRINGPARAM("undefined entity"));
+ Message = OUString("undefined entity");
}
else if( XML_ERROR_RECURSIVE_ENTITY_REF == xmlE ) {
- Message = OUString(RTL_CONSTASCII_USTRINGPARAM("recursive entity reference"));
+ Message = OUString("recursive entity reference");
}
else if( XML_ERROR_ASYNC_ENTITY == xmlE ) {
- Message = OUString(RTL_CONSTASCII_USTRINGPARAM("async entity"));
+ Message = OUString("async entity");
}
else if( XML_ERROR_BAD_CHAR_REF == xmlE ) {
- Message = OUString(RTL_CONSTASCII_USTRINGPARAM("bad char reference"));
+ Message = OUString("bad char reference");
}
else if( XML_ERROR_BINARY_ENTITY_REF == xmlE ) {
- Message = OUString(RTL_CONSTASCII_USTRINGPARAM("binary entity reference"));
+ Message = OUString("binary entity reference");
}
else if( XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF == xmlE ) {
- Message = OUString(RTL_CONSTASCII_USTRINGPARAM("attribute external entity reference"));
+ Message = OUString("attribute external entity reference");
}
else if( XML_ERROR_MISPLACED_XML_PI == xmlE ) {
- Message = OUString(RTL_CONSTASCII_USTRINGPARAM("misplaced xml processing instruction"));
+ Message = OUString("misplaced xml processing instruction");
}
else if( XML_ERROR_UNKNOWN_ENCODING == xmlE ) {
- Message = OUString(RTL_CONSTASCII_USTRINGPARAM("unknown encoding"));
+ Message = OUString("unknown encoding");
}
else if( XML_ERROR_INCORRECT_ENCODING == xmlE ) {
- Message = OUString(RTL_CONSTASCII_USTRINGPARAM("incorrect encoding"));
+ Message = OUString("incorrect encoding");
}
else if( XML_ERROR_UNCLOSED_CDATA_SECTION == xmlE ) {
- Message = OUString(RTL_CONSTASCII_USTRINGPARAM("unclosed cdata section"));
+ Message = OUString("unclosed cdata section");
}
else if( XML_ERROR_EXTERNAL_ENTITY_HANDLING == xmlE ) {
- Message = OUString(RTL_CONSTASCII_USTRINGPARAM("external entity reference"));
+ Message = OUString("external entity reference");
}
else if( XML_ERROR_NOT_STANDALONE == xmlE ) {
- Message = OUString(RTL_CONSTASCII_USTRINGPARAM("not standalone"));
+ Message = OUString("not standalone");
}
- OUString str(RTL_CONSTASCII_USTRINGPARAM("["));
+ OUString str("[");
str += sSystemId;
- str += OUString(RTL_CONSTASCII_USTRINGPARAM(" line "));
+ str += OUString(" line ");
str += OUString::valueOf( nLine );
- str += OUString(RTL_CONSTASCII_USTRINGPARAM("]: "));
+ str += OUString("]: ");
str += Message;
- str += OUString(RTL_CONSTASCII_USTRINGPARAM("error"));
+ str += OUString("error");
return str;
}
@@ -791,7 +791,7 @@ void SaxExpatParser_Impl::callbackStartElement( void *pvThis ,
{
// in case of two concurrent threads, there is only the danger of an leak,
// which is neglectable for one string
- static OUString g_CDATA( RTL_CONSTASCII_USTRINGPARAM( "CDATA" ) );
+ static OUString g_CDATA( "CDATA" );
SaxExpatParser_Impl *pImpl = ((SaxExpatParser_Impl*)pvThis);
@@ -863,8 +863,7 @@ void SaxExpatParser_Impl::callbackEntityDecl(
OSL_TRACE("SaxExpatParser: internal entity declaration, stopping");
XML_StopParser(pImpl->getEntity().pParser, XML_FALSE);
pImpl->exception = SAXParseException(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "SaxExpatParser: internal entity declaration, stopping")),
+ ::rtl::OUString( "SaxExpatParser: internal entity declaration, stopping"),
0, Any(),
pImpl->rDocumentLocator->getPublicId(),
pImpl->rDocumentLocator->getSystemId(),
diff --git a/sax/source/expatwrap/saxwriter.cxx b/sax/source/expatwrap/saxwriter.cxx
index 287e2f7458e1..57f99f0cfbbe 100644
--- a/sax/source/expatwrap/saxwriter.cxx
+++ b/sax/source/expatwrap/saxwriter.cxx
@@ -198,7 +198,7 @@ inline sal_uInt32 SaxWriterHelper::writeSequence() throw( SAXException )
Any a;
a <<= e;
throw SAXException(
- OUString(RTL_CONSTASCII_USTRINGPARAM("io exception during writing")),
+ OUString("io exception during writing"),
Reference< XInterface > (),
a );
}
@@ -983,12 +983,12 @@ Reference < XInterface > SAL_CALL SaxWriter_CreateInstance(
OUString SaxWriter_getServiceName() throw()
{
- return OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Writer"));
+ return OUString("com.sun.star.xml.sax.Writer");
}
OUString SaxWriter_getImplementationName() throw()
{
- return OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.extensions.xml.sax.Writer"));
+ return OUString("com.sun.star.extensions.xml.sax.Writer");
}
Sequence< OUString > SaxWriter_getSupportedServiceNames(void) throw()
@@ -1064,12 +1064,12 @@ void SAXWriter::endDocument(void) throw(SAXException, RuntimeE
if( ! m_bDocStarted )
{
throw SAXException(
- OUString(RTL_CONSTASCII_USTRINGPARAM("endDocument called before startDocument")),
+ OUString("endDocument called before startDocument"),
Reference< XInterface >() , Any() );
}
if( m_nLevel ) {
throw SAXException(
- OUString(RTL_CONSTASCII_USTRINGPARAM("unexpected end of document")),
+ OUString("unexpected end of document"),
Reference< XInterface >() , Any() );
}
mp_SaxWriterHelper->endDocument();
@@ -1082,7 +1082,7 @@ void SAXWriter::endDocument(void) throw(SAXException, RuntimeE
Any a;
a <<= e;
throw SAXException(
- OUString(RTL_CONSTASCII_USTRINGPARAM("IO exception during closing the IO Stream")),
+ OUString("IO exception during closing the IO Stream"),
Reference< XInterface > (),
a );
}
@@ -1095,13 +1095,13 @@ void SAXWriter::startElement(const OUString& aName, const Reference< XAttributeL
if( ! m_bDocStarted )
{
SAXException except;
- except.Message = OUString( RTL_CONSTASCII_USTRINGPARAM( "startElement called before startDocument" ));
+ except.Message = OUString( "startElement called before startDocument" );
throw except;
}
if( m_bIsCDATA )
{
SAXException except;
- except.Message = OUString( RTL_CONSTASCII_USTRINGPARAM( "startElement call not allowed with CDATA sections" ));
+ except.Message = OUString( "startElement call not allowed with CDATA sections" );
throw except;
}
@@ -1147,13 +1147,13 @@ void SAXWriter::startElement(const OUString& aName, const Reference< XAttributeL
if (eRet == SAX_WARNING)
{
SAXInvalidCharacterException except;
- except.Message = OUString( RTL_CONSTASCII_USTRINGPARAM( "Invalid charcter during XML-Export in a attribute value" ) );
+ except.Message = OUString( "Invalid charcter during XML-Export in a attribute value" );
throw except;
}
else if (eRet == SAX_ERROR)
{
SAXException except;
- except.Message = OUString( RTL_CONSTASCII_USTRINGPARAM( "Invalid charcter during XML-Export" ) );
+ except.Message = OUString( "Invalid charcter during XML-Export" );
throw except;
}
}
@@ -1189,7 +1189,7 @@ void SAXWriter::endElement(const OUString& aName) throw (SAXException, Runtime
if (!bRet)
{
SAXException except;
- except.Message = OUString( RTL_CONSTASCII_USTRINGPARAM( "Invalid charcter during XML-Export" ) );
+ except.Message = OUString( "Invalid charcter during XML-Export" );
throw except;
}
}
@@ -1199,7 +1199,7 @@ void SAXWriter::characters(const OUString& aChars) throw(SAXException, RuntimeE
if( ! m_bDocStarted )
{
SAXException except;
- except.Message = OUString( RTL_CONSTASCII_USTRINGPARAM( "characters method called before startDocument" ) );
+ except.Message = OUString( "characters method called before startDocument" );
throw except;
}
@@ -1241,7 +1241,7 @@ void SAXWriter::characters(const OUString& aChars) throw(SAXException, RuntimeE
if (bThrowException)
{
SAXInvalidCharacterException except;
- except.Message = OUString( RTL_CONSTASCII_USTRINGPARAM( "Invalid charcter during XML-Export" ) );
+ except.Message = OUString( "Invalid charcter during XML-Export" );
throw except;
}
}
@@ -1286,7 +1286,7 @@ void SAXWriter::processingInstruction(const OUString& aTarget, const OUString& a
if (!mp_SaxWriterHelper->processingInstruction(aTarget, aData))
{
SAXException except;
- except.Message = OUString( RTL_CONSTASCII_USTRINGPARAM( "Invalid charcter during XML-Export" ) );
+ except.Message = OUString( "Invalid charcter during XML-Export" );
throw except;
}
}
@@ -1320,7 +1320,7 @@ void SAXWriter::endCDATA(void) throw (RuntimeException)
if( ! m_bDocStarted | ! m_bIsCDATA)
{
SAXException except;
- except.Message = OUString( RTL_CONSTASCII_USTRINGPARAM( "endCDATA was called without startCDATA" ) );
+ except.Message = OUString( "endCDATA was called without startCDATA" );
throw except;
}
@@ -1358,7 +1358,7 @@ void SAXWriter::comment(const OUString& sComment) throw(SAXException, RuntimeExc
if (!mp_SaxWriterHelper->comment(sComment))
{
SAXException except;
- except.Message = OUString( RTL_CONSTASCII_USTRINGPARAM( "Invalid charcter during XML-Export" ) );
+ except.Message = OUString( "Invalid charcter during XML-Export" );
throw except;
}
}
@@ -1399,7 +1399,7 @@ void SAXWriter::unknown(const OUString& sString) throw (SAXException, RuntimeExc
if (!mp_SaxWriterHelper->writeString( sString, sal_False, sal_False))
{
SAXException except;
- except.Message = OUString( RTL_CONSTASCII_USTRINGPARAM( "Invalid charcter during XML-Export" ) );
+ except.Message = OUString( "Invalid charcter during XML-Export" );
throw except;
}
}
diff --git a/sax/test/sax/testsax.cxx b/sax/test/sax/testsax.cxx
index dd2e5c38a496..e528f2659f8e 100644
--- a/sax/test/sax/testsax.cxx
+++ b/sax/test/sax/testsax.cxx
@@ -118,12 +118,12 @@ Reference < XInterface > SAL_CALL OSaxParserTest_CreateInstance( const Reference
OUString OSaxParserTest_getServiceName( ) throw ()
{
- return OUString( RTL_CONSTASCII_USTRINGPARAM("test.com.sun.star.xml.sax.Parser" ));
+ return OUString( "test.com.sun.star.xml.sax.Parser" );
}
OUString OSaxParserTest_getImplementationName( ) throw ()
{
- return OUString( RTL_CONSTASCII_USTRINGPARAM("test.extensions.xml.sax.Parser"));
+ return OUString( "test.extensions.xml.sax.Parser");
}
Sequence<OUString> OSaxParserTest_getSupportedServiceNames( ) throw ()
@@ -143,7 +143,7 @@ void OSaxParserTest::testInvariant(
const Reference < XInterface >& TestObject )
throw ( IllegalArgumentException, RuntimeException)
{
- if( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Parser")) == TestName ) {
+ if( OUString( "com.sun.star.xml.sax.Parser") == TestName ) {
Reference < XParser > parser( TestObject , UNO_QUERY );
ERROR_ASSERT( parser.is() , "XDataInputStream cannot be queried" );
@@ -157,7 +157,7 @@ sal_Int32 OSaxParserTest::test(
sal_Int32 hTestHandle)
throw ( IllegalArgumentException, RuntimeException)
{
- if( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Parser")) == TestName ) {
+ if( OUString( "com.sun.star.xml.sax.Parser") == TestName ) {
try
{
if( 0 == hTestHandle ) {
@@ -237,7 +237,7 @@ Reference < XInputStream > createStreamFromSequence(
const Reference < XMultiServiceFactory > &xSMgr )
{
Reference < XInterface > xOutStreamService =
- xSMgr->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.io.Pipe")) );
+ xSMgr->createInstance( OUString("com.sun.star.io.Pipe") );
OSL_ASSERT( xOutStreamService.is() );
Reference< XOutputStream > rOutStream( xOutStreamService , UNO_QUERY );
OSL_ASSERT( rOutStream.is() );
@@ -301,7 +301,7 @@ public: // Error handler
{
printf( "Error !\n" );
throw SAXException(
- OUString( RTL_CONSTASCII_USTRINGPARAM("error from error handler")) ,
+ OUString( "error from error handler") ,
Reference < XInterface >() ,
aSAXParseException );
}
@@ -509,7 +509,7 @@ void OSaxParserTest::testSimple( const Reference < XParser > &rParser )
Reference< XInputStream > rInStream;
OUString sInput;
rInStream = createStreamFromSequence( seqBytes , m_rFactory );
- sInput = OUString( OUString( RTL_CONSTASCII_USTRINGPARAM("internal")) );
+ sInput = OUString( OUString( "internal") );
if( rParser.is() ) {
InputSource source;
@@ -575,7 +575,7 @@ void OSaxParserTest::testNamespaces( const Reference < XParser > &rParser )
OUString sInput;
rInStream = createStreamFromSequence( seqBytes , m_rFactory );
- sInput = OUString( RTL_CONSTASCII_USTRINGPARAM( "internal" ));
+ sInput = OUString( "internal" );
if( rParser.is() ) {
InputSource source;
@@ -629,7 +629,7 @@ void OSaxParserTest::testEncoding( const Reference < XParser > &rParser )
OUString sInput;
rInStream = createStreamFromSequence( seqBytes , m_rFactory );
- sInput = OUString( RTL_CONSTASCII_USTRINGPARAM("internal") );
+ sInput = OUString( "internal" );
if( rParser.is() ) {
InputSource source;
@@ -663,7 +663,7 @@ void OSaxParserTest::testFile( const Reference < XParser > & rParser )
{
Reference< XInputStream > rInStream = createStreamFromFile( "testsax.xml" , m_rFactory );
- OUString sInput = OUString( RTL_CONSTASCII_USTRINGPARAM( "testsax.xml" ) );
+ OUString sInput = OUString( "testsax.xml" );
if( rParser.is() && rInStream.is() ) {
@@ -723,7 +723,7 @@ void OSaxParserTest::testPerformance( const Reference < XParser > & rParser )
Reference < XInputStream > rInStream =
createStreamFromFile( "testPerformance.xml" , m_rFactory );
- OUString sInput = OUString( RTL_CONSTASCII_USTRINGPARAM( "testperformance.xml") );
+ OUString sInput = OUString( "testperformance.xml" );
if( rParser.is() && rInStream.is() ) {
InputSource source;
@@ -797,16 +797,16 @@ sal_Bool SAL_CALL component_writeInfo(
reinterpret_cast< XRegistryKey * >( pRegistryKey ) );
OUString str =
- OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) +
+ OUString( "/" ) +
OSaxParserTest_getImplementationName() +
- OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES") );
+ OUString( "/UNO/SERVICES" );
Reference< XRegistryKey > xNewKey = xKey->createKey( str );
xNewKey->createKey( OSaxParserTest_getServiceName() );
str =
- OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) +
+ OUString( "/" ) +
OSaxWriterTest_getImplementationName() +
- OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES") );
+ OUString( "/UNO/SERVICES" );
xNewKey = xKey->createKey( str );
xNewKey->createKey( OSaxWriterTest_getServiceName() );
diff --git a/sax/test/sax/testwriter.cxx b/sax/test/sax/testwriter.cxx
index f894236d190c..63a918f5f66d 100644
--- a/sax/test/sax/testwriter.cxx
+++ b/sax/test/sax/testwriter.cxx
@@ -329,12 +329,12 @@ Reference < XInterface > SAL_CALL OSaxWriterTest_CreateInstance( const Reference
OUString OSaxWriterTest_getServiceName( ) throw ()
{
- return OUString( RTL_CONSTASCII_USTRINGPARAM("test.com.sun.star.xml.sax.Writer"));
+ return OUString( "test.com.sun.star.xml.sax.Writer");
}
OUString OSaxWriterTest_getImplementationName( ) throw ()
{
- return OUString( RTL_CONSTASCII_USTRINGPARAM("test.extensions.xml.sax.Writer"));
+ return OUString( "test.extensions.xml.sax.Writer");
}
Sequence<OUString> OSaxWriterTest_getSupportedServiceNames( ) throw ()
@@ -352,7 +352,7 @@ void OSaxWriterTest::testInvariant( const OUString& TestName,
const Reference < XInterface >& TestObject )
throw ( IllegalArgumentException, RuntimeException)
{
- if( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Writer")) == TestName ) {
+ if( OUString("com.sun.star.xml.sax.Writer") == TestName ) {
Reference< XDocumentHandler > doc( TestObject , UNO_QUERY );
Reference< XExtendedDocumentHandler > ext( TestObject , UNO_QUERY );
Reference< XActiveDataSource > source( TestObject , UNO_QUERY );
@@ -373,7 +373,7 @@ sal_Int32 OSaxWriterTest::test(
sal_Int32 hTestHandle)
throw ( IllegalArgumentException,RuntimeException)
{
- if( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Writer")) == TestName )
+ if( OUString( "com.sun.star.xml.sax.Writer") == TestName )
{
try
{
@@ -471,10 +471,10 @@ void OSaxWriterTest::writeParagraph(
void OSaxWriterTest::testSimple( const Reference< XExtendedDocumentHandler > &r )
{
- OUString testParagraph = OUString( RTL_CONSTASCII_USTRINGPARAM(
+ OUString testParagraph = OUString(
"Dies ist ein bloeder Test um zu uberpruefen, ob der SAXWriter "
"wohl Zeilenumbrueche halbwegs richtig macht oder ob er die Zeile "
- "bis zum bitteren Ende schreibt." ));
+ "bis zum bitteren Ende schreibt." );
OFileWriter *pw = new OFileWriter("output.xml");
AttributeListImpl *pList = new AttributeListImpl;
@@ -491,24 +491,24 @@ void OSaxWriterTest::testSimple( const Reference< XExtendedDocumentHandler > &r
r->startDocument();
- pList->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM("Arg1" )),
- OUString( RTL_CONSTASCII_USTRINGPARAM("CDATA")) ,
- OUString( RTL_CONSTASCII_USTRINGPARAM("bla\n u")) );
- pList->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM("Arg2")) ,
- OUString( RTL_CONSTASCII_USTRINGPARAM("CDATA")) ,
- OUString( RTL_CONSTASCII_USTRINGPARAM("blub")) );
+ pList->addAttribute( OUString( "Arg1" ),
+ OUString( "CDATA") ,
+ OUString( "bla\n u") );
+ pList->addAttribute( OUString( "Arg2") ,
+ OUString( "CDATA") ,
+ OUString( "blub") );
- r->startElement( OUString( RTL_CONSTASCII_USTRINGPARAM("tag1")) , rList );
+ r->startElement( OUString( "tag1") , rList );
r->ignorableWhitespace( OUString() );
- r->characters( OUString( RTL_CONSTASCII_USTRINGPARAM("huhu")) );
+ r->characters( OUString( "huhu") );
r->ignorableWhitespace( OUString() );
- r->startElement( OUString( RTL_CONSTASCII_USTRINGPARAM("hi")) , rList );
+ r->startElement( OUString( "hi") , rList );
r->ignorableWhitespace( OUString() );
// the enpassant must be converted & -> &amp;
- r->characters( OUString( RTL_CONSTASCII_USTRINGPARAM("&#252;")) );
+ r->characters( OUString( "&#252;") );
// Test added for mib. Tests if errors during conversions occurs
r->ignorableWhitespace( OUString() );
@@ -524,7 +524,7 @@ void OSaxWriterTest::testSimple( const Reference< XExtendedDocumentHandler > &r
// '>' must not be converted
r->startCDATA();
- r->characters( OUString( RTL_CONSTASCII_USTRINGPARAM(">fsfsdf<")) );
+ r->characters( OUString( ">fsfsdf<") );
r->endCDATA();
r->ignorableWhitespace( OUString() );
@@ -532,16 +532,16 @@ void OSaxWriterTest::testSimple( const Reference< XExtendedDocumentHandler > &r
r->ignorableWhitespace( OUString() );
- r->comment( OUString( RTL_CONSTASCII_USTRINGPARAM("Dies ist ein Kommentar !")) );
+ r->comment( OUString( "Dies ist ein Kommentar !") );
r->ignorableWhitespace( OUString() );
- r->startElement( OUString( RTL_CONSTASCII_USTRINGPARAM("emptytagtest")) , rList );
- r->endElement( OUString( RTL_CONSTASCII_USTRINGPARAM("emptytagtest")) );
+ r->startElement( OUString( "emptytagtest") , rList );
+ r->endElement( OUString( "emptytagtest") );
- r->endElement( OUString( RTL_CONSTASCII_USTRINGPARAM("hi")) );
+ r->endElement( OUString( "hi") );
r->ignorableWhitespace( OUString() );
- r->endElement( OUString( RTL_CONSTASCII_USTRINGPARAM("tag1")) );
+ r->endElement( OUString( "tag1") );
r->endDocument();
}
@@ -566,7 +566,7 @@ void OSaxWriterTest::testExceptions( const Reference< XExtendedDocumentHandler >
sal_Bool bException = sal_True;
try
{
- r->startElement( OUString( RTL_CONSTASCII_USTRINGPARAM("huhu")) , rList );
+ r->startElement( OUString( "huhu") , rList );
bException = sal_False;
}
catch( SAXException &e )
@@ -578,13 +578,13 @@ void OSaxWriterTest::testExceptions( const Reference< XExtendedDocumentHandler >
r->startDocument();
- r->startElement( OUString( RTL_CONSTASCII_USTRINGPARAM("huhu")) , rList );
+ r->startElement( OUString( "huhu") , rList );
r->startCDATA();
{
sal_Bool bException = sal_True;
try{
- r->startElement( OUString( RTL_CONSTASCII_USTRINGPARAM("huhu")) , rList );
+ r->startElement( OUString( "huhu") , rList );
bException = sal_False;
}
catch( SAXException &e ) {
@@ -608,7 +608,7 @@ void OSaxWriterTest::testExceptions( const Reference< XExtendedDocumentHandler >
}
}
- r->endElement( OUString( RTL_CONSTASCII_USTRINGPARAM("huhu")) );
+ r->endElement( OUString( "huhu") );
r->endDocument();
}
@@ -631,10 +631,10 @@ void OSaxWriterTest::testDTD(const Reference< XExtendedDocumentHandler > &r )
r->startDocument();
- r->unknown( OUString( RTL_CONSTASCII_USTRINGPARAM("<!DOCTYPE iCalendar >\n")) );
- r->startElement( OUString( RTL_CONSTASCII_USTRINGPARAM("huhu")) , rList );
+ r->unknown( OUString( "<!DOCTYPE iCalendar >\n") );
+ r->startElement( OUString( "huhu") , rList );
- r->endElement( OUString( RTL_CONSTASCII_USTRINGPARAM("huhu")) );
+ r->endElement( OUString( "huhu") );
r->endDocument();
}
@@ -644,10 +644,10 @@ void OSaxWriterTest::testPerformance(const Reference< XExtendedDocumentHandler
AttributeListImpl *pList = new AttributeListImpl;
OUString testParagraph =
- OUString( RTL_CONSTASCII_USTRINGPARAM(
+ OUString(
"Dies ist ein bloeder Test um zu uberpruefen, ob der SAXWriter "
"wohl Zeilenumbrueche halbwegs richtig macht oder ob er die Zeile "
- "bis zum bitteren Ende schreibt." ));
+ "bis zum bitteren Ende schreibt." );
Reference< XAttributeList > rList( (XAttributeList *) pList , UNO_QUERY );
@@ -668,12 +668,12 @@ void OSaxWriterTest::testPerformance(const Reference< XExtendedDocumentHandler
// just write a bunch of xml tags !
// for performance testing
sal_Int32 i2;
- OUString huhu( RTL_CONSTASCII_USTRINGPARAM("huhu") );
+ OUString huhu( "huhu" );
OUString emptyString;
const int ITERATIONS = 125;
for( i2 = 0 ; i2 < ITERATIONS ; i2 ++ )
{
- r->startElement( OUString( RTL_CONSTASCII_USTRINGPARAM("tag") ) +
+ r->startElement( OUString( "tag" ) +
OUString::valueOf( i2 ), rList );
for( sal_Int32 i = 0 ; i < 450 ; i ++ )
{
@@ -688,7 +688,7 @@ void OSaxWriterTest::testPerformance(const Reference< XExtendedDocumentHandler
for( i2 = ITERATIONS-1 ; i2 >= 0 ; i2-- )
{
r->ignorableWhitespace( emptyString );
- r->endElement( OUString( RTL_CONSTASCII_USTRINGPARAM("tag") ) + OUString::valueOf( i2 ) );
+ r->endElement( OUString( "tag" ) + OUString::valueOf( i2 ) );
}
r->endDocument();
diff --git a/sax/test/saxdemo.cxx b/sax/test/saxdemo.cxx
index bd3e1c0312a8..a7e8f8a16ab5 100644
--- a/sax/test/saxdemo.cxx
+++ b/sax/test/saxdemo.cxx
@@ -152,7 +152,7 @@ public: // Error handler
{
printf( "Error !\n" );
throw SAXException(
- OUString( RTL_CONSTASCII_USTRINGPARAM("error from error handler")) ,
+ OUString( "error from error handler") ,
Reference < XInterface >() ,
aSAXParseException );
}
@@ -504,14 +504,14 @@ int main (int argc, char **argv)
// create service manager
Reference< XMultiServiceFactory > xSMgr = createRegistryServiceFactory(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" )) );
+ OUString( "applicat.rdb" ) );
Reference < XImplementationRegistration > xReg;
try
{
// Create registration service
Reference < XInterface > x = xSMgr->createInstance(
- OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.registry.ImplementationRegistration")) );
+ OUString("com.sun.star.registry.ImplementationRegistration") );
xReg = Reference< XImplementationRegistration > ( x , UNO_QUERY );
}
catch( Exception & ) {
@@ -523,9 +523,9 @@ int main (int argc, char **argv)
try
{
// Load dll for the tested component
- OUString aDllName(RTL_CONSTASCII_USTRINGPARAM( "sax.uno" SAL_DLLEXTENSION ));
+ OUString aDllName( "sax.uno" SAL_DLLEXTENSION );
xReg->registerImplementation(
- OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.loader.SharedLibrary")),
+ OUString("com.sun.star.loader.SharedLibrary"),
aDllName,
Reference< XSimpleRegistry > () );
}
@@ -542,7 +542,7 @@ int main (int argc, char **argv)
// read xml from a file and count elements
//--------------------------------
Reference< XInterface > x = xSMgr->createInstance(
- OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Parser")) );
+ OUString("com.sun.star.xml.sax.Parser") );
if( x.is() )
{
Reference< XParser > rParser( x , UNO_QUERY );
@@ -582,7 +582,7 @@ int main (int argc, char **argv)
//----------------------
// The SAX-Writer demo
//----------------------
- x= xSMgr->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Writer")) );
+ x= xSMgr->createInstance( OUString("com.sun.star.xml.sax.Writer") );
if( x.is() )
{
printf( "start writing to %s\n" , argv[2] );
@@ -597,50 +597,50 @@ int main (int argc, char **argv)
Reference< XExtendedDocumentHandler > r( x , UNO_QUERY );
r->startDocument();
- pList->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM("Arg1" )),
- OUString( RTL_CONSTASCII_USTRINGPARAM("CDATA")) ,
- OUString( RTL_CONSTASCII_USTRINGPARAM("foo\n u")) );
- pList->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM("Arg2")) ,
- OUString( RTL_CONSTASCII_USTRINGPARAM("CDATA")) ,
- OUString( RTL_CONSTASCII_USTRINGPARAM("foo2")) );
+ pList->addAttribute( OUString( "Arg1" ),
+ OUString( "CDATA") ,
+ OUString( "foo\n u") );
+ pList->addAttribute( OUString( "Arg2") ,
+ OUString( "CDATA") ,
+ OUString( "foo2") );
- r->startElement( OUString( RTL_CONSTASCII_USTRINGPARAM("tag1")) , rList );
+ r->startElement( OUString( "tag1") , rList );
// tells the writer to insert a linefeed
r->ignorableWhitespace( OUString() );
- r->characters( OUString( RTL_CONSTASCII_USTRINGPARAM("huhu")) );
+ r->characters( OUString( "huhu") );
r->ignorableWhitespace( OUString() );
- r->startElement( OUString( RTL_CONSTASCII_USTRINGPARAM("hi")) , rList );
+ r->startElement( OUString( "hi") , rList );
r->ignorableWhitespace( OUString() );
// the enpassant must be converted & -> &amp;
- r->characters( OUString( RTL_CONSTASCII_USTRINGPARAM("&#252;")) );
+ r->characters( OUString( "&#252;") );
r->ignorableWhitespace( OUString() );
// '>' must not be converted
r->startCDATA();
- r->characters( OUString( RTL_CONSTASCII_USTRINGPARAM(" > foo < ")) );
+ r->characters( OUString( " > foo < ") );
r->endCDATA();
r->ignorableWhitespace( OUString() );
- OUString testParagraph = OUString( RTL_CONSTASCII_USTRINGPARAM(
+ OUString testParagraph = OUString(
"This is only a test to check, if the writer inserts line feeds "
- "if needed or if the writer puts the whole text into one line." ));
+ "if needed or if the writer puts the whole text into one line." );
writeParagraphHelper( r , testParagraph );
r->ignorableWhitespace( OUString() );
- r->comment( OUString( RTL_CONSTASCII_USTRINGPARAM("This is a comment !")) );
+ r->comment( OUString( "This is a comment !") );
r->ignorableWhitespace( OUString() );
- r->startElement( OUString( RTL_CONSTASCII_USTRINGPARAM("emptytagtest")) , rList );
- r->endElement( OUString( RTL_CONSTASCII_USTRINGPARAM("emptytagtest")) );
+ r->startElement( OUString( "emptytagtest") , rList );
+ r->endElement( OUString( "emptytagtest") );
r->ignorableWhitespace( OUString() );
- r->endElement( OUString( RTL_CONSTASCII_USTRINGPARAM("hi")) );
+ r->endElement( OUString( "hi") );
r->ignorableWhitespace( OUString() );
- r->endElement( OUString( RTL_CONSTASCII_USTRINGPARAM("tag1")) );
+ r->endElement( OUString( "tag1") );
r->endDocument();
printf( "finished writing\n" );
diff --git a/sax/test/testcomponent.cxx b/sax/test/testcomponent.cxx
index c3b3e0a77423..bd05ac608c31 100644
--- a/sax/test/testcomponent.cxx
+++ b/sax/test/testcomponent.cxx
@@ -70,7 +70,7 @@ int main (int argc, char **argv)
// create service manager
Reference< XMultiServiceFactory > xSMgr =
- createRegistryServiceFactory( OUString( RTL_CONSTASCII_USTRINGPARAM("applicat.rdb")) );
+ createRegistryServiceFactory( OUString( "applicat.rdb") );
Reference < XImplementationRegistration > xReg;
Reference < XSimpleRegistry > xSimpleReg;
@@ -79,7 +79,7 @@ int main (int argc, char **argv)
{
// Create registration service
Reference < XInterface > x = xSMgr->createInstance(
- OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.registry.ImplementationRegistration")) );
+ OUString("com.sun.star.registry.ImplementationRegistration") );
xReg = Reference< XImplementationRegistration > ( x , UNO_QUERY );
}
catch (const Exception&)
@@ -98,12 +98,12 @@ int main (int argc, char **argv)
#ifdef SAL_W32
OUString aDllName = OStringToOUString( argv[n] , RTL_TEXTENCODING_ASCII_US );
#else
- OUString aDllName = OUString( RTL_CONSTASCII_USTRINGPARAM("lib"));
+ OUString aDllName = OUString( "lib");
aDllName += OStringToOUString( argv[n] , RTL_TEXTENCODING_ASCII_US );
- aDllName += OUString( RTL_CONSTASCII_USTRINGPARAM(".so"));
+ aDllName += OUString( ".so");
#endif
xReg->registerImplementation(
- OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.loader.SharedLibrary")),
+ OUString("com.sun.star.loader.SharedLibrary"),
aDllName,
xSimpleReg );
}
@@ -126,13 +126,13 @@ int main (int argc, char **argv)
#ifdef SAL_W32
OUString aDllName = OStringToOUString( sTestName , RTL_TEXTENCODING_ASCII_US );
#else
- OUString aDllName = OUString( RTL_CONSTASCII_USTRINGPARAM("lib"));
+ OUString aDllName = OUString( "lib");
aDllName += OStringToOUString( sTestName , RTL_TEXTENCODING_ASCII_US );
- aDllName += OUString( RTL_CONSTASCII_USTRINGPARAM(".so"));
+ aDllName += OUString( ".so");
#endif
xReg->registerImplementation(
- OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.loader.SharedLibrary")) ,
+ OUString("com.sun.star.loader.SharedLibrary") ,
aDllName,
xSimpleReg );
}