From 610b2b94b33b0fc2d79cd515f9e293ca1c2610e8 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 15 Nov 2013 11:05:19 +0200 Subject: remove unnecessary use of OUString constructor when assigning change code like aStr = OUString("xxxx"); to aStr = "xxxx"; Change-Id: Ib981a5cc735677ec5dba76ef9279a107d22e99d4 --- sax/source/expatwrap/saxwriter.cxx | 22 +++++++++++----------- sax/test/sax/testsax.cxx | 10 +++++----- sax/test/testcomponent.cxx | 4 ++-- 3 files changed, 18 insertions(+), 18 deletions(-) (limited to 'sax') diff --git a/sax/source/expatwrap/saxwriter.cxx b/sax/source/expatwrap/saxwriter.cxx index 34338731aa41..12e4674863c1 100644 --- a/sax/source/expatwrap/saxwriter.cxx +++ b/sax/source/expatwrap/saxwriter.cxx @@ -1081,13 +1081,13 @@ void SAXWriter::startElement(const OUString& aName, const Reference< XAttributeL if( ! m_bDocStarted ) { SAXException except; - except.Message = OUString( "startElement called before startDocument" ); + except.Message = "startElement called before startDocument"; throw except; } if( m_bIsCDATA ) { SAXException except; - except.Message = OUString( "startElement call not allowed with CDATA sections" ); + except.Message = "startElement call not allowed with CDATA sections"; throw except; } @@ -1133,13 +1133,13 @@ void SAXWriter::startElement(const OUString& aName, const Reference< XAttributeL if (eRet == SAX_WARNING) { SAXInvalidCharacterException except; - except.Message = OUString( "Invalid character during XML-Export in a attribute value" ); + except.Message = "Invalid character during XML-Export in a attribute value"; throw except; } else if (eRet == SAX_ERROR) { SAXException except; - except.Message = OUString( "Invalid character during XML-Export" ); + except.Message = "Invalid character during XML-Export"; throw except; } } @@ -1183,7 +1183,7 @@ void SAXWriter::endElement(const OUString& aName) throw (SAXException, Runtime if (!bRet) { SAXException except; - except.Message = OUString( "Invalid character during XML-Export" ); + except.Message = "Invalid character during XML-Export"; throw except; } } @@ -1193,7 +1193,7 @@ void SAXWriter::characters(const OUString& aChars) throw(SAXException, RuntimeE if( ! m_bDocStarted ) { SAXException except; - except.Message = OUString( "characters method called before startDocument" ); + except.Message = "characters method called before startDocument"; throw except; } @@ -1235,7 +1235,7 @@ void SAXWriter::characters(const OUString& aChars) throw(SAXException, RuntimeE if (bThrowException) { SAXInvalidCharacterException except; - except.Message = OUString( "Invalid character during XML-Export" ); + except.Message = "Invalid character during XML-Export"; throw except; } } @@ -1280,7 +1280,7 @@ void SAXWriter::processingInstruction(const OUString& aTarget, const OUString& a if (!mp_SaxWriterHelper->processingInstruction(aTarget, aData)) { SAXException except; - except.Message = OUString( "Invalid character during XML-Export" ); + except.Message = "Invalid character during XML-Export"; throw except; } } @@ -1314,7 +1314,7 @@ void SAXWriter::endCDATA(void) throw (RuntimeException) if( ! m_bDocStarted || ! m_bIsCDATA) { SAXException except; - except.Message = OUString( "endCDATA was called without startCDATA" ); + except.Message = "endCDATA was called without startCDATA"; throw except; } @@ -1352,7 +1352,7 @@ void SAXWriter::comment(const OUString& sComment) throw(SAXException, RuntimeExc if (!mp_SaxWriterHelper->comment(sComment)) { SAXException except; - except.Message = OUString( "Invalid character during XML-Export" ); + except.Message = "Invalid character during XML-Export"; throw except; } } @@ -1393,7 +1393,7 @@ void SAXWriter::unknown(const OUString& sString) throw (SAXException, RuntimeExc if (!mp_SaxWriterHelper->writeString( sString, sal_False, sal_False)) { SAXException except; - except.Message = OUString( "Invalid character during XML-Export" ); + except.Message = "Invalid character during XML-Export"; throw except; } } diff --git a/sax/test/sax/testsax.cxx b/sax/test/sax/testsax.cxx index 815e7fccee02..fff579fc4e0c 100644 --- a/sax/test/sax/testsax.cxx +++ b/sax/test/sax/testsax.cxx @@ -454,7 +454,7 @@ void OSaxParserTest::testSimple( const Reference < XParser > &rParser ) Reference< XInputStream > rInStream; OUString sInput; rInStream = createStreamFromSequence( seqBytes , m_rFactory ); - sInput = OUString( OUString( "internal") ); + sInput = "internal"; if( rParser.is() ) { InputSource source; @@ -519,7 +519,7 @@ void OSaxParserTest::testNamespaces( const Reference < XParser > &rParser ) OUString sInput; rInStream = createStreamFromSequence( seqBytes , m_rFactory ); - sInput = OUString( "internal" ); + sInput = "internal"; if( rParser.is() ) { InputSource source; @@ -572,7 +572,7 @@ void OSaxParserTest::testEncoding( const Reference < XParser > &rParser ) OUString sInput; rInStream = createStreamFromSequence( seqBytes , m_rFactory ); - sInput = OUString( "internal" ); + sInput = "internal"; if( rParser.is() ) { InputSource source; @@ -606,7 +606,7 @@ void OSaxParserTest::testFile( const Reference < XParser > & rParser ) { Reference< XInputStream > rInStream = createStreamFromFile( "testsax.xml" , m_rFactory ); - OUString sInput = OUString( "testsax.xml" ); + OUString sInput = "testsax.xml"; if( rParser.is() && rInStream.is() ) { InputSource source; @@ -664,7 +664,7 @@ void OSaxParserTest::testPerformance( const Reference < XParser > & rParser ) { Reference < XInputStream > rInStream = createStreamFromFile( "testPerformance.xml" , m_rFactory ); - OUString sInput = OUString( "testperformance.xml" ); + OUString sInput = "testperformance.xml"; if( rParser.is() && rInStream.is() ) { InputSource source; diff --git a/sax/test/testcomponent.cxx b/sax/test/testcomponent.cxx index f8ef724e063d..0413af256c85 100644 --- a/sax/test/testcomponent.cxx +++ b/sax/test/testcomponent.cxx @@ -89,7 +89,7 @@ int main (int argc, char **argv) #ifdef SAL_W32 OUString aDllName = OStringToOUString( argv[n] , RTL_TEXTENCODING_ASCII_US ); #else - OUString aDllName = OUString( "lib"); + OUString aDllName = "lib"; aDllName += OStringToOUString( argv[n] , RTL_TEXTENCODING_ASCII_US ); aDllName += ".so"; #endif @@ -117,7 +117,7 @@ int main (int argc, char **argv) #ifdef SAL_W32 OUString aDllName = OStringToOUString( sTestName , RTL_TEXTENCODING_ASCII_US ); #else - OUString aDllName = OUString( "lib"); + OUString aDllName = "lib"; aDllName += OStringToOUString( sTestName , RTL_TEXTENCODING_ASCII_US ); aDllName += ".so"; #endif -- cgit