From 8b27d78b4afaa9c47ca0fda144c8060f2f14046b Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Tue, 19 Mar 2013 09:22:44 +0100 Subject: automated removal of RTL_CONSTASCII_USTRINGPARAM for quoted OUStrings Done with a perl regex: s/OUString\s*\(\s*RTL_CONSTASCII_USTRINGPARAM\s*\((\s*"[^")]*?"\s*)\)\s*\)/OUString\($1\)/gms Change-Id: Idf28320817cdcbea6d0f7ec06a9bf51bd2c3b3ec Reviewed-on: https://gerrit.libreoffice.org/2832 Reviewed-by: Thomas Arnhold Tested-by: Thomas Arnhold --- .../source/component/documentdigitalsignatures.cxx | 4 ++-- .../source/dialogs/digitalsignaturesdialog.cxx | 8 +++---- xmlsecurity/source/framework/buffernode.cxx | 18 +++++++------- .../source/framework/saxeventkeeperimpl.cxx | 28 +++++++++++----------- xmlsecurity/source/helper/xmlsignaturehelper2.cxx | 10 ++++---- xmlsecurity/source/helper/xsecparser.cxx | 16 ++++++------- xmlsecurity/source/xmlsec/diagnose.cxx | 2 +- xmlsecurity/source/xmlsec/nss/ciphercontext.cxx | 2 +- xmlsecurity/source/xmlsec/nss/nssinitializer.cxx | 12 +++++----- 9 files changed, 50 insertions(+), 50 deletions(-) (limited to 'xmlsecurity/source') diff --git a/xmlsecurity/source/component/documentdigitalsignatures.cxx b/xmlsecurity/source/component/documentdigitalsignatures.cxx index ed17c86f531b..afb6c36818a1 100644 --- a/xmlsecurity/source/component/documentdigitalsignatures.cxx +++ b/xmlsecurity/source/component/documentdigitalsignatures.cxx @@ -492,14 +492,14 @@ void DocumentDigitalSignatures::addLocationToTrustedSources( const ::rtl::OUStri rtl::OUString DocumentDigitalSignatures::GetImplementationName() throw (RuntimeException) { - return rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.security.DocumentDigitalSignatures" ) ); + return rtl::OUString( "com.sun.star.security.DocumentDigitalSignatures" ); } Sequence< rtl::OUString > DocumentDigitalSignatures::GetSupportedServiceNames() throw (cssu::RuntimeException) { Sequence < rtl::OUString > aRet(1); rtl::OUString* pArray = aRet.getArray(); - pArray[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.security.DocumentDigitalSignatures" ) ); + pArray[0] = rtl::OUString( "com.sun.star.security.DocumentDigitalSignatures" ); return aRet; } diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx index fbdc2c5348cf..f70965f9b6d7 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx @@ -87,8 +87,8 @@ namespace void SaveODFItem::Commit() {} void SaveODFItem::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} - SaveODFItem::SaveODFItem(): utl::ConfigItem(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "Office.Common/Save"))), m_nODF(0) + SaveODFItem::SaveODFItem(): utl::ConfigItem(::rtl::OUString( + "Office.Common/Save")), m_nODF(0) { OUString sDef(RTL_CONSTASCII_USTRINGPARAM("ODF/DefaultVersion")); Sequence< css::uno::Any > aValues = GetProperties( Sequence(&sDef,1) ); @@ -105,8 +105,8 @@ void SaveODFItem::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString > } else throw uno::RuntimeException( - OUString(RTL_CONSTASCII_USTRINGPARAM( - "[xmlsecurity] Could not open property Office.Common/Save/ODF/DefaultVersion")), 0); + OUString( + "[xmlsecurity] Could not open property Office.Common/Save/ODF/DefaultVersion"), 0); } } diff --git a/xmlsecurity/source/framework/buffernode.cxx b/xmlsecurity/source/framework/buffernode.cxx index 1f4006d039f7..974ddb9ddce7 100644 --- a/xmlsecurity/source/framework/buffernode.cxx +++ b/xmlsecurity/source/framework/buffernode.cxx @@ -251,34 +251,34 @@ rtl::OUString BufferNode::printChildren() const for( ; ii != m_vElementCollectors.end() ; ++ii ) { - rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "BufID=" )); + rc += rtl::OUString( "BufID=" ); rc += rtl::OUString::valueOf((*ii)->getBufferId()); if (((ElementCollector*)(*ii))->getModify()) { - rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "[M]" )); + rc += rtl::OUString( "[M]" ); } - rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ",Pri=" )); + rc += rtl::OUString( ",Pri=" ); switch (((ElementCollector*)(*ii))->getPriority()) { case cssxc::sax::ElementMarkPriority_BEFOREMODIFY: - rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "BEFOREMODIFY" )); + rc += rtl::OUString( "BEFOREMODIFY" ); break; case cssxc::sax::ElementMarkPriority_AFTERMODIFY: - rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AFTERMODIFY" )); + rc += rtl::OUString( "AFTERMODIFY" ); break; default: - rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UNKNOWN" )); + rc += rtl::OUString( "UNKNOWN" ); break; } - rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "(" )); - rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SecID=" )); + rc += rtl::OUString( "(" ); + rc += rtl::OUString( "SecID=" ); rc += rtl::OUString::valueOf(((ElementCollector*)(*ii))->getSecurityId()); rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ")" )); - rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " " )); + rc += rtl::OUString( " " ); } return rc; diff --git a/xmlsecurity/source/framework/saxeventkeeperimpl.cxx b/xmlsecurity/source/framework/saxeventkeeperimpl.cxx index 54ed9152bbee..d0d42fae4e1e 100644 --- a/xmlsecurity/source/framework/saxeventkeeperimpl.cxx +++ b/xmlsecurity/source/framework/saxeventkeeperimpl.cxx @@ -348,44 +348,44 @@ rtl::OUString SAXEventKeeperImpl::printBufferNode( for ( int i=0; igetNodeName(pBufferNode->getXMLElement()); BufferNode* pParent = (BufferNode*)pBufferNode->getParent(); if (pParent != NULL) { - rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "[" )); + rc += rtl::OUString( "[" ); rc += m_xXMLDocument->getNodeName(pParent->getXMLElement()); - rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "]" )); + rc += rtl::OUString( "]" ); } - rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ":EC=" )); + rc += rtl::OUString( ":EC=" ); rc += pBufferNode->printChildren(); - rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " BR=" )); + rc += rtl::OUString( " BR=" ); ElementMark * pBlocker = pBufferNode->getBlocker(); if (pBlocker != NULL) { rc += rtl::OUString::valueOf( pBlocker->getBufferId() ); - rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "(SecId=" )); + rc += rtl::OUString( "(SecId=" ); rc += rtl::OUString::valueOf( pBlocker->getSecurityId() ); rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ")" )); - rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " " )); + rc += rtl::OUString( " " ); } - rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "\n" )); + rc += rtl::OUString( "\n" ); std::vector< const BufferNode* >* vChildren = pBufferNode->getChildren(); std::vector< const BufferNode* >::const_iterator jj = vChildren->begin(); @@ -1056,11 +1056,11 @@ rtl::OUString SAL_CALL SAXEventKeeperImpl::printBufferNodeTree() { rtl::OUString rc; - rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ElementMarkBuffers: size = " )); + rc += rtl::OUString( "ElementMarkBuffers: size = " ); rc += rtl::OUString::valueOf((sal_Int32)m_vElementMarkBuffers.size()); - rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "\nCurrentBufferNode: " )); + rc += rtl::OUString( "\nCurrentBufferNode: " ); rc += m_xXMLDocument->getNodeName(m_pCurrentBufferNode->getXMLElement()); - rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "\n" )); + rc += rtl::OUString( "\n" ); rc += printBufferNode(m_pRootBufferNode, 0); return rc; diff --git a/xmlsecurity/source/helper/xmlsignaturehelper2.cxx b/xmlsecurity/source/helper/xmlsignaturehelper2.cxx index 0af5650188ef..edc6ee371301 100644 --- a/xmlsecurity/source/helper/xmlsignaturehelper2.cxx +++ b/xmlsecurity/source/helper/xmlsignaturehelper2.cxx @@ -87,7 +87,7 @@ void SAL_CALL ImplXMLSignatureListener::endDocument( ) void SAL_CALL ImplXMLSignatureListener::startElement( const rtl::OUString& aName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttribs ) throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException) { - if ( aName == rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Signature")) ) + if ( aName == rtl::OUString("Signature") ) { maStartVerifySignatureElementListener.Call( (void*)&xAttribs ); } @@ -195,8 +195,8 @@ uno::Reference < io::XInputStream > UriBindingHelper::OpenInputStream( const uno const ::rtl::OUString sName = ::rtl::Uri::decode( rURI, rtl_UriDecodeStrict, rtl_UriCharClassRelSegment); if (sName.isEmpty() && !rURI.isEmpty()) - throw uno::Exception(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "Could not decode URI for stream element.")), 0); + throw uno::Exception(::rtl::OUString( + "Could not decode URI for stream element."), 0); uno::Reference< io::XStream > xStream; xStream = rxStore->cloneStreamElement( sName ); @@ -210,8 +210,8 @@ uno::Reference < io::XInputStream > UriBindingHelper::OpenInputStream( const uno rURI.copy( 0, nSepPos ), rtl_UriDecodeStrict, rtl_UriCharClassRelSegment); if (aStoreName.isEmpty() && !rURI.isEmpty()) throw uno::Exception( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "Could not decode URI for stream element.")), 0); + ::rtl::OUString( + "Could not decode URI for stream element."), 0); rtl::OUString aElement = rURI.copy( nSepPos+1 ); uno::Reference < embed::XStorage > xSubStore = rxStore->openStorageElement( aStoreName, embed::ElementModes::READ ); diff --git a/xmlsecurity/source/helper/xsecparser.cxx b/xmlsecurity/source/helper/xsecparser.cxx index bb8aec5a31ce..547ec823580a 100644 --- a/xmlsecurity/source/helper/xsecparser.cxx +++ b/xmlsecurity/source/helper/xsecparser.cxx @@ -171,7 +171,7 @@ void SAL_CALL XSecParser::startElement( } } else if (aName == rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(NSTAG_DC)) - +rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(":")) + +rtl::OUString(":") +rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(TAG_DATE))) { m_ouDate = rtl::OUString(); @@ -187,14 +187,14 @@ void SAL_CALL XSecParser::startElement( {//getCaughtException MUST be the first line in the catch block cssu::Any exc = cppu::getCaughtException(); throw cssxs::SAXException( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "xmlsecurity: Exception in XSecParser::startElement")), + rtl::OUString( + "xmlsecurity: Exception in XSecParser::startElement"), 0, exc); } catch (...) { throw cssxs::SAXException( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("xmlsecurity: unexpected exception in XSecParser::startElement")), 0, + rtl::OUString("xmlsecurity: unexpected exception in XSecParser::startElement"), 0, cssu::Any()); } } @@ -246,7 +246,7 @@ void SAL_CALL XSecParser::endElement( const rtl::OUString& aName ) m_bInX509Certificate = false; } else if (aName == rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(NSTAG_DC)) - +rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(":")) + +rtl::OUString(":") +rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(TAG_DATE))) { m_pXSecController->setDate( m_ouDate ); @@ -262,14 +262,14 @@ void SAL_CALL XSecParser::endElement( const rtl::OUString& aName ) {//getCaughtException MUST be the first line in the catch block cssu::Any exc = cppu::getCaughtException(); throw cssxs::SAXException( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "xmlsecurity: Exception in XSecParser::endElement")), + rtl::OUString( + "xmlsecurity: Exception in XSecParser::endElement"), 0, exc); } catch (...) { throw cssxs::SAXException( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("xmlsecurity: unexpected exception in XSecParser::endElement")), 0, + rtl::OUString("xmlsecurity: unexpected exception in XSecParser::endElement"), 0, cssu::Any()); } } diff --git a/xmlsecurity/source/xmlsec/diagnose.cxx b/xmlsecurity/source/xmlsec/diagnose.cxx index 67ec993f5edd..913c87c7e025 100644 --- a/xmlsecurity/source/xmlsec/diagnose.cxx +++ b/xmlsecurity/source/xmlsec/diagnose.cxx @@ -31,7 +31,7 @@ struct UseDiagnose : public rtl::StaticWithInit< bool, UseDiagnose> { ::rtl::OUString value; sal_Bool res = rtl::Bootstrap::get( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("XMLSECURITY_TRACE")), value); + ::rtl::OUString("XMLSECURITY_TRACE"), value); return res == sal_True ? true : false; } }; diff --git a/xmlsecurity/source/xmlsec/nss/ciphercontext.cxx b/xmlsecurity/source/xmlsec/nss/ciphercontext.cxx index 0f562b482f6b..23961db9e350 100644 --- a/xmlsecurity/source/xmlsec/nss/ciphercontext.cxx +++ b/xmlsecurity/source/xmlsec/nss/ciphercontext.cxx @@ -187,7 +187,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL OCipherContext::finalizeCipherContextAndDis // if it is decryption, the amount of data should be rounded to the block size even in case of padding if ( ( !m_bPadding || !m_bEncryption ) && nSizeForPadding ) - throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "The data should contain complete blocks only." ) ), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( ::rtl::OUString( "The data should contain complete blocks only." ), uno::Reference< uno::XInterface >() ); if ( m_bW3CPadding && m_bEncryption ) { diff --git a/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx b/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx index f9bc48799730..373f4f96d5e5 100644 --- a/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx +++ b/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx @@ -443,10 +443,10 @@ css::uno::Reference< css::xml::crypto::XDigestContext > SAL_CALL ONSSInitializer b1KData = ( nDigestID == css::xml::crypto::DigestID::SHA1_1K ); } else - throw css::lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Unexpected digest requested." ) ), css::uno::Reference< css::uno::XInterface >(), 1 ); + throw css::lang::IllegalArgumentException( ::rtl::OUString( "Unexpected digest requested." ), css::uno::Reference< css::uno::XInterface >(), 1 ); if ( aParams.getLength() ) - throw css::lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Unexpected arguments provided for digest creation." ) ), css::uno::Reference< css::uno::XInterface >(), 2 ); + throw css::lang::IllegalArgumentException( ::rtl::OUString( "Unexpected arguments provided for digest creation." ), css::uno::Reference< css::uno::XInterface >(), 2 ); css::uno::Reference< css::xml::crypto::XDigestContext > xResult; if( initNSS( m_xContext ) ) @@ -470,19 +470,19 @@ css::uno::Reference< css::xml::crypto::XCipherContext > SAL_CALL ONSSInitializer bW3CPadding = true; if ( aKey.getLength() != 16 && aKey.getLength() != 24 && aKey.getLength() != 32 ) - throw css::lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Unexpected key length." ) ), css::uno::Reference< css::uno::XInterface >(), 2 ); + throw css::lang::IllegalArgumentException( ::rtl::OUString( "Unexpected key length." ), css::uno::Reference< css::uno::XInterface >(), 2 ); if ( aParams.getLength() ) - throw css::lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Unexpected arguments provided for cipher creation." ) ), css::uno::Reference< css::uno::XInterface >(), 5 ); + throw css::lang::IllegalArgumentException( ::rtl::OUString( "Unexpected arguments provided for cipher creation." ), css::uno::Reference< css::uno::XInterface >(), 5 ); } else - throw css::lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Unexpected cipher requested." ) ), css::uno::Reference< css::uno::XInterface >(), 1 ); + throw css::lang::IllegalArgumentException( ::rtl::OUString( "Unexpected cipher requested." ), css::uno::Reference< css::uno::XInterface >(), 1 ); css::uno::Reference< css::xml::crypto::XCipherContext > xResult; if( initNSS( m_xContext ) ) { if ( aInitializationVector.getLength() != PK11_GetIVLength( nNSSCipherID ) ) - throw css::lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Unexpected length of initialization vector." ) ), css::uno::Reference< css::uno::XInterface >(), 3 ); + throw css::lang::IllegalArgumentException( ::rtl::OUString( "Unexpected length of initialization vector." ), css::uno::Reference< css::uno::XInterface >(), 3 ); xResult = OCipherContext::Create( nNSSCipherID, aKey, aInitializationVector, bEncryption, bW3CPadding ); } -- cgit