targeted string re-work

Change-Id: Ifd6b90778725d94a9338a53a4cdc514cdb595052
This commit is contained in:
Norbert Thiebaud
2012-05-31 21:35:45 -05:00
parent 43c0c12369
commit 31cc01a5ff
12 changed files with 194 additions and 195 deletions

View File

@@ -95,11 +95,11 @@ void APChooseDevicePage::fill( PrinterInfo& rInfo )
{ {
if( m_aPDFBtn.IsChecked() ) if( m_aPDFBtn.IsChecked() )
{ {
rInfo.m_aFeatures = OUString(RTL_CONSTASCII_USTRINGPARAM("pdf=")); rInfo.m_aFeatures = OUString("pdf=");
} }
else if( m_aFaxBtn.IsChecked() ) else if( m_aFaxBtn.IsChecked() )
{ {
rInfo.m_aFeatures = OUString(RTL_CONSTASCII_USTRINGPARAM("fax")); rInfo.m_aFeatures = OUString("fax");
} }
else else
rInfo.m_aFeatures = OUString(); rInfo.m_aFeatures = OUString();
@@ -284,7 +284,7 @@ IMPL_LINK( APChooseDriverPage, ClickBtnHdl, PushButton*, pButton )
aDir.append( sal_Unicode( '/' ) ); aDir.append( sal_Unicode( '/' ) );
aDir.appendAscii( PRINTER_PPDDIR ); aDir.appendAscii( PRINTER_PPDDIR );
rtl::OUString aPPDDir( aDir.makeStringAndClear() ); rtl::OUString aPPDDir( aDir.makeStringAndClear() );
FindFiles( aPPDDir, aFiles, String( RTL_CONSTASCII_USTRINGPARAM( "PS;PPD;PS.GZ;PPD.GZ" ) ), true ); FindFiles( aPPDDir, aFiles, String( "PS;PPD;PS.GZ;PPD.GZ" ), true );
for( file = aFiles.begin(); file != aFiles.end(); ++file ) for( file = aFiles.begin(); file != aFiles.end(); ++file )
{ {
String aFile( aPPDDir ); String aFile( aPPDDir );
@@ -528,8 +528,8 @@ APOldPrinterPage::APOldPrinterPage( AddPrinterDialog* pParent )
if( pParser == NULL ) if( pParser == NULL )
{ {
String aText( PaResId( RID_TXT_DRIVERDOESNOTEXIST ) ); String aText( PaResId( RID_TXT_DRIVERDOESNOTEXIST ) );
aText.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%s1" ) ), rtl::OStringToOUString(aPrinter, aEncoding) ); aText.SearchAndReplace( String( "%s1" ), rtl::OStringToOUString(aPrinter, aEncoding) );
aText.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%s2" ) ), rtl::OStringToOUString(aDriver, aEncoding) ); aText.SearchAndReplace( String( "%s2" ), rtl::OStringToOUString(aDriver, aEncoding) );
InfoBox aBox( this, aText ); InfoBox aBox( this, aText );
aBox.Execute(); aBox.Execute();
continue; continue;
@@ -541,7 +541,7 @@ APOldPrinterPage::APOldPrinterPage( AddPrinterDialog* pParent )
if (aCommand.isEmpty()) if (aCommand.isEmpty())
{ {
String aText( PaResId( RID_TXT_PRINTERWITHOUTCOMMAND ) ); String aText( PaResId( RID_TXT_PRINTERWITHOUTCOMMAND ) );
aText.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%s" ) ), rtl::OStringToOUString(aPrinter, aEncoding) ); aText.SearchAndReplace( String( "%s" ), rtl::OStringToOUString(aPrinter, aEncoding) );
InfoBox aBox( this, aText ); InfoBox aBox( this, aText );
aBox.Execute(); aBox.Execute();
continue; continue;
@@ -569,7 +569,7 @@ APOldPrinterPage::APOldPrinterPage( AddPrinterDialog* pParent )
aInfo.m_pParser->getMargins( rtl::OStringToOUString(aValue, aEncoding), aInfo.m_pParser->getMargins( rtl::OStringToOUString(aValue, aEncoding),
nLeft, nRight, nTop, nBottom ) ) nLeft, nRight, nTop, nBottom ) )
{ {
const PPDKey* pKey = aInfo.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "PageSize" ) ) ); const PPDKey* pKey = aInfo.m_pParser->getKey( String( "PageSize" ) );
const PPDValue* pValue = pKey ? pKey->getValue( rtl::OStringToOUString(aValue, aEncoding) ) : NULL; const PPDValue* pValue = pKey ? pKey->getValue( rtl::OStringToOUString(aValue, aEncoding) ) : NULL;
if( pKey && pValue ) if( pKey && pValue )
aInfo.m_aContext.setValue( pKey, pValue ); aInfo.m_aContext.setValue( pKey, pValue );
@@ -652,7 +652,7 @@ void APOldPrinterPage::addOldPrinters()
if( ! rManager.addPrinter( pInfo->m_aPrinterName, pInfo->m_aDriverName ) ) if( ! rManager.addPrinter( pInfo->m_aPrinterName, pInfo->m_aDriverName ) )
{ {
String aText( PaResId( RID_TXT_PRINTERADDFAILED ) ); String aText( PaResId( RID_TXT_PRINTERADDFAILED ) );
aText.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%s" ) ), pInfo->m_aPrinterName ); aText.SearchAndReplace( String( "%s" ), pInfo->m_aPrinterName );
ErrorBox aBox( this, WB_OK | WB_DEF_OK, aText ); ErrorBox aBox( this, WB_OK | WB_DEF_OK, aText );
aBox.Execute(); aBox.Execute();
continue; continue;
@@ -698,7 +698,7 @@ void APFaxDriverPage::fill( PrinterInfo& rInfo )
{ {
if( isDefault() ) if( isDefault() )
{ {
rInfo.m_aDriverName = OUString(RTL_CONSTASCII_USTRINGPARAM("SGENPRT")); rInfo.m_aDriverName = OUString("SGENPRT");
} }
} }
@@ -731,9 +731,9 @@ bool APPdfDriverPage::check()
void APPdfDriverPage::fill( PrinterInfo& rInfo ) void APPdfDriverPage::fill( PrinterInfo& rInfo )
{ {
if( isDefault() ) if( isDefault() )
rInfo.m_aDriverName = OUString(RTL_CONSTASCII_USTRINGPARAM("SGENPRT")); rInfo.m_aDriverName = OUString("SGENPRT");
else if( isDist() ) else if( isDist() )
rInfo.m_aDriverName = OUString(RTL_CONSTASCII_USTRINGPARAM("ADISTILL")); rInfo.m_aDriverName = OUString("ADISTILL");
} }
//-------------------------------------------------------------------- //--------------------------------------------------------------------
@@ -1019,13 +1019,13 @@ void AddPrinterDialog::addPrinter()
} }
else if( m_pChooseDevicePage->isFax() ) else if( m_pChooseDevicePage->isFax() )
{ {
aInfo.m_aFeatures = OUString(RTL_CONSTASCII_USTRINGPARAM("fax=")); aInfo.m_aFeatures = OUString("fax=");
if( m_pFaxNamePage->isFaxSwallow() ) if( m_pFaxNamePage->isFaxSwallow() )
aInfo.m_aFeatures += OUString(RTL_CONSTASCII_USTRINGPARAM("swallow")); aInfo.m_aFeatures += OUString("swallow");
} }
else if( m_pChooseDevicePage->isPDF() ) else if( m_pChooseDevicePage->isPDF() )
{ {
OUString aPdf( RTL_CONSTASCII_USTRINGPARAM("pdf=") ); OUString aPdf( "pdf=" );
aPdf += m_pPdfCommandPage->getPdfDir(); aPdf += m_pPdfCommandPage->getPdfDir();
aInfo.m_aFeatures = aPdf; aInfo.m_aFeatures = aPdf;
} }

View File

@@ -72,11 +72,11 @@ ResId padmin::PaResId( sal_uInt32 nId )
utl::OConfigurationNode aNode = utl::OConfigurationNode aNode =
utl::OConfigurationTreeRoot::tryCreateWithServiceFactory( utl::OConfigurationTreeRoot::tryCreateWithServiceFactory(
vcl::unohelper::GetMultiServiceFactory(), vcl::unohelper::GetMultiServiceFactory(),
OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Setup/L10N")) ); OUString("org.openoffice.Setup/L10N") );
if ( aNode.isValid() ) if ( aNode.isValid() )
{ {
rtl::OUString aLoc; rtl::OUString aLoc;
Any aValue = aNode.getNodeValue( OUString(RTL_CONSTASCII_USTRINGPARAM("ooLocale")) ); Any aValue = aNode.getNodeValue( OUString("ooLocale") );
if( aValue >>= aLoc ) if( aValue >>= aLoc )
{ {
sal_Int32 nIndex = 0; sal_Int32 nIndex = 0;
@@ -287,7 +287,7 @@ bool padmin::chooseDirectory( String& rInOutPath )
Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() ); Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
if( xFactory.is() ) if( xFactory.is() )
{ {
Reference< XFolderPicker > xFolderPicker( xFactory->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FolderPicker" ) ) ), UNO_QUERY ); Reference< XFolderPicker > xFolderPicker( xFactory->createInstance( OUString( "com.sun.star.ui.dialogs.FolderPicker" ) ), UNO_QUERY );
if( xFolderPicker.is() ) if( xFolderPicker.is() )
{ {
Reference< XControlAccess > xCA( xFolderPicker, UNO_QUERY ); Reference< XControlAccess > xCA( xFolderPicker, UNO_QUERY );
@@ -297,8 +297,8 @@ bool padmin::chooseDirectory( String& rInOutPath )
{ {
Any aState; Any aState;
aState <<= sal_False; aState <<= sal_False;
xCA->setControlProperty( OUString( RTL_CONSTASCII_USTRINGPARAM( "HelpButton" ) ), xCA->setControlProperty( OUString( "HelpButton" ),
OUString( RTL_CONSTASCII_USTRINGPARAM( "Visible" ) ), OUString( "Visible" ),
aState ); aState );
} }

View File

@@ -207,7 +207,7 @@ Reference< XInterface > SAL_CALL SaxExpatParser_CreateInstance(
Sequence< OUString > SaxExpatParser::getSupportedServiceNames_Static(void) throw () Sequence< OUString > SaxExpatParser::getSupportedServiceNames_Static(void) throw ()
{ {
Sequence<OUString> aRet(1); Sequence<OUString> aRet(1);
aRet.getArray()[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(SERVICE_NAME) ); aRet.getArray()[0] = ::rtl::OUString( SERVICE_NAME );
return aRet; return aRet;
} }
@@ -476,7 +476,7 @@ void SaxExpatParser::parseStream( const InputSource& structSource)
if( ! entity.structSource.aInputStream.is() ) if( ! entity.structSource.aInputStream.is() )
{ {
throw SAXException( OUString(RTL_CONSTASCII_USTRINGPARAM("No input source")) , throw SAXException( OUString("No input source") ,
Reference< XInterface > () , Any() ); Reference< XInterface > () , Any() );
} }
@@ -491,7 +491,7 @@ void SaxExpatParser::parseStream( const InputSource& structSource)
entity.pParser = XML_ParserCreate( 0 ); entity.pParser = XML_ParserCreate( 0 );
if( ! entity.pParser ) if( ! entity.pParser )
{ {
throw SAXException( OUString(RTL_CONSTASCII_USTRINGPARAM("Couldn't create parser")) , throw SAXException( OUString("Couldn't create parser") ,
Reference< XInterface > (), Any() ); Reference< XInterface > (), Any() );
} }
@@ -604,7 +604,7 @@ void SaxExpatParser::setLocale( const Locale & locale ) throw (RuntimeException)
// XServiceInfo // XServiceInfo
OUString SaxExpatParser::getImplementationName() throw () OUString SaxExpatParser::getImplementationName() throw ()
{ {
return OUString(RTL_CONSTASCII_USTRINGPARAM( IMPLEMENTATION_NAME )); return OUString( IMPLEMENTATION_NAME );
} }
// XServiceInfo // XServiceInfo
@@ -625,7 +625,7 @@ Sequence< OUString > SaxExpatParser::getSupportedServiceNames(void) throw ()
{ {
Sequence<OUString> seq(1); Sequence<OUString> seq(1);
seq.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( SERVICE_NAME )); seq.getArray()[0] = OUString( SERVICE_NAME );
return seq; return seq;
} }
@@ -640,82 +640,82 @@ OUString getErrorMessage( XML_Error xmlE, OUString sSystemId , sal_Int32 nLine )
{ {
OUString Message; OUString Message;
if( XML_ERROR_NONE == xmlE ) { if( XML_ERROR_NONE == xmlE ) {
Message = OUString(RTL_CONSTASCII_USTRINGPARAM("No")); Message = OUString("No");
} }
else if( XML_ERROR_NO_MEMORY == xmlE ) { else if( XML_ERROR_NO_MEMORY == xmlE ) {
Message = OUString(RTL_CONSTASCII_USTRINGPARAM("no memory")); Message = OUString("no memory");
} }
else if( XML_ERROR_SYNTAX == xmlE ) { else if( XML_ERROR_SYNTAX == xmlE ) {
Message = OUString(RTL_CONSTASCII_USTRINGPARAM("syntax")); Message = OUString("syntax");
} }
else if( XML_ERROR_NO_ELEMENTS == xmlE ) { 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 ) { 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 ) { 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 ) { 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 ) { 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 ) { 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 ) { 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 ) { 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 ) { 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 ) { 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 ) { 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 ) { 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 ) { 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 ) { 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 ) { 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 ) { 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 ) { 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 ) { 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 ) { 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 ) { 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 += sSystemId;
str += OUString(RTL_CONSTASCII_USTRINGPARAM(" line ")); str += OUString(" line ");
str += OUString::valueOf( nLine ); str += OUString::valueOf( nLine );
str += OUString(RTL_CONSTASCII_USTRINGPARAM("]: ")); str += OUString("]: ");
str += Message; str += Message;
str += OUString(RTL_CONSTASCII_USTRINGPARAM("error")); str += OUString("error");
return str; 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, // in case of two concurrent threads, there is only the danger of an leak,
// which is neglectable for one string // 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); SaxExpatParser_Impl *pImpl = ((SaxExpatParser_Impl*)pvThis);
@@ -863,8 +863,7 @@ void SaxExpatParser_Impl::callbackEntityDecl(
OSL_TRACE("SaxExpatParser: internal entity declaration, stopping"); OSL_TRACE("SaxExpatParser: internal entity declaration, stopping");
XML_StopParser(pImpl->getEntity().pParser, XML_FALSE); XML_StopParser(pImpl->getEntity().pParser, XML_FALSE);
pImpl->exception = SAXParseException( pImpl->exception = SAXParseException(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ::rtl::OUString( "SaxExpatParser: internal entity declaration, stopping"),
"SaxExpatParser: internal entity declaration, stopping")),
0, Any(), 0, Any(),
pImpl->rDocumentLocator->getPublicId(), pImpl->rDocumentLocator->getPublicId(),
pImpl->rDocumentLocator->getSystemId(), pImpl->rDocumentLocator->getSystemId(),

View File

@@ -198,7 +198,7 @@ inline sal_uInt32 SaxWriterHelper::writeSequence() throw( SAXException )
Any a; Any a;
a <<= e; a <<= e;
throw SAXException( throw SAXException(
OUString(RTL_CONSTASCII_USTRINGPARAM("io exception during writing")), OUString("io exception during writing"),
Reference< XInterface > (), Reference< XInterface > (),
a ); a );
} }
@@ -983,12 +983,12 @@ Reference < XInterface > SAL_CALL SaxWriter_CreateInstance(
OUString SaxWriter_getServiceName() throw() 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() 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() Sequence< OUString > SaxWriter_getSupportedServiceNames(void) throw()
@@ -1064,12 +1064,12 @@ void SAXWriter::endDocument(void) throw(SAXException, RuntimeE
if( ! m_bDocStarted ) if( ! m_bDocStarted )
{ {
throw SAXException( throw SAXException(
OUString(RTL_CONSTASCII_USTRINGPARAM("endDocument called before startDocument")), OUString("endDocument called before startDocument"),
Reference< XInterface >() , Any() ); Reference< XInterface >() , Any() );
} }
if( m_nLevel ) { if( m_nLevel ) {
throw SAXException( throw SAXException(
OUString(RTL_CONSTASCII_USTRINGPARAM("unexpected end of document")), OUString("unexpected end of document"),
Reference< XInterface >() , Any() ); Reference< XInterface >() , Any() );
} }
mp_SaxWriterHelper->endDocument(); mp_SaxWriterHelper->endDocument();
@@ -1082,7 +1082,7 @@ void SAXWriter::endDocument(void) throw(SAXException, RuntimeE
Any a; Any a;
a <<= e; a <<= e;
throw SAXException( throw SAXException(
OUString(RTL_CONSTASCII_USTRINGPARAM("IO exception during closing the IO Stream")), OUString("IO exception during closing the IO Stream"),
Reference< XInterface > (), Reference< XInterface > (),
a ); a );
} }
@@ -1095,13 +1095,13 @@ void SAXWriter::startElement(const OUString& aName, const Reference< XAttributeL
if( ! m_bDocStarted ) if( ! m_bDocStarted )
{ {
SAXException except; SAXException except;
except.Message = OUString( RTL_CONSTASCII_USTRINGPARAM( "startElement called before startDocument" )); except.Message = OUString( "startElement called before startDocument" );
throw except; throw except;
} }
if( m_bIsCDATA ) if( m_bIsCDATA )
{ {
SAXException except; 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; throw except;
} }
@@ -1147,13 +1147,13 @@ void SAXWriter::startElement(const OUString& aName, const Reference< XAttributeL
if (eRet == SAX_WARNING) if (eRet == SAX_WARNING)
{ {
SAXInvalidCharacterException except; 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; throw except;
} }
else if (eRet == SAX_ERROR) else if (eRet == SAX_ERROR)
{ {
SAXException except; SAXException except;
except.Message = OUString( RTL_CONSTASCII_USTRINGPARAM( "Invalid charcter during XML-Export" ) ); except.Message = OUString( "Invalid charcter during XML-Export" );
throw except; throw except;
} }
} }
@@ -1189,7 +1189,7 @@ void SAXWriter::endElement(const OUString& aName) throw (SAXException, Runtime
if (!bRet) if (!bRet)
{ {
SAXException except; SAXException except;
except.Message = OUString( RTL_CONSTASCII_USTRINGPARAM( "Invalid charcter during XML-Export" ) ); except.Message = OUString( "Invalid charcter during XML-Export" );
throw except; throw except;
} }
} }
@@ -1199,7 +1199,7 @@ void SAXWriter::characters(const OUString& aChars) throw(SAXException, RuntimeE
if( ! m_bDocStarted ) if( ! m_bDocStarted )
{ {
SAXException except; SAXException except;
except.Message = OUString( RTL_CONSTASCII_USTRINGPARAM( "characters method called before startDocument" ) ); except.Message = OUString( "characters method called before startDocument" );
throw except; throw except;
} }
@@ -1241,7 +1241,7 @@ void SAXWriter::characters(const OUString& aChars) throw(SAXException, RuntimeE
if (bThrowException) if (bThrowException)
{ {
SAXInvalidCharacterException except; SAXInvalidCharacterException except;
except.Message = OUString( RTL_CONSTASCII_USTRINGPARAM( "Invalid charcter during XML-Export" ) ); except.Message = OUString( "Invalid charcter during XML-Export" );
throw except; throw except;
} }
} }
@@ -1286,7 +1286,7 @@ void SAXWriter::processingInstruction(const OUString& aTarget, const OUString& a
if (!mp_SaxWriterHelper->processingInstruction(aTarget, aData)) if (!mp_SaxWriterHelper->processingInstruction(aTarget, aData))
{ {
SAXException except; SAXException except;
except.Message = OUString( RTL_CONSTASCII_USTRINGPARAM( "Invalid charcter during XML-Export" ) ); except.Message = OUString( "Invalid charcter during XML-Export" );
throw except; throw except;
} }
} }
@@ -1320,7 +1320,7 @@ void SAXWriter::endCDATA(void) throw (RuntimeException)
if( ! m_bDocStarted | ! m_bIsCDATA) if( ! m_bDocStarted | ! m_bIsCDATA)
{ {
SAXException except; SAXException except;
except.Message = OUString( RTL_CONSTASCII_USTRINGPARAM( "endCDATA was called without startCDATA" ) ); except.Message = OUString( "endCDATA was called without startCDATA" );
throw except; throw except;
} }
@@ -1358,7 +1358,7 @@ void SAXWriter::comment(const OUString& sComment) throw(SAXException, RuntimeExc
if (!mp_SaxWriterHelper->comment(sComment)) if (!mp_SaxWriterHelper->comment(sComment))
{ {
SAXException except; SAXException except;
except.Message = OUString( RTL_CONSTASCII_USTRINGPARAM( "Invalid charcter during XML-Export" ) ); except.Message = OUString( "Invalid charcter during XML-Export" );
throw except; throw except;
} }
} }
@@ -1399,7 +1399,7 @@ void SAXWriter::unknown(const OUString& sString) throw (SAXException, RuntimeExc
if (!mp_SaxWriterHelper->writeString( sString, sal_False, sal_False)) if (!mp_SaxWriterHelper->writeString( sString, sal_False, sal_False))
{ {
SAXException except; SAXException except;
except.Message = OUString( RTL_CONSTASCII_USTRINGPARAM( "Invalid charcter during XML-Export" ) ); except.Message = OUString( "Invalid charcter during XML-Export" );
throw except; throw except;
} }
} }

View File

@@ -118,12 +118,12 @@ Reference < XInterface > SAL_CALL OSaxParserTest_CreateInstance( const Reference
OUString OSaxParserTest_getServiceName( ) throw () 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 () 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 () Sequence<OUString> OSaxParserTest_getSupportedServiceNames( ) throw ()
@@ -143,7 +143,7 @@ void OSaxParserTest::testInvariant(
const Reference < XInterface >& TestObject ) const Reference < XInterface >& TestObject )
throw ( IllegalArgumentException, RuntimeException) 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 ); Reference < XParser > parser( TestObject , UNO_QUERY );
ERROR_ASSERT( parser.is() , "XDataInputStream cannot be queried" ); ERROR_ASSERT( parser.is() , "XDataInputStream cannot be queried" );
@@ -157,7 +157,7 @@ sal_Int32 OSaxParserTest::test(
sal_Int32 hTestHandle) sal_Int32 hTestHandle)
throw ( IllegalArgumentException, RuntimeException) 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 try
{ {
if( 0 == hTestHandle ) { if( 0 == hTestHandle ) {
@@ -237,7 +237,7 @@ Reference < XInputStream > createStreamFromSequence(
const Reference < XMultiServiceFactory > &xSMgr ) const Reference < XMultiServiceFactory > &xSMgr )
{ {
Reference < XInterface > xOutStreamService = 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() ); OSL_ASSERT( xOutStreamService.is() );
Reference< XOutputStream > rOutStream( xOutStreamService , UNO_QUERY ); Reference< XOutputStream > rOutStream( xOutStreamService , UNO_QUERY );
OSL_ASSERT( rOutStream.is() ); OSL_ASSERT( rOutStream.is() );
@@ -301,7 +301,7 @@ public: // Error handler
{ {
printf( "Error !\n" ); printf( "Error !\n" );
throw SAXException( throw SAXException(
OUString( RTL_CONSTASCII_USTRINGPARAM("error from error handler")) , OUString( "error from error handler") ,
Reference < XInterface >() , Reference < XInterface >() ,
aSAXParseException ); aSAXParseException );
} }
@@ -509,7 +509,7 @@ void OSaxParserTest::testSimple( const Reference < XParser > &rParser )
Reference< XInputStream > rInStream; Reference< XInputStream > rInStream;
OUString sInput; OUString sInput;
rInStream = createStreamFromSequence( seqBytes , m_rFactory ); rInStream = createStreamFromSequence( seqBytes , m_rFactory );
sInput = OUString( OUString( RTL_CONSTASCII_USTRINGPARAM("internal")) ); sInput = OUString( OUString( "internal") );
if( rParser.is() ) { if( rParser.is() ) {
InputSource source; InputSource source;
@@ -575,7 +575,7 @@ void OSaxParserTest::testNamespaces( const Reference < XParser > &rParser )
OUString sInput; OUString sInput;
rInStream = createStreamFromSequence( seqBytes , m_rFactory ); rInStream = createStreamFromSequence( seqBytes , m_rFactory );
sInput = OUString( RTL_CONSTASCII_USTRINGPARAM( "internal" )); sInput = OUString( "internal" );
if( rParser.is() ) { if( rParser.is() ) {
InputSource source; InputSource source;
@@ -629,7 +629,7 @@ void OSaxParserTest::testEncoding( const Reference < XParser > &rParser )
OUString sInput; OUString sInput;
rInStream = createStreamFromSequence( seqBytes , m_rFactory ); rInStream = createStreamFromSequence( seqBytes , m_rFactory );
sInput = OUString( RTL_CONSTASCII_USTRINGPARAM("internal") ); sInput = OUString( "internal" );
if( rParser.is() ) { if( rParser.is() ) {
InputSource source; InputSource source;
@@ -663,7 +663,7 @@ void OSaxParserTest::testFile( const Reference < XParser > & rParser )
{ {
Reference< XInputStream > rInStream = createStreamFromFile( "testsax.xml" , m_rFactory ); 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() ) { if( rParser.is() && rInStream.is() ) {
@@ -723,7 +723,7 @@ void OSaxParserTest::testPerformance( const Reference < XParser > & rParser )
Reference < XInputStream > rInStream = Reference < XInputStream > rInStream =
createStreamFromFile( "testPerformance.xml" , m_rFactory ); createStreamFromFile( "testPerformance.xml" , m_rFactory );
OUString sInput = OUString( RTL_CONSTASCII_USTRINGPARAM( "testperformance.xml") ); OUString sInput = OUString( "testperformance.xml" );
if( rParser.is() && rInStream.is() ) { if( rParser.is() && rInStream.is() ) {
InputSource source; InputSource source;
@@ -797,16 +797,16 @@ sal_Bool SAL_CALL component_writeInfo(
reinterpret_cast< XRegistryKey * >( pRegistryKey ) ); reinterpret_cast< XRegistryKey * >( pRegistryKey ) );
OUString str = OUString str =
OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + OUString( "/" ) +
OSaxParserTest_getImplementationName() + OSaxParserTest_getImplementationName() +
OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES") ); OUString( "/UNO/SERVICES" );
Reference< XRegistryKey > xNewKey = xKey->createKey( str ); Reference< XRegistryKey > xNewKey = xKey->createKey( str );
xNewKey->createKey( OSaxParserTest_getServiceName() ); xNewKey->createKey( OSaxParserTest_getServiceName() );
str = str =
OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + OUString( "/" ) +
OSaxWriterTest_getImplementationName() + OSaxWriterTest_getImplementationName() +
OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES") ); OUString( "/UNO/SERVICES" );
xNewKey = xKey->createKey( str ); xNewKey = xKey->createKey( str );
xNewKey->createKey( OSaxWriterTest_getServiceName() ); xNewKey->createKey( OSaxWriterTest_getServiceName() );

View File

@@ -329,12 +329,12 @@ Reference < XInterface > SAL_CALL OSaxWriterTest_CreateInstance( const Reference
OUString OSaxWriterTest_getServiceName( ) throw () 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 () 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 () Sequence<OUString> OSaxWriterTest_getSupportedServiceNames( ) throw ()
@@ -352,7 +352,7 @@ void OSaxWriterTest::testInvariant( const OUString& TestName,
const Reference < XInterface >& TestObject ) const Reference < XInterface >& TestObject )
throw ( IllegalArgumentException, RuntimeException) 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< XDocumentHandler > doc( TestObject , UNO_QUERY );
Reference< XExtendedDocumentHandler > ext( TestObject , UNO_QUERY ); Reference< XExtendedDocumentHandler > ext( TestObject , UNO_QUERY );
Reference< XActiveDataSource > source( TestObject , UNO_QUERY ); Reference< XActiveDataSource > source( TestObject , UNO_QUERY );
@@ -373,7 +373,7 @@ sal_Int32 OSaxWriterTest::test(
sal_Int32 hTestHandle) sal_Int32 hTestHandle)
throw ( IllegalArgumentException,RuntimeException) 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 try
{ {
@@ -471,10 +471,10 @@ void OSaxWriterTest::writeParagraph(
void OSaxWriterTest::testSimple( const Reference< XExtendedDocumentHandler > &r ) 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 " "Dies ist ein bloeder Test um zu uberpruefen, ob der SAXWriter "
"wohl Zeilenumbrueche halbwegs richtig macht oder ob er die Zeile " "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"); OFileWriter *pw = new OFileWriter("output.xml");
AttributeListImpl *pList = new AttributeListImpl; AttributeListImpl *pList = new AttributeListImpl;
@@ -491,24 +491,24 @@ void OSaxWriterTest::testSimple( const Reference< XExtendedDocumentHandler > &r
r->startDocument(); r->startDocument();
pList->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM("Arg1" )), pList->addAttribute( OUString( "Arg1" ),
OUString( RTL_CONSTASCII_USTRINGPARAM("CDATA")) , OUString( "CDATA") ,
OUString( RTL_CONSTASCII_USTRINGPARAM("bla\n u")) ); OUString( "bla\n u") );
pList->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM("Arg2")) , pList->addAttribute( OUString( "Arg2") ,
OUString( RTL_CONSTASCII_USTRINGPARAM("CDATA")) , OUString( "CDATA") ,
OUString( RTL_CONSTASCII_USTRINGPARAM("blub")) ); OUString( "blub") );
r->startElement( OUString( RTL_CONSTASCII_USTRINGPARAM("tag1")) , rList ); r->startElement( OUString( "tag1") , rList );
r->ignorableWhitespace( OUString() ); r->ignorableWhitespace( OUString() );
r->characters( OUString( RTL_CONSTASCII_USTRINGPARAM("huhu")) ); r->characters( OUString( "huhu") );
r->ignorableWhitespace( OUString() ); r->ignorableWhitespace( OUString() );
r->startElement( OUString( RTL_CONSTASCII_USTRINGPARAM("hi")) , rList ); r->startElement( OUString( "hi") , rList );
r->ignorableWhitespace( OUString() ); r->ignorableWhitespace( OUString() );
// the enpassant must be converted & -> &amp; // 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 // Test added for mib. Tests if errors during conversions occurs
r->ignorableWhitespace( OUString() ); r->ignorableWhitespace( OUString() );
@@ -524,7 +524,7 @@ void OSaxWriterTest::testSimple( const Reference< XExtendedDocumentHandler > &r
// '>' must not be converted // '>' must not be converted
r->startCDATA(); r->startCDATA();
r->characters( OUString( RTL_CONSTASCII_USTRINGPARAM(">fsfsdf<")) ); r->characters( OUString( ">fsfsdf<") );
r->endCDATA(); r->endCDATA();
r->ignorableWhitespace( OUString() ); r->ignorableWhitespace( OUString() );
@@ -532,16 +532,16 @@ void OSaxWriterTest::testSimple( const Reference< XExtendedDocumentHandler > &r
r->ignorableWhitespace( OUString() ); r->ignorableWhitespace( OUString() );
r->comment( OUString( RTL_CONSTASCII_USTRINGPARAM("Dies ist ein Kommentar !")) ); r->comment( OUString( "Dies ist ein Kommentar !") );
r->ignorableWhitespace( OUString() ); r->ignorableWhitespace( OUString() );
r->startElement( OUString( RTL_CONSTASCII_USTRINGPARAM("emptytagtest")) , rList ); r->startElement( OUString( "emptytagtest") , rList );
r->endElement( OUString( RTL_CONSTASCII_USTRINGPARAM("emptytagtest")) ); r->endElement( OUString( "emptytagtest") );
r->endElement( OUString( RTL_CONSTASCII_USTRINGPARAM("hi")) ); r->endElement( OUString( "hi") );
r->ignorableWhitespace( OUString() ); r->ignorableWhitespace( OUString() );
r->endElement( OUString( RTL_CONSTASCII_USTRINGPARAM("tag1")) ); r->endElement( OUString( "tag1") );
r->endDocument(); r->endDocument();
} }
@@ -566,7 +566,7 @@ void OSaxWriterTest::testExceptions( const Reference< XExtendedDocumentHandler >
sal_Bool bException = sal_True; sal_Bool bException = sal_True;
try try
{ {
r->startElement( OUString( RTL_CONSTASCII_USTRINGPARAM("huhu")) , rList ); r->startElement( OUString( "huhu") , rList );
bException = sal_False; bException = sal_False;
} }
catch( SAXException &e ) catch( SAXException &e )
@@ -578,13 +578,13 @@ void OSaxWriterTest::testExceptions( const Reference< XExtendedDocumentHandler >
r->startDocument(); r->startDocument();
r->startElement( OUString( RTL_CONSTASCII_USTRINGPARAM("huhu")) , rList ); r->startElement( OUString( "huhu") , rList );
r->startCDATA(); r->startCDATA();
{ {
sal_Bool bException = sal_True; sal_Bool bException = sal_True;
try{ try{
r->startElement( OUString( RTL_CONSTASCII_USTRINGPARAM("huhu")) , rList ); r->startElement( OUString( "huhu") , rList );
bException = sal_False; bException = sal_False;
} }
catch( SAXException &e ) { 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(); r->endDocument();
} }
@@ -631,10 +631,10 @@ void OSaxWriterTest::testDTD(const Reference< XExtendedDocumentHandler > &r )
r->startDocument(); r->startDocument();
r->unknown( OUString( RTL_CONSTASCII_USTRINGPARAM("<!DOCTYPE iCalendar >\n")) ); r->unknown( OUString( "<!DOCTYPE iCalendar >\n") );
r->startElement( OUString( RTL_CONSTASCII_USTRINGPARAM("huhu")) , rList ); r->startElement( OUString( "huhu") , rList );
r->endElement( OUString( RTL_CONSTASCII_USTRINGPARAM("huhu")) ); r->endElement( OUString( "huhu") );
r->endDocument(); r->endDocument();
} }
@@ -644,10 +644,10 @@ void OSaxWriterTest::testPerformance(const Reference< XExtendedDocumentHandler
AttributeListImpl *pList = new AttributeListImpl; AttributeListImpl *pList = new AttributeListImpl;
OUString testParagraph = OUString testParagraph =
OUString( RTL_CONSTASCII_USTRINGPARAM( OUString(
"Dies ist ein bloeder Test um zu uberpruefen, ob der SAXWriter " "Dies ist ein bloeder Test um zu uberpruefen, ob der SAXWriter "
"wohl Zeilenumbrueche halbwegs richtig macht oder ob er die Zeile " "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 ); Reference< XAttributeList > rList( (XAttributeList *) pList , UNO_QUERY );
@@ -668,12 +668,12 @@ void OSaxWriterTest::testPerformance(const Reference< XExtendedDocumentHandler
// just write a bunch of xml tags ! // just write a bunch of xml tags !
// for performance testing // for performance testing
sal_Int32 i2; sal_Int32 i2;
OUString huhu( RTL_CONSTASCII_USTRINGPARAM("huhu") ); OUString huhu( "huhu" );
OUString emptyString; OUString emptyString;
const int ITERATIONS = 125; const int ITERATIONS = 125;
for( i2 = 0 ; i2 < ITERATIONS ; i2 ++ ) for( i2 = 0 ; i2 < ITERATIONS ; i2 ++ )
{ {
r->startElement( OUString( RTL_CONSTASCII_USTRINGPARAM("tag") ) + r->startElement( OUString( "tag" ) +
OUString::valueOf( i2 ), rList ); OUString::valueOf( i2 ), rList );
for( sal_Int32 i = 0 ; i < 450 ; i ++ ) 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-- ) for( i2 = ITERATIONS-1 ; i2 >= 0 ; i2-- )
{ {
r->ignorableWhitespace( emptyString ); r->ignorableWhitespace( emptyString );
r->endElement( OUString( RTL_CONSTASCII_USTRINGPARAM("tag") ) + OUString::valueOf( i2 ) ); r->endElement( OUString( "tag" ) + OUString::valueOf( i2 ) );
} }
r->endDocument(); r->endDocument();

View File

@@ -152,7 +152,7 @@ public: // Error handler
{ {
printf( "Error !\n" ); printf( "Error !\n" );
throw SAXException( throw SAXException(
OUString( RTL_CONSTASCII_USTRINGPARAM("error from error handler")) , OUString( "error from error handler") ,
Reference < XInterface >() , Reference < XInterface >() ,
aSAXParseException ); aSAXParseException );
} }
@@ -504,14 +504,14 @@ int main (int argc, char **argv)
// create service manager // create service manager
Reference< XMultiServiceFactory > xSMgr = createRegistryServiceFactory( Reference< XMultiServiceFactory > xSMgr = createRegistryServiceFactory(
OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" )) ); OUString( "applicat.rdb" ) );
Reference < XImplementationRegistration > xReg; Reference < XImplementationRegistration > xReg;
try try
{ {
// Create registration service // Create registration service
Reference < XInterface > x = xSMgr->createInstance( 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 ); xReg = Reference< XImplementationRegistration > ( x , UNO_QUERY );
} }
catch( Exception & ) { catch( Exception & ) {
@@ -523,9 +523,9 @@ int main (int argc, char **argv)
try try
{ {
// Load dll for the tested component // Load dll for the tested component
OUString aDllName(RTL_CONSTASCII_USTRINGPARAM( "sax.uno" SAL_DLLEXTENSION )); OUString aDllName( "sax.uno" SAL_DLLEXTENSION );
xReg->registerImplementation( xReg->registerImplementation(
OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.loader.SharedLibrary")), OUString("com.sun.star.loader.SharedLibrary"),
aDllName, aDllName,
Reference< XSimpleRegistry > () ); Reference< XSimpleRegistry > () );
} }
@@ -542,7 +542,7 @@ int main (int argc, char **argv)
// read xml from a file and count elements // read xml from a file and count elements
//-------------------------------- //--------------------------------
Reference< XInterface > x = xSMgr->createInstance( 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() ) if( x.is() )
{ {
Reference< XParser > rParser( x , UNO_QUERY ); Reference< XParser > rParser( x , UNO_QUERY );
@@ -582,7 +582,7 @@ int main (int argc, char **argv)
//---------------------- //----------------------
// The SAX-Writer demo // 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() ) if( x.is() )
{ {
printf( "start writing to %s\n" , argv[2] ); printf( "start writing to %s\n" , argv[2] );
@@ -597,50 +597,50 @@ int main (int argc, char **argv)
Reference< XExtendedDocumentHandler > r( x , UNO_QUERY ); Reference< XExtendedDocumentHandler > r( x , UNO_QUERY );
r->startDocument(); r->startDocument();
pList->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM("Arg1" )), pList->addAttribute( OUString( "Arg1" ),
OUString( RTL_CONSTASCII_USTRINGPARAM("CDATA")) , OUString( "CDATA") ,
OUString( RTL_CONSTASCII_USTRINGPARAM("foo\n u")) ); OUString( "foo\n u") );
pList->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM("Arg2")) , pList->addAttribute( OUString( "Arg2") ,
OUString( RTL_CONSTASCII_USTRINGPARAM("CDATA")) , OUString( "CDATA") ,
OUString( RTL_CONSTASCII_USTRINGPARAM("foo2")) ); OUString( "foo2") );
r->startElement( OUString( RTL_CONSTASCII_USTRINGPARAM("tag1")) , rList ); r->startElement( OUString( "tag1") , rList );
// tells the writer to insert a linefeed // tells the writer to insert a linefeed
r->ignorableWhitespace( OUString() ); r->ignorableWhitespace( OUString() );
r->characters( OUString( RTL_CONSTASCII_USTRINGPARAM("huhu")) ); r->characters( OUString( "huhu") );
r->ignorableWhitespace( OUString() ); r->ignorableWhitespace( OUString() );
r->startElement( OUString( RTL_CONSTASCII_USTRINGPARAM("hi")) , rList ); r->startElement( OUString( "hi") , rList );
r->ignorableWhitespace( OUString() ); r->ignorableWhitespace( OUString() );
// the enpassant must be converted & -> &amp; // the enpassant must be converted & -> &amp;
r->characters( OUString( RTL_CONSTASCII_USTRINGPARAM("&#252;")) ); r->characters( OUString( "&#252;") );
r->ignorableWhitespace( OUString() ); r->ignorableWhitespace( OUString() );
// '>' must not be converted // '>' must not be converted
r->startCDATA(); r->startCDATA();
r->characters( OUString( RTL_CONSTASCII_USTRINGPARAM(" > foo < ")) ); r->characters( OUString( " > foo < ") );
r->endCDATA(); r->endCDATA();
r->ignorableWhitespace( OUString() ); 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 " "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 ); writeParagraphHelper( r , testParagraph );
r->ignorableWhitespace( OUString() ); r->ignorableWhitespace( OUString() );
r->comment( OUString( RTL_CONSTASCII_USTRINGPARAM("This is a comment !")) ); r->comment( OUString( "This is a comment !") );
r->ignorableWhitespace( OUString() ); r->ignorableWhitespace( OUString() );
r->startElement( OUString( RTL_CONSTASCII_USTRINGPARAM("emptytagtest")) , rList ); r->startElement( OUString( "emptytagtest") , rList );
r->endElement( OUString( RTL_CONSTASCII_USTRINGPARAM("emptytagtest")) ); r->endElement( OUString( "emptytagtest") );
r->ignorableWhitespace( OUString() ); r->ignorableWhitespace( OUString() );
r->endElement( OUString( RTL_CONSTASCII_USTRINGPARAM("hi")) ); r->endElement( OUString( "hi") );
r->ignorableWhitespace( OUString() ); r->ignorableWhitespace( OUString() );
r->endElement( OUString( RTL_CONSTASCII_USTRINGPARAM("tag1")) ); r->endElement( OUString( "tag1") );
r->endDocument(); r->endDocument();
printf( "finished writing\n" ); printf( "finished writing\n" );

View File

@@ -70,7 +70,7 @@ int main (int argc, char **argv)
// create service manager // create service manager
Reference< XMultiServiceFactory > xSMgr = Reference< XMultiServiceFactory > xSMgr =
createRegistryServiceFactory( OUString( RTL_CONSTASCII_USTRINGPARAM("applicat.rdb")) ); createRegistryServiceFactory( OUString( "applicat.rdb") );
Reference < XImplementationRegistration > xReg; Reference < XImplementationRegistration > xReg;
Reference < XSimpleRegistry > xSimpleReg; Reference < XSimpleRegistry > xSimpleReg;
@@ -79,7 +79,7 @@ int main (int argc, char **argv)
{ {
// Create registration service // Create registration service
Reference < XInterface > x = xSMgr->createInstance( 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 ); xReg = Reference< XImplementationRegistration > ( x , UNO_QUERY );
} }
catch (const Exception&) catch (const Exception&)
@@ -98,12 +98,12 @@ int main (int argc, char **argv)
#ifdef SAL_W32 #ifdef SAL_W32
OUString aDllName = OStringToOUString( argv[n] , RTL_TEXTENCODING_ASCII_US ); OUString aDllName = OStringToOUString( argv[n] , RTL_TEXTENCODING_ASCII_US );
#else #else
OUString aDllName = OUString( RTL_CONSTASCII_USTRINGPARAM("lib")); OUString aDllName = OUString( "lib");
aDllName += OStringToOUString( argv[n] , RTL_TEXTENCODING_ASCII_US ); aDllName += OStringToOUString( argv[n] , RTL_TEXTENCODING_ASCII_US );
aDllName += OUString( RTL_CONSTASCII_USTRINGPARAM(".so")); aDllName += OUString( ".so");
#endif #endif
xReg->registerImplementation( xReg->registerImplementation(
OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.loader.SharedLibrary")), OUString("com.sun.star.loader.SharedLibrary"),
aDllName, aDllName,
xSimpleReg ); xSimpleReg );
} }
@@ -126,13 +126,13 @@ int main (int argc, char **argv)
#ifdef SAL_W32 #ifdef SAL_W32
OUString aDllName = OStringToOUString( sTestName , RTL_TEXTENCODING_ASCII_US ); OUString aDllName = OStringToOUString( sTestName , RTL_TEXTENCODING_ASCII_US );
#else #else
OUString aDllName = OUString( RTL_CONSTASCII_USTRINGPARAM("lib")); OUString aDllName = OUString( "lib");
aDllName += OStringToOUString( sTestName , RTL_TEXTENCODING_ASCII_US ); aDllName += OStringToOUString( sTestName , RTL_TEXTENCODING_ASCII_US );
aDllName += OUString( RTL_CONSTASCII_USTRINGPARAM(".so")); aDllName += OUString( ".so");
#endif #endif
xReg->registerImplementation( xReg->registerImplementation(
OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.loader.SharedLibrary")) , OUString("com.sun.star.loader.SharedLibrary") ,
aDllName, aDllName,
xSimpleReg ); xSimpleReg );
} }

View File

@@ -235,11 +235,11 @@ static String ToUpperUnicode( const String & rStr )
// I don't know the locale, so en_US is hopefully fine // I don't know the locale, so en_US is hopefully fine
/* /*
com.sun.star.lang.Locale aLocale; com.sun.star.lang.Locale aLocale;
aLocale.Language = OUString(RTL_CONSTASCII_USTRINGPARAM("en")); aLocale.Language = OUString("en");
aLocale.Country = OUString(RTL_CONSTASCII_USTRINGPARAM("US")); aLocale.Country = OUString("US");
*/ */
static rtl::OUString aEN(RTL_CONSTASCII_USTRINGPARAM("en")); static rtl::OUString aEN("en");
static rtl::OUString aUS(RTL_CONSTASCII_USTRINGPARAM("US")); static rtl::OUString aUS("US");
static CharClass aCC( com::sun::star::lang::Locale( aEN, aUS, rtl::OUString() ) ); static CharClass aCC( com::sun::star::lang::Locale( aEN, aUS, rtl::OUString() ) );
return aCC.uppercase( rStr ); return aCC.uppercase( rStr );
} }

View File

@@ -1217,7 +1217,7 @@ void SotStorage::SetKey( const rtl::OString& rKey )
::com::sun::star::uno::Sequence < sal_Int8 > aSequ( (sal_Int8*) pBuffer, RTL_DIGEST_LENGTH_SHA1 ); ::com::sun::star::uno::Sequence < sal_Int8 > aSequ( (sal_Int8*) pBuffer, RTL_DIGEST_LENGTH_SHA1 );
::com::sun::star::uno::Any aAny; ::com::sun::star::uno::Any aAny;
aAny <<= aSequ; aAny <<= aSequ;
SetProperty( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("EncryptionKey")), aAny ); SetProperty( ::rtl::OUString("EncryptionKey"), aAny );
} }
} }
} }
@@ -1243,8 +1243,8 @@ SotStorage* SotStorage::OpenOLEStorage( const com::sun::star::uno::Reference < c
{ {
uno::Reference < beans::XPropertySet > xStreamProps( xStream, uno::UNO_QUERY_THROW ); uno::Reference < beans::XPropertySet > xStreamProps( xStream, uno::UNO_QUERY_THROW );
xStreamProps->setPropertyValue( xStreamProps->setPropertyValue(
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MediaType" ) ), ::rtl::OUString( "MediaType" ),
uno::makeAny( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "application/vnd.sun.star.oleobject" ) ) ) ); uno::makeAny( ::rtl::OUString( "application/vnd.sun.star.oleobject" ) ) );
} }
pStream = utl::UcbStreamHelper::CreateStream( xStream ); pStream = utl::UcbStreamHelper::CreateStream( xStream );
@@ -1266,7 +1266,7 @@ sal_Int32 SotStorage::GetFormatID( const com::sun::star::uno::Reference < com::s
return 0; return 0;
::rtl::OUString aMediaType; ::rtl::OUString aMediaType;
xProps->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")) ) >>= aMediaType; xProps->getPropertyValue( ::rtl::OUString("MediaType") ) >>= aMediaType;
if ( !aMediaType.isEmpty() ) if ( !aMediaType.isEmpty() )
{ {
::com::sun::star::datatransfer::DataFlavor aDataFlavor; ::com::sun::star::datatransfer::DataFlavor aDataFlavor;

View File

@@ -670,7 +670,7 @@ UCBStorageStream_Impl::UCBStorageStream_Impl( const String& rName, StreamMode nM
{ {
xComEnv = new ::ucbhelper::CommandEnvironment( Reference< ::com::sun::star::task::XInteractionHandler >(), xComEnv = new ::ucbhelper::CommandEnvironment( Reference< ::com::sun::star::task::XInteractionHandler >(),
xProgress ); xProgress );
aTemp += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("?repairpackage")); aTemp += rtl::OUString("?repairpackage");
} }
m_pContent = new ::ucbhelper::Content( aTemp, xComEnv ); m_pContent = new ::ucbhelper::Content( aTemp, xComEnv );
@@ -688,7 +688,7 @@ UCBStorageStream_Impl::UCBStorageStream_Impl( const String& rName, StreamMode nM
::com::sun::star::uno::Sequence < sal_Int8 > aSequ( (sal_Int8*) pBuffer, RTL_DIGEST_LENGTH_SHA1 ); ::com::sun::star::uno::Sequence < sal_Int8 > aSequ( (sal_Int8*) pBuffer, RTL_DIGEST_LENGTH_SHA1 );
::com::sun::star::uno::Any aAny; ::com::sun::star::uno::Any aAny;
aAny <<= aSequ; aAny <<= aSequ;
m_pContent->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("EncryptionKey")), aAny ); m_pContent->setPropertyValue( ::rtl::OUString("EncryptionKey"), aAny );
} }
} }
} }
@@ -1177,7 +1177,7 @@ sal_Int16 UCBStorageStream_Impl::Commit()
aArg.Data = xStream; aArg.Data = xStream;
aArg.ReplaceExisting = sal_True; aArg.ReplaceExisting = sal_True;
aAny <<= aArg; aAny <<= aArg;
m_pContent->executeCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("insert")), aAny ); m_pContent->executeCommand( ::rtl::OUString("insert"), aAny );
// wrapper now controls lifetime of temporary file // wrapper now controls lifetime of temporary file
m_aTempURL.Erase(); m_aTempURL.Erase();
@@ -1782,7 +1782,7 @@ void UCBStorage_Impl::Init()
{ {
// Hack! Avoid access to the manifest file until mediatype is not available in the first segment of a // Hack! Avoid access to the manifest file until mediatype is not available in the first segment of a
// disk spanned file // disk spanned file
m_aContentType = m_aOriginalContentType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("application/vnd.sun.xml.impress") ); m_aContentType = m_aOriginalContentType = ::rtl::OUString( "application/vnd.sun.xml.impress" );
} }
else if ( m_pContent ) else if ( m_pContent )
{ {
@@ -1794,8 +1794,8 @@ void UCBStorage_Impl::Init()
if ( m_nError == ERRCODE_NONE ) if ( m_nError == ERRCODE_NONE )
{ {
// read the manifest.xml file // read the manifest.xml file
aObj.Append( String( RTL_CONSTASCII_USTRINGPARAM("META-INF") ) ); aObj.Append( String( "META-INF" ) );
aObj.Append( String( RTL_CONSTASCII_USTRINGPARAM("manifest.xml") ) ); aObj.Append( String( "manifest.xml" ) );
// create input stream // create input stream
SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( aObj.GetMainURL( INetURLObject::NO_DECODE ), STREAM_STD_READ ); SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( aObj.GetMainURL( INetURLObject::NO_DECODE ), STREAM_STD_READ );
@@ -1811,7 +1811,7 @@ void UCBStorage_Impl::Init()
Reference < ::com::sun::star::packages::manifest::XManifestReader > xReader = Reference < ::com::sun::star::packages::manifest::XManifestReader > xReader =
Reference< ::com::sun::star::packages::manifest::XManifestReader > Reference< ::com::sun::star::packages::manifest::XManifestReader >
( ::comphelper::getProcessServiceFactory()->createInstance( ( ::comphelper::getProcessServiceFactory()->createInstance(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.packages.manifest.ManifestReader"))), UNO_QUERY) ; ::rtl::OUString("com.sun.star.packages.manifest.ManifestReader")), UNO_QUERY) ;
Sequence < Sequence < PropertyValue > > aProps = xReader->readManifestSequence( xInputStream ); Sequence < Sequence < PropertyValue > > aProps = xReader->readManifestSequence( xInputStream );
// cleanup // cleanup
@@ -1831,7 +1831,7 @@ void UCBStorage_Impl::Init()
{ {
// get the manifest information from the package // get the manifest information from the package
try { try {
Any aAny = m_pContent->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")) ); Any aAny = m_pContent->getPropertyValue( ::rtl::OUString("MediaType") );
rtl::OUString aTmp; rtl::OUString aTmp;
if ( ( aAny >>= aTmp ) && !aTmp.isEmpty() ) if ( ( aAny >>= aTmp ) && !aTmp.isEmpty() )
m_aContentType = m_aOriginalContentType = aTmp; m_aContentType = m_aOriginalContentType = aTmp;
@@ -1876,7 +1876,7 @@ void UCBStorage_Impl::CreateContent()
{ {
xComEnv = new ::ucbhelper::CommandEnvironment( Reference< ::com::sun::star::task::XInteractionHandler >(), xComEnv = new ::ucbhelper::CommandEnvironment( Reference< ::com::sun::star::task::XInteractionHandler >(),
m_xProgressHandler ); m_xProgressHandler );
aTemp += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("?repairpackage")); aTemp += rtl::OUString("?repairpackage");
} }
m_pContent = new ::ucbhelper::Content( aTemp, xComEnv ); m_pContent = new ::ucbhelper::Content( aTemp, xComEnv );
@@ -1903,10 +1903,10 @@ void UCBStorage_Impl::ReadContent()
// create cursor for access to children // create cursor for access to children
Sequence< ::rtl::OUString > aProps(4); Sequence< ::rtl::OUString > aProps(4);
::rtl::OUString* pProps = aProps.getArray(); ::rtl::OUString* pProps = aProps.getArray();
pProps[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Title")); pProps[0] = ::rtl::OUString("Title");
pProps[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsFolder")); pProps[1] = ::rtl::OUString("IsFolder");
pProps[2] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")); pProps[2] = ::rtl::OUString("MediaType");
pProps[3] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Size")); pProps[3] = ::rtl::OUString("Size");
::ucbhelper::ResultSetInclude eInclude = ::ucbhelper::INCLUDE_FOLDERS_AND_DOCUMENTS; ::ucbhelper::ResultSetInclude eInclude = ::ucbhelper::INCLUDE_FOLDERS_AND_DOCUMENTS;
try try
@@ -1961,13 +1961,13 @@ void UCBStorage_Impl::ReadContent()
{ {
xComEnv = new ::ucbhelper::CommandEnvironment( Reference< ::com::sun::star::task::XInteractionHandler >(), xComEnv = new ::ucbhelper::CommandEnvironment( Reference< ::com::sun::star::task::XInteractionHandler >(),
m_xProgressHandler ); m_xProgressHandler );
aName += String( RTL_CONSTASCII_USTRINGPARAM( "?repairpackage" ) ); aName += String( "?repairpackage" );
} }
::ucbhelper::Content aContent( aName, xComEnv ); ::ucbhelper::Content aContent( aName, xComEnv );
::rtl::OUString aMediaType; ::rtl::OUString aMediaType;
Any aAny = aContent.getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")) ); Any aAny = aContent.getPropertyValue( ::rtl::OUString("MediaType") );
if ( ( aAny >>= aMediaType ) && ( aMediaType.compareToAscii("application/vnd.sun.star.oleobject") == 0 ) ) if ( ( aAny >>= aMediaType ) && ( aMediaType.compareToAscii("application/vnd.sun.star.oleobject") == 0 ) )
pElement->m_bIsStorage = sal_True; pElement->m_bIsStorage = sal_True;
else if ( aMediaType.isEmpty() ) else if ( aMediaType.isEmpty() )
@@ -2127,9 +2127,9 @@ void UCBStorage_Impl::GetProps( sal_Int32& nProps, Sequence < Sequence < Propert
if ( !m_bIsRoot ) if ( !m_bIsRoot )
aPath += m_aName; aPath += m_aName;
aPath += '/'; aPath += '/';
aProps[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")); aProps[0].Name = ::rtl::OUString("MediaType");
aProps[0].Value <<= (::rtl::OUString ) m_aContentType; aProps[0].Value <<= (::rtl::OUString ) m_aContentType;
aProps[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FullPath")); aProps[1].Name = ::rtl::OUString("FullPath");
aProps[1].Value <<= (::rtl::OUString ) aPath; aProps[1].Value <<= (::rtl::OUString ) aPath;
rSequence[ nProps++ ] = aProps; rSequence[ nProps++ ] = aProps;
@@ -2150,9 +2150,9 @@ void UCBStorage_Impl::GetProps( sal_Int32& nProps, Sequence < Sequence < Propert
// properties of streams // properties of streams
String aElementPath( aPath ); String aElementPath( aPath );
aElementPath += pElement->m_aName; aElementPath += pElement->m_aName;
aProps[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")); aProps[0].Name = ::rtl::OUString("MediaType");
aProps[0].Value <<= (::rtl::OUString ) pElement->GetContentType(); aProps[0].Value <<= (::rtl::OUString ) pElement->GetContentType();
aProps[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FullPath")); aProps[1].Name = ::rtl::OUString("FullPath");
aProps[1].Value <<= (::rtl::OUString ) aElementPath; aProps[1].Value <<= (::rtl::OUString ) aElementPath;
rSequence[ nProps++ ] = aProps; rSequence[ nProps++ ] = aProps;
} }
@@ -2199,7 +2199,7 @@ sal_Bool UCBStorage_Impl::Insert( ::ucbhelper::Content *pContent )
Sequence < ::rtl::OUString > aNames(1); Sequence < ::rtl::OUString > aNames(1);
::rtl::OUString* pNames = aNames.getArray(); ::rtl::OUString* pNames = aNames.getArray();
pNames[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) ); pNames[0] = ::rtl::OUString( "Title" );
Sequence < Any > aValues(1); Sequence < Any > aValues(1);
Any* pValues = aValues.getArray(); Any* pValues = aValues.getArray();
pValues[0] = makeAny( ::rtl::OUString( m_aName ) ); pValues[0] = makeAny( ::rtl::OUString( m_aName ) );
@@ -2269,7 +2269,7 @@ sal_Int16 UCBStorage_Impl::Commit()
// first remove all open stream handles // first remove all open stream handles
if( !pElement->m_xStream.Is() || pElement->m_xStream->Clear() ) if( !pElement->m_xStream.Is() || pElement->m_xStream->Clear() )
{ {
pContent->executeCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("delete")), makeAny( sal_Bool( sal_True ) ) ); pContent->executeCommand( ::rtl::OUString("delete"), makeAny( sal_Bool( sal_True ) ) );
nRet = COMMIT_RESULT_SUCCESS; nRet = COMMIT_RESULT_SUCCESS;
} }
else else
@@ -2315,7 +2315,7 @@ sal_Int16 UCBStorage_Impl::Commit()
nLocalRet = COMMIT_RESULT_SUCCESS; nLocalRet = COMMIT_RESULT_SUCCESS;
Any aAny; Any aAny;
aAny <<= (rtl::OUString) pElement->m_aName; aAny <<= (rtl::OUString) pElement->m_aName;
pContent->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Title")), aAny ); pContent->setPropertyValue( ::rtl::OUString("Title"), aAny );
} }
if ( pElement->IsLoaded() && pElement->GetContentType() != pElement->GetOriginalContentType() ) if ( pElement->IsLoaded() && pElement->GetContentType() != pElement->GetOriginalContentType() )
@@ -2324,7 +2324,7 @@ sal_Int16 UCBStorage_Impl::Commit()
nLocalRet = COMMIT_RESULT_SUCCESS; nLocalRet = COMMIT_RESULT_SUCCESS;
Any aAny; Any aAny;
aAny <<= (rtl::OUString) pElement->GetContentType(); aAny <<= (rtl::OUString) pElement->GetContentType();
pContent->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")), aAny ); pContent->setPropertyValue( ::rtl::OUString("MediaType"), aAny );
} }
if ( nLocalRet != COMMIT_RESULT_NOTHING_TO_DO ) if ( nLocalRet != COMMIT_RESULT_NOTHING_TO_DO )
@@ -2375,7 +2375,7 @@ sal_Int16 UCBStorage_Impl::Commit()
// clipboard format and ClassId will be retrieved from the media type when the file is loaded again // clipboard format and ClassId will be retrieved from the media type when the file is loaded again
Any aType; Any aType;
aType <<= (rtl::OUString) m_aContentType; aType <<= (rtl::OUString) m_aContentType;
m_pContent->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")), aType ); m_pContent->setPropertyValue( ::rtl::OUString("MediaType"), aType );
if ( m_bIsLinked ) if ( m_bIsLinked )
{ {
@@ -2398,7 +2398,7 @@ sal_Int16 UCBStorage_Impl::Commit()
Reference < ::com::sun::star::packages::manifest::XManifestWriter > xWriter = Reference < ::com::sun::star::packages::manifest::XManifestWriter > xWriter =
Reference< ::com::sun::star::packages::manifest::XManifestWriter > Reference< ::com::sun::star::packages::manifest::XManifestWriter >
( ::comphelper::getProcessServiceFactory()->createInstance( ( ::comphelper::getProcessServiceFactory()->createInstance(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.packages.manifest.ManifestWriter"))), UNO_QUERY) ; ::rtl::OUString("com.sun.star.packages.manifest.ManifestWriter")), UNO_QUERY) ;
sal_Int32 nCount = GetObjectCount() + 1; sal_Int32 nCount = GetObjectCount() + 1;
Sequence < Sequence < PropertyValue > > aProps( nCount ); Sequence < Sequence < PropertyValue > > aProps( nCount );
sal_Int32 nProps = 0; sal_Int32 nProps = 0;
@@ -2410,7 +2410,7 @@ sal_Int16 UCBStorage_Impl::Commit()
xWriter = NULL; xWriter = NULL;
xOutputStream = NULL; xOutputStream = NULL;
DELETEZ( pTempFile ); DELETEZ( pTempFile );
aNewSubFolder.transferContent( aSource, InsertOperation_MOVE, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("manifest.xml")), NameClash::OVERWRITE ); aNewSubFolder.transferContent( aSource, InsertOperation_MOVE, ::rtl::OUString("manifest.xml"), NameClash::OVERWRITE );
} }
} }
else else
@@ -2421,7 +2421,7 @@ sal_Int16 UCBStorage_Impl::Commit()
#endif #endif
// force writing // force writing
Any aAny; Any aAny;
m_pContent->executeCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("flush")), aAny ); m_pContent->executeCommand( ::rtl::OUString("flush"), aAny );
if ( m_pSource != 0 ) if ( m_pSource != 0 )
{ {
SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( m_pTempFile->GetURL(), STREAM_STD_READ ); SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( m_pTempFile->GetURL(), STREAM_STD_READ );

View File

@@ -82,14 +82,14 @@ OLESimpleStorage::~OLESimpleStorage()
uno::Sequence< ::rtl::OUString > SAL_CALL OLESimpleStorage::impl_staticGetSupportedServiceNames() uno::Sequence< ::rtl::OUString > SAL_CALL OLESimpleStorage::impl_staticGetSupportedServiceNames()
{ {
uno::Sequence< ::rtl::OUString > aRet(1); uno::Sequence< ::rtl::OUString > aRet(1);
aRet[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.OLESimpleStorage")); aRet[0] = ::rtl::OUString("com.sun.star.embed.OLESimpleStorage");
return aRet; return aRet;
} }
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
::rtl::OUString SAL_CALL OLESimpleStorage::impl_staticGetImplementationName() ::rtl::OUString SAL_CALL OLESimpleStorage::impl_staticGetImplementationName()
{ {
return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.embed.OLESimpleStorage")); return ::rtl::OUString("com.sun.star.comp.embed.OLESimpleStorage");
} }
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
@@ -265,7 +265,7 @@ void SAL_CALL OLESimpleStorage::initialize( const uno::Sequence< uno::Any >& aAr
else else
{ {
uno::Reference < io::XStream > xTempFile( uno::Reference < io::XStream > xTempFile(
m_xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.io.TempFile")) ), m_xFactory->createInstance( ::rtl::OUString("com.sun.star.io.TempFile") ),
uno::UNO_QUERY_THROW ); uno::UNO_QUERY_THROW );
uno::Reference < io::XSeekable > xTempSeek( xTempFile, uno::UNO_QUERY_THROW ); uno::Reference < io::XSeekable > xTempSeek( xTempFile, uno::UNO_QUERY_THROW );
uno::Reference< io::XOutputStream > xTempOut = xTempFile->getOutputStream(); uno::Reference< io::XOutputStream > xTempOut = xTempFile->getOutputStream();
@@ -367,7 +367,7 @@ void SAL_CALL OLESimpleStorage::insertByName( const ::rtl::OUString& aName, cons
} }
catch( const uno::Exception& e ) catch( const uno::Exception& e )
{ {
throw lang::WrappedTargetException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Insert has failed!" ) ), throw lang::WrappedTargetException( ::rtl::OUString( "Insert has failed!" ),
uno::Reference< uno::XInterface >(), uno::Reference< uno::XInterface >(),
uno::makeAny( e ) ); uno::makeAny( e ) );
} }
@@ -424,7 +424,7 @@ void SAL_CALL OLESimpleStorage::replaceByName( const ::rtl::OUString& aName, con
{ {
uno::Any aCaught( ::cppu::getCaughtException() ); uno::Any aCaught( ::cppu::getCaughtException() );
throw lang::WrappedTargetException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Can't copy raw stream")), throw lang::WrappedTargetException( ::rtl::OUString("Can't copy raw stream"),
uno::Reference< uno::XInterface >(), uno::Reference< uno::XInterface >(),
aCaught ); aCaught );
} }
@@ -450,7 +450,7 @@ uno::Any SAL_CALL OLESimpleStorage::getByName( const ::rtl::OUString& aName )
uno::Any aResult; uno::Any aResult;
uno::Reference< io::XStream > xTempFile( uno::Reference< io::XStream > xTempFile(
m_xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.io.TempFile")) ), m_xFactory->createInstance( ::rtl::OUString("com.sun.star.io.TempFile") ),
uno::UNO_QUERY ); uno::UNO_QUERY );
uno::Reference< io::XSeekable > xSeekable( xTempFile, uno::UNO_QUERY_THROW ); uno::Reference< io::XSeekable > xSeekable( xTempFile, uno::UNO_QUERY_THROW );
uno::Reference< io::XOutputStream > xOutputStream = xTempFile->getOutputStream(); uno::Reference< io::XOutputStream > xOutputStream = xTempFile->getOutputStream();
@@ -486,7 +486,7 @@ uno::Any SAL_CALL OLESimpleStorage::getByName( const ::rtl::OUString& aName )
uno::Reference< container::XNameContainer > xResultNameContainer( uno::Reference< container::XNameContainer > xResultNameContainer(
m_xFactory->createInstanceWithArguments( m_xFactory->createInstanceWithArguments(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.OLESimpleStorage")), ::rtl::OUString("com.sun.star.embed.OLESimpleStorage"),
aArgs ), aArgs ),
uno::UNO_QUERY_THROW ); uno::UNO_QUERY_THROW );