From ba0a57702cdef7a0389c06841711d7e3079d471c Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Sat, 29 Jun 2013 21:24:12 +0200 Subject: remove OUString wrap for string literals For some functions and all kinds of Exceptions. CannotConvertException CloseVetoException DisposedException EmptyUndoStackException ErrorCodeIOException Exception GridInvalidDataException GridInvalidModelException IOException IllegalAccessException IllegalArgumentException IllegalTypeException IndexOutOfBoundsException NoMasterException NoSuchElementException NoSupportException PropertyVetoException RuntimeException SAXException ScannerException StorageWrappedTargetException UnsupportedFlavorException VetoException WrappedTargetException ZipIOException throwGenericSQLException throwIllegallArgumentException createInstance createInstanceWithContext forName getByName getPackageManager getPropertyValue getUnpackedValueOrDefault getValueByName hasPropertyByName openKey setName setPropertyValue supportsService bash command: for i in `cat list`; do git grep "$i\s*(\s*OUString(\s*\"" -- '*.[hc]xx' | cut -d ':' -f1 | sort -u | xargs sed -i -e "s/\(\<$i\s*(\)\s*OUString(\s*\(\"[^\")\\]*\"\)\s*)\s*/\1\2/g" -e "s/\($i.*\)\"+ /\1\" + /g"; done Change-Id: Iaf8e641b0abf28c082906014f87a183517630535 Reviewed-on: https://gerrit.libreoffice.org/4624 Tested-by: LibreOffice gerrit bot Reviewed-by: Thomas Arnhold Tested-by: Thomas Arnhold --- sax/source/expatwrap/sax_expat.cxx | 4 ++-- sax/source/fastparser/fastparser.cxx | 4 ++-- sax/source/tools/fshelper.cxx | 2 +- sax/test/sax/testsax.cxx | 2 +- sax/test/saxdemo.cxx | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) (limited to 'sax') diff --git a/sax/source/expatwrap/sax_expat.cxx b/sax/source/expatwrap/sax_expat.cxx index 4661256854c4..58b2e4410c3d 100644 --- a/sax/source/expatwrap/sax_expat.cxx +++ b/sax/source/expatwrap/sax_expat.cxx @@ -492,7 +492,7 @@ void SaxExpatParser::parseStream( const InputSource& structSource) if( ! entity.structSource.aInputStream.is() ) { - throw SAXException( OUString("No input source") , + throw SAXException("No input source", Reference< XInterface > () , Any() ); } @@ -507,7 +507,7 @@ void SaxExpatParser::parseStream( const InputSource& structSource) entity.pParser = XML_ParserCreate( 0 ); if( ! entity.pParser ) { - throw SAXException( OUString("Couldn't create parser") , + throw SAXException("Couldn't create parser", Reference< XInterface > (), Any() ); } diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx index 1a80ed1ab65a..d373762bbcc9 100644 --- a/sax/source/fastparser/fastparser.cxx +++ b/sax/source/fastparser/fastparser.cxx @@ -441,7 +441,7 @@ void FastSaxParser::parseStream( const InputSource& maStructSource) throw (SAXEx entity.maStructSource = maStructSource; if( !entity.maStructSource.aInputStream.is() ) - throw SAXException( OUString( "No input source" ), Reference< XInterface >(), Any() ); + throw SAXException("No input source", Reference< XInterface >(), Any() ); entity.maConverter.setInputStream( entity.maStructSource.aInputStream ); if( !entity.maStructSource.sEncoding.isEmpty() ) @@ -450,7 +450,7 @@ void FastSaxParser::parseStream( const InputSource& maStructSource) throw (SAXEx // create parser with proper encoding entity.mpParser = XML_ParserCreate( 0 ); if( !entity.mpParser ) - throw SAXException( OUString( "Couldn't create parser" ), Reference< XInterface >(), Any() ); + throw SAXException("Couldn't create parser", Reference< XInterface >(), Any() ); // set all necessary C-Callbacks XML_SetUserData( entity.mpParser, this ); diff --git a/sax/source/tools/fshelper.cxx b/sax/source/tools/fshelper.cxx index 888ed7df52a7..2f96cca7f6f3 100644 --- a/sax/source/tools/fshelper.cxx +++ b/sax/source/tools/fshelper.cxx @@ -33,7 +33,7 @@ FastSerializerHelper::FastSerializerHelper(const Reference< io::XOutputStream >& { Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext(), UNO_SET_THROW ); Reference< lang::XMultiComponentFactory > xFactory( xContext->getServiceManager(), UNO_SET_THROW ); - mxTokenHandler.set( xFactory->createInstanceWithContext( OUString( "com.sun.star.xml.sax.FastTokenHandler"), xContext ), UNO_QUERY_THROW ); + mxTokenHandler.set( xFactory->createInstanceWithContext("com.sun.star.xml.sax.FastTokenHandler", xContext ), UNO_QUERY_THROW ); mpSerializer->setFastTokenHandler( mxTokenHandler ); mpSerializer->setOutputStream( xOutputStream ); diff --git a/sax/test/sax/testsax.cxx b/sax/test/sax/testsax.cxx index 3840da724f90..2e228b824c26 100644 --- a/sax/test/sax/testsax.cxx +++ b/sax/test/sax/testsax.cxx @@ -225,7 +225,7 @@ Reference < XInputStream > createStreamFromSequence( const Reference < XMultiServiceFactory > &xSMgr ) { Reference < XInterface > xOutStreamService = - xSMgr->createInstance( OUString("com.sun.star.io.Pipe") ); + xSMgr->createInstance("com.sun.star.io.Pipe"); OSL_ASSERT( xOutStreamService.is() ); Reference< XOutputStream > rOutStream( xOutStreamService , UNO_QUERY ); OSL_ASSERT( rOutStream.is() ); diff --git a/sax/test/saxdemo.cxx b/sax/test/saxdemo.cxx index a330e242f746..486752081668 100644 --- a/sax/test/saxdemo.cxx +++ b/sax/test/saxdemo.cxx @@ -573,7 +573,7 @@ int main (int argc, char **argv) //---------------------- // The SAX-Writer demo //---------------------- - x= xSMgr->createInstance( OUString("com.sun.star.xml.sax.Writer") ); + x= xSMgr->createInstance("com.sun.star.xml.sax.Writer"); if( x.is() ) { printf( "start writing to %s\n" , argv[2] ); -- cgit