targeted string re-work

Change-Id: I44518bb1b464bb0b458c0b5f1c249ef160ea3b26
This commit is contained in:
Norbert Thiebaud
2012-06-01 09:39:35 -05:00
parent a30795ce51
commit df9ecb71c7
17 changed files with 76 additions and 79 deletions

View File

@@ -59,7 +59,7 @@ namespace
Sequence< OUString > SAL_CALL MimeContentTypeFactory_getSupportedServiceNames( ) Sequence< OUString > SAL_CALL MimeContentTypeFactory_getSupportedServiceNames( )
{ {
Sequence< OUString > aRet(1); Sequence< OUString > aRet(1);
aRet[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.MimeContentTypeFactory")); aRet[0] = OUString("com.sun.star.datatransfer.MimeContentTypeFactory");
return aRet; return aRet;
} }
} }
@@ -91,7 +91,7 @@ Reference< XMimeContentType > CMimeContentTypeFactory::createMimeContentType( co
OUString SAL_CALL CMimeContentTypeFactory::getImplementationName( ) OUString SAL_CALL CMimeContentTypeFactory::getImplementationName( )
throw( RuntimeException ) throw( RuntimeException )
{ {
return OUString(RTL_CONSTASCII_USTRINGPARAM( MIMECONTENTTYPEFACTORY_IMPL_NAME )); return OUString( MIMECONTENTTYPEFACTORY_IMPL_NAME );
} }
// ------------------------------------------------- // -------------------------------------------------

View File

@@ -85,7 +85,7 @@ OUString SAL_CALL CMimeContentType::getMediaSubtype( ) throw(RuntimeException)
OUString SAL_CALL CMimeContentType::getFullMediaType( ) throw(RuntimeException) OUString SAL_CALL CMimeContentType::getFullMediaType( ) throw(RuntimeException)
{ {
return m_MediaType + OUString(RTL_CONSTASCII_USTRINGPARAM("/")) + m_MediaSubtype; return m_MediaType + OUString("/") + m_MediaSubtype;
} }
//------------------------------------------------------------------------ //------------------------------------------------------------------------
@@ -206,7 +206,7 @@ void SAL_CALL CMimeContentType::type( void )
{ {
if ( isInRange( m_nxtSym, sToken ) ) if ( isInRange( m_nxtSym, sToken ) )
m_MediaType += m_nxtSym; m_MediaType += m_nxtSym;
else if ( isInRange( m_nxtSym, OUString(RTL_CONSTASCII_USTRINGPARAM("/ ")) ) ) else if ( isInRange( m_nxtSym, OUString("/ ") ) )
break; break;
else else
throw IllegalArgumentException( ); throw IllegalArgumentException( );
@@ -215,7 +215,7 @@ void SAL_CALL CMimeContentType::type( void )
// check FOLLOW( type ) // check FOLLOW( type )
skipSpaces( ); skipSpaces( );
acceptSym( OUString(RTL_CONSTASCII_USTRINGPARAM("/")) ); acceptSym( OUString("/") );
subtype( ); subtype( );
} }
@@ -238,7 +238,7 @@ void SAL_CALL CMimeContentType::subtype( void )
{ {
if ( isInRange( m_nxtSym, sToken ) ) if ( isInRange( m_nxtSym, sToken ) )
m_MediaSubtype += m_nxtSym; m_MediaSubtype += m_nxtSym;
else if ( isInRange( m_nxtSym, OUString(RTL_CONSTASCII_USTRINGPARAM("; ")) ) ) else if ( isInRange( m_nxtSym, OUString("; ") ) )
break; break;
else else
throw IllegalArgumentException( ); throw IllegalArgumentException( );
@@ -259,13 +259,13 @@ void SAL_CALL CMimeContentType::trailer( void )
rtl::OUString sToken(TOKEN); rtl::OUString sToken(TOKEN);
while( !m_nxtSym.isEmpty( ) ) while( !m_nxtSym.isEmpty( ) )
{ {
if ( m_nxtSym == OUString(RTL_CONSTASCII_USTRINGPARAM("(")) ) if ( m_nxtSym == OUString("(") )
{ {
getSym( ); getSym( );
comment( ); comment( );
acceptSym( OUString(RTL_CONSTASCII_USTRINGPARAM(")")) ); acceptSym( OUString(")") );
} }
else if ( m_nxtSym == OUString(RTL_CONSTASCII_USTRINGPARAM(";")) ) else if ( m_nxtSym == OUString(";") )
{ {
// get the parameter name // get the parameter name
getSym( ); getSym( );
@@ -277,7 +277,7 @@ void SAL_CALL CMimeContentType::trailer( void )
OUString pname = pName( ); OUString pname = pName( );
skipSpaces(); skipSpaces();
acceptSym( OUString(RTL_CONSTASCII_USTRINGPARAM("=")) ); acceptSym( OUString("=") );
// get the parameter value // get the parameter value
skipSpaces( ); skipSpaces( );
@@ -308,7 +308,7 @@ OUString SAL_CALL CMimeContentType::pName( )
{ {
if ( isInRange( m_nxtSym, sToken ) ) if ( isInRange( m_nxtSym, sToken ) )
pname += m_nxtSym; pname += m_nxtSym;
else if ( isInRange( m_nxtSym, OUString(RTL_CONSTASCII_USTRINGPARAM("= ")) ) ) else if ( isInRange( m_nxtSym, OUString("= ") ) )
break; break;
else else
throw IllegalArgumentException( ); throw IllegalArgumentException( );
@@ -328,7 +328,7 @@ OUString SAL_CALL CMimeContentType::pValue( )
rtl::OUString sToken(TOKEN); rtl::OUString sToken(TOKEN);
// quoted pvalue // quoted pvalue
if ( m_nxtSym == OUString(RTL_CONSTASCII_USTRINGPARAM( "\"" )) ) if ( m_nxtSym == OUString( "\"" ) )
{ {
getSym( ); getSym( );
pvalue = quotedPValue( ); pvalue = quotedPValue( );
@@ -375,7 +375,7 @@ OUString SAL_CALL CMimeContentType::quotedPValue( )
else if ( isInRange( m_nxtSym, rtl::OUString(TOKEN) + rtl::OUString(TSPECIALS) + rtl::OUString(SPACE) ) ) else if ( isInRange( m_nxtSym, rtl::OUString(TOKEN) + rtl::OUString(TSPECIALS) + rtl::OUString(SPACE) ) )
{ {
pvalue += m_nxtSym; pvalue += m_nxtSym;
if ( m_nxtSym == OUString(RTL_CONSTASCII_USTRINGPARAM( "\"" )) ) if ( m_nxtSym == OUString( "\"" ) )
bAfterQuoteSign = sal_True; bAfterQuoteSign = sal_True;
else else
bAfterQuoteSign = sal_False; bAfterQuoteSign = sal_False;
@@ -401,7 +401,7 @@ OUString SAL_CALL CMimeContentType::nonquotedPValue( )
{ {
if ( isInRange( m_nxtSym, sToken ) ) if ( isInRange( m_nxtSym, sToken ) )
pvalue += m_nxtSym; pvalue += m_nxtSym;
else if ( isInRange( m_nxtSym, OUString(RTL_CONSTASCII_USTRINGPARAM("; ")) ) ) else if ( isInRange( m_nxtSym, OUString("; ") ) )
break; break;
else else
throw IllegalArgumentException( ); throw IllegalArgumentException( );
@@ -421,7 +421,7 @@ void SAL_CALL CMimeContentType::comment( void )
{ {
if ( isInRange( m_nxtSym, rtl::OUString(TOKEN) + rtl::OUString(SPACE) ) ) if ( isInRange( m_nxtSym, rtl::OUString(TOKEN) + rtl::OUString(SPACE) ) )
getSym( ); getSym( );
else if ( m_nxtSym == OUString(RTL_CONSTASCII_USTRINGPARAM(")")) ) else if ( m_nxtSym == OUString(")") )
break; break;
else else
throw IllegalArgumentException( ); throw IllegalArgumentException( );

View File

@@ -93,7 +93,7 @@ void CheckMimeContentType( const OUString& aCntType, const OUString& aType, cons
pvalue = xMimeCntType->getParameterValue( param ); pvalue = xMimeCntType->getParameterValue( param );
} }
pvalue = xMimeCntType->getParameterValue( OUString(RTL_CONSTASCII_USTRINGPARAM("aparam")) ); pvalue = xMimeCntType->getParameterValue( OUString("aparam") );
} }
catch( IllegalArgumentException& ) catch( IllegalArgumentException& )
{ {
@@ -175,32 +175,32 @@ sal_Bool processCntTypesAndWriteResultIntoFile( char* fname, vector< string >& v
Reference< XMimeContentType > xMCntTyp = cnttypeFactory->createMimeContentType( OUString::createFromAscii( iter->c_str( ) ) ); Reference< XMimeContentType > xMCntTyp = cnttypeFactory->createMimeContentType( OUString::createFromAscii( iter->c_str( ) ) );
fwprintf( fstream, OUString(RTL_CONSTASCII_USTRINGPARAM("Type: %s\n")), xMCntTyp->getMediaType( ).getStr( ) ); fwprintf( fstream, OUString("Type: %s\n"), xMCntTyp->getMediaType( ).getStr( ) );
fwprintf( fstream, OUString(RTL_CONSTASCII_USTRINGPARAM("Subtype: %s\n")), xMCntTyp->getMediaSubtype( ).getStr( ) ); fwprintf( fstream, OUString("Subtype: %s\n"), xMCntTyp->getMediaSubtype( ).getStr( ) );
Sequence< OUString > seqParam = xMCntTyp->getParameters( ); Sequence< OUString > seqParam = xMCntTyp->getParameters( );
sal_Int32 nParams = seqParam.getLength( ); sal_Int32 nParams = seqParam.getLength( );
for ( sal_Int32 i = 0; i < nParams; i++ ) for ( sal_Int32 i = 0; i < nParams; i++ )
{ {
fwprintf( fstream, OUString(RTL_CONSTASCII_USTRINGPARAM("PName: %s\n")), seqParam[i].getStr( ) ); fwprintf( fstream, OUString("PName: %s\n"), seqParam[i].getStr( ) );
fwprintf( fstream, OUString(RTL_CONSTASCII_USTRINGPARAM("PValue: %s\n")), xMCntTyp->getParameterValue( seqParam[i] ).getStr( ) ); fwprintf( fstream, OUString("PValue: %s\n"), xMCntTyp->getParameterValue( seqParam[i] ).getStr( ) );
} }
} }
catch( IllegalArgumentException& ex ) catch( IllegalArgumentException& ex )
{ {
fwprintf( fstream, OUString(RTL_CONSTASCII_USTRINGPARAM("Fehlerhafter Content-Type gelesen!!!\n\n")) ); fwprintf( fstream, OUString("Fehlerhafter Content-Type gelesen!!!\n\n") );
} }
catch( NoSuchElementException& ) catch( NoSuchElementException& )
{ {
fwprintf( fstream, OUString(RTL_CONSTASCII_USTRINGPARAM("Parameterwert nicht vorhanden\n")) ); fwprintf( fstream, OUString("Parameterwert nicht vorhanden\n") );
} }
catch( ... ) catch( ... )
{ {
fwprintf( fstream, OUString(RTL_CONSTASCII_USTRINGPARAM("Unbekannter Fehler!!!\n\n")) ); fwprintf( fstream, OUString("Unbekannter Fehler!!!\n\n") );
} }
fwprintf( fstream, OUString(RTL_CONSTASCII_USTRINGPARAM("\n#############################################\n\n")) ); fwprintf( fstream, OUString("\n#############################################\n\n") );
} }
fclose( fstream ); fclose( fstream );
@@ -220,7 +220,7 @@ int SAL_CALL main( int nArgc, char* argv[] )
//------------------------------------------------- //-------------------------------------------------
// get the global service-manager // get the global service-manager
//------------------------------------------------- //-------------------------------------------------
OUString rdbName = OUString( RTL_CONSTASCII_USTRINGPARAM( RDB_SYSPATH ) ); OUString rdbName = OUString( RDB_SYSPATH );
Reference< XMultiServiceFactory > g_xFactory( createRegistryServiceFactory( rdbName ) ); Reference< XMultiServiceFactory > g_xFactory( createRegistryServiceFactory( rdbName ) );
// Print a message if an error occurred. // Print a message if an error occurred.
@@ -240,7 +240,7 @@ int SAL_CALL main( int nArgc, char* argv[] )
} }
Reference< XMimeContentTypeFactory > Reference< XMimeContentTypeFactory >
xMCntTypeFactory( g_xFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.MimeContentTypeFactory")) ), UNO_QUERY ); xMCntTypeFactory( g_xFactory->createInstance( OUString("com.sun.star.datatransfer.MimeContentTypeFactory") ), UNO_QUERY );
if ( !xMCntTypeFactory.is( ) ) if ( !xMCntTypeFactory.is( ) )
{ {

View File

@@ -45,7 +45,7 @@ using ::rtl::OUString;
ClipboardManager::ClipboardManager(): ClipboardManager::ClipboardManager():
WeakComponentImplHelper3< XClipboardManager, XEventListener, XServiceInfo > (m_aMutex), WeakComponentImplHelper3< XClipboardManager, XEventListener, XServiceInfo > (m_aMutex),
m_aDefaultName(OUString(RTL_CONSTASCII_USTRINGPARAM("default"))) m_aDefaultName(OUString("default"))
{ {
} }
@@ -60,7 +60,7 @@ ClipboardManager::~ClipboardManager()
OUString SAL_CALL ClipboardManager::getImplementationName( ) OUString SAL_CALL ClipboardManager::getImplementationName( )
throw(RuntimeException) throw(RuntimeException)
{ {
return OUString(RTL_CONSTASCII_USTRINGPARAM(CLIPBOARDMANAGER_IMPLEMENTATION_NAME)); return OUString(CLIPBOARDMANAGER_IMPLEMENTATION_NAME);
} }
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
@@ -94,7 +94,7 @@ Reference< XClipboard > SAL_CALL ClipboardManager::getClipboard( const OUString&
// object is disposed already // object is disposed already
if (rBHelper.bDisposed) if (rBHelper.bDisposed)
throw DisposedException(OUString(RTL_CONSTASCII_USTRINGPARAM("object is disposed.")), throw DisposedException(OUString("object is disposed."),
static_cast < XClipboardManager * > (this)); static_cast < XClipboardManager * > (this));
ClipboardMap::iterator iter = ClipboardMap::iterator iter =
@@ -115,13 +115,13 @@ void SAL_CALL ClipboardManager::addClipboard( const Reference< XClipboard >& xCl
// check parameter // check parameter
if (!xClipboard.is()) if (!xClipboard.is())
throw IllegalArgumentException(OUString(RTL_CONSTASCII_USTRINGPARAM("empty reference")), throw IllegalArgumentException(OUString("empty reference"),
static_cast < XClipboardManager * > (this), 1); static_cast < XClipboardManager * > (this), 1);
// the name "default" is reserved for internal use // the name "default" is reserved for internal use
OUString aName = xClipboard->getName(); OUString aName = xClipboard->getName();
if (m_aDefaultName.compareTo(aName) == 0) if (m_aDefaultName.compareTo(aName) == 0)
throw IllegalArgumentException(OUString(RTL_CONSTASCII_USTRINGPARAM("name reserved")), throw IllegalArgumentException(OUString("name reserved"),
static_cast < XClipboardManager * > (this), 1); static_cast < XClipboardManager * > (this), 1);
// try to add new clipboard to the list // try to add new clipboard to the list
@@ -164,7 +164,7 @@ Sequence< OUString > SAL_CALL ClipboardManager::listClipboardNames()
MutexGuard aGuard(m_aMutex); MutexGuard aGuard(m_aMutex);
if (rBHelper.bDisposed) if (rBHelper.bDisposed)
throw DisposedException(OUString(RTL_CONSTASCII_USTRINGPARAM("object is disposed.")), throw DisposedException(OUString("object is disposed."),
static_cast < XClipboardManager * > (this)); static_cast < XClipboardManager * > (this));
if (rBHelper.bInDispose) if (rBHelper.bInDispose)
@@ -253,7 +253,7 @@ Sequence< OUString > SAL_CALL ClipboardManager_getSupportedServiceNames()
{ {
Sequence < OUString > SupportedServicesNames( 1 ); Sequence < OUString > SupportedServicesNames( 1 );
SupportedServicesNames[0] = SupportedServicesNames[0] =
OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.ClipboardManager")); OUString("com.sun.star.datatransfer.clipboard.ClipboardManager");
return SupportedServicesNames; return SupportedServicesNames;
} }

View File

@@ -73,7 +73,7 @@ void SAL_CALL GenericClipboard::initialize( const Sequence< Any >& aArguments )
OUString SAL_CALL GenericClipboard::getImplementationName( ) OUString SAL_CALL GenericClipboard::getImplementationName( )
throw(RuntimeException) throw(RuntimeException)
{ {
return OUString(RTL_CONSTASCII_USTRINGPARAM(GENERIC_CLIPBOARD_IMPLEMENTATION_NAME)); return OUString(GENERIC_CLIPBOARD_IMPLEMENTATION_NAME);
} }
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
@@ -190,7 +190,7 @@ void SAL_CALL GenericClipboard::removeClipboardListener( const Reference< XClipb
Sequence< OUString > SAL_CALL GenericClipboard_getSupportedServiceNames() Sequence< OUString > SAL_CALL GenericClipboard_getSupportedServiceNames()
{ {
Sequence< OUString > aRet(1); Sequence< OUString > aRet(1);
aRet[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.GenericClipboard")); aRet[0] = OUString("com.sun.star.datatransfer.clipboard.GenericClipboard");
return aRet; return aRet;
} }

View File

@@ -232,7 +232,7 @@ private:
StringTransferable::StringTransferable( ) : StringTransferable::StringTransferable( ) :
m_seqDFlv( 1 ), m_seqDFlv( 1 ),
m_receivedLostOwnership( sal_False ), m_receivedLostOwnership( sal_False ),
m_Data( OUString(RTL_CONSTASCII_USTRINGPARAM("clipboard test content")) ) m_Data( OUString("clipboard test content") )
{ {
DataFlavor df; DataFlavor df;
@@ -244,7 +244,7 @@ StringTransferable::StringTransferable( ) :
*/ */
//df.MimeType = L"text/plain; charset=windows1252"; //df.MimeType = L"text/plain; charset=windows1252";
df.MimeType = OUString(RTL_CONSTASCII_USTRINGPARAM("text/html")); df.MimeType = OUString("text/html");
df.DataType = getCppuType( ( Sequence< sal_Int8 >* )0 ); df.DataType = getCppuType( ( Sequence< sal_Int8 >* )0 );
m_seqDFlv[0] = df; m_seqDFlv[0] = df;
@@ -355,10 +355,10 @@ int SAL_CALL main( int argc, const char* argv[] )
//-------------------------------------------------------------- //--------------------------------------------------------------
Sequence< Any > arguments(1); Sequence< Any > arguments(1);
arguments[0] = makeAny( OUString(RTL_CONSTASCII_USTRINGPARAM("generic")) ); arguments[0] = makeAny( OUString("generic") );
Reference< XClipboard > xClipboard( xServiceManager->createInstanceWithArguments( Reference< XClipboard > xClipboard( xServiceManager->createInstanceWithArguments(
OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.GenericClipboard")), OUString("com.sun.star.datatransfer.clipboard.GenericClipboard"),
arguments ), UNO_QUERY ); arguments ), UNO_QUERY );
ENSURE( xClipboard.is(), "*** ERROR *** generic clipboard service could not be created." ); ENSURE( xClipboard.is(), "*** ERROR *** generic clipboard service could not be created." );
@@ -438,7 +438,7 @@ int SAL_CALL main( int argc, const char* argv[] )
//-------------------------------------------------------------- //--------------------------------------------------------------
Reference< XClipboardManager > xClipboardManager( xServiceManager->createInstance( Reference< XClipboardManager > xClipboardManager( xServiceManager->createInstance(
OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.ClipboardManager")) ), UNO_QUERY ); OUString("com.sun.star.datatransfer.clipboard.ClipboardManager") ), UNO_QUERY );
ENSURE( xClipboardManager.is(), "*** ERROR *** clipboard manager service could not be created." ); ENSURE( xClipboardManager.is(), "*** ERROR *** clipboard manager service could not be created." );
@@ -451,14 +451,14 @@ int SAL_CALL main( int argc, const char* argv[] )
TEST( "initial number of clipboards (0): ", xClipboardManager->listClipboardNames().getLength() == 0 ); TEST( "initial number of clipboards (0): ", xClipboardManager->listClipboardNames().getLength() == 0 );
PERFORM( "insertion of generic clipboard: ", xClipboardManager->addClipboard( xClipboard ) ); PERFORM( "insertion of generic clipboard: ", xClipboardManager->addClipboard( xClipboard ) );
TEST( "number of inserted clipboards (1): ", xClipboardManager->listClipboardNames().getLength() == 1 ); TEST( "number of inserted clipboards (1): ", xClipboardManager->listClipboardNames().getLength() == 1 );
TEST( "name of inserted clipboard (generic): ", xClipboardManager->listClipboardNames()[0] == OUString(RTL_CONSTASCII_USTRINGPARAM("generic")) ); TEST( "name of inserted clipboard (generic): ", xClipboardManager->listClipboardNames()[0] == OUString("generic") );
TEST( "inserted clipboard instance: ", xClipboardManager->getClipboard( OUString(RTL_CONSTASCII_USTRINGPARAM("generic")) ) == xClipboard ); TEST( "inserted clipboard instance: ", xClipboardManager->getClipboard( OUString("generic") ) == xClipboard );
PERFORM( "removal of generic clipboard: ", xClipboardManager->removeClipboard( OUString(RTL_CONSTASCII_USTRINGPARAM("generic")) ) ); PERFORM( "removal of generic clipboard: ", xClipboardManager->removeClipboard( OUString("generic") ) );
TEST( "number of inserted clipboards (0): ", xClipboardManager->listClipboardNames().getLength() == 0 ); TEST( "number of inserted clipboards (0): ", xClipboardManager->listClipboardNames().getLength() == 0 );
TRACE( "Testing inserted clipboard instance (none): " ); TRACE( "Testing inserted clipboard instance (none): " );
try try
{ {
xClipboardManager->getClipboard( OUString(RTL_CONSTASCII_USTRINGPARAM("generic")) ); xClipboardManager->getClipboard( OUString("generic") );
TRACE( "FAILED\n" ); TRACE( "FAILED\n" );
} }
catch (const NoSuchElementException&) catch (const NoSuchElementException&)

View File

@@ -66,7 +66,7 @@ namespace
Sequence< OUString > SAL_CALL WinClipboard_getSupportedServiceNames() Sequence< OUString > SAL_CALL WinClipboard_getSupportedServiceNames()
{ {
Sequence< OUString > aRet(1); Sequence< OUString > aRet(1);
aRet[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.SystemClipboard")); aRet[0] = OUString("com.sun.star.datatransfer.clipboard.SystemClipboard");
return aRet; return aRet;
} }
} }
@@ -100,7 +100,7 @@ Reference< XTransferable > SAL_CALL CWinClipboard::getContents( ) throw( Runtime
MutexGuard aGuard( m_aMutex ); MutexGuard aGuard( m_aMutex );
if ( rBHelper.bDisposed ) if ( rBHelper.bDisposed )
throw DisposedException( OUString(RTL_CONSTASCII_USTRINGPARAM("object is already disposed")), throw DisposedException( OUString("object is already disposed"),
static_cast< XClipboardEx* >( this ) ); static_cast< XClipboardEx* >( this ) );
if ( NULL != m_pImpl.get( ) ) if ( NULL != m_pImpl.get( ) )
@@ -120,7 +120,7 @@ void SAL_CALL CWinClipboard::setContents( const Reference< XTransferable >& xTra
MutexGuard aGuard( m_aMutex ); MutexGuard aGuard( m_aMutex );
if ( rBHelper.bDisposed ) if ( rBHelper.bDisposed )
throw DisposedException( OUString(RTL_CONSTASCII_USTRINGPARAM("object is already disposed")), throw DisposedException( OUString("object is already disposed"),
static_cast< XClipboardEx* >( this ) ); static_cast< XClipboardEx* >( this ) );
if ( NULL != m_pImpl.get( ) ) if ( NULL != m_pImpl.get( ) )
@@ -134,13 +134,13 @@ void SAL_CALL CWinClipboard::setContents( const Reference< XTransferable >& xTra
OUString SAL_CALL CWinClipboard::getName( ) throw( RuntimeException ) OUString SAL_CALL CWinClipboard::getName( ) throw( RuntimeException )
{ {
if ( rBHelper.bDisposed ) if ( rBHelper.bDisposed )
throw DisposedException( OUString(RTL_CONSTASCII_USTRINGPARAM("object is already disposed")), throw DisposedException( OUString("object is already disposed"),
static_cast< XClipboardEx* >( this ) ); static_cast< XClipboardEx* >( this ) );
if ( NULL != m_pImpl.get( ) ) if ( NULL != m_pImpl.get( ) )
return m_pImpl->getName( ); return m_pImpl->getName( );
return OUString(RTL_CONSTASCII_USTRINGPARAM("")); return OUString("");
} }
//======================================================================== //========================================================================
@@ -152,7 +152,7 @@ void SAL_CALL CWinClipboard::flushClipboard( ) throw( RuntimeException )
MutexGuard aGuard( m_aMutex ); MutexGuard aGuard( m_aMutex );
if ( rBHelper.bDisposed ) if ( rBHelper.bDisposed )
throw DisposedException( OUString(RTL_CONSTASCII_USTRINGPARAM("object is already disposed")), throw DisposedException( OUString("object is already disposed"),
static_cast< XClipboardEx* >( this ) ); static_cast< XClipboardEx* >( this ) );
if ( NULL != m_pImpl.get( ) ) if ( NULL != m_pImpl.get( ) )
@@ -166,7 +166,7 @@ void SAL_CALL CWinClipboard::flushClipboard( ) throw( RuntimeException )
sal_Int8 SAL_CALL CWinClipboard::getRenderingCapabilities( ) throw( RuntimeException ) sal_Int8 SAL_CALL CWinClipboard::getRenderingCapabilities( ) throw( RuntimeException )
{ {
if ( rBHelper.bDisposed ) if ( rBHelper.bDisposed )
throw DisposedException( OUString(RTL_CONSTASCII_USTRINGPARAM("object is already disposed")), throw DisposedException( OUString("object is already disposed"),
static_cast< XClipboardEx* >( this ) ); static_cast< XClipboardEx* >( this ) );
if ( NULL != m_pImpl.get( ) ) if ( NULL != m_pImpl.get( ) )
@@ -187,12 +187,12 @@ void SAL_CALL CWinClipboard::addClipboardListener( const Reference< XClipboardLi
throw( RuntimeException ) throw( RuntimeException )
{ {
if ( rBHelper.bDisposed ) if ( rBHelper.bDisposed )
throw DisposedException( OUString(RTL_CONSTASCII_USTRINGPARAM("object is already disposed")), throw DisposedException( OUString("object is already disposed"),
static_cast< XClipboardEx* >( this ) ); static_cast< XClipboardEx* >( this ) );
// check input parameter // check input parameter
if ( !listener.is( ) ) if ( !listener.is( ) )
throw IllegalArgumentException( OUString(RTL_CONSTASCII_USTRINGPARAM("empty reference")), throw IllegalArgumentException( OUString("empty reference"),
static_cast< XClipboardEx* >( this ), static_cast< XClipboardEx* >( this ),
1 ); 1 );
@@ -207,12 +207,12 @@ void SAL_CALL CWinClipboard::removeClipboardListener( const Reference< XClipboar
throw( RuntimeException ) throw( RuntimeException )
{ {
if ( rBHelper.bDisposed ) if ( rBHelper.bDisposed )
throw DisposedException( OUString(RTL_CONSTASCII_USTRINGPARAM("object is already disposed")), throw DisposedException( OUString("object is already disposed"),
static_cast< XClipboardEx* >( this ) ); static_cast< XClipboardEx* >( this ) );
// check input parameter // check input parameter
if ( !listener.is( ) ) if ( !listener.is( ) )
throw IllegalArgumentException( OUString(RTL_CONSTASCII_USTRINGPARAM("empty reference")), throw IllegalArgumentException( OUString("empty reference"),
static_cast< XClipboardEx* >( this ), static_cast< XClipboardEx* >( this ),
1 ); 1 );
@@ -291,7 +291,7 @@ void SAL_CALL CWinClipboard::disposing()
OUString SAL_CALL CWinClipboard::getImplementationName( ) OUString SAL_CALL CWinClipboard::getImplementationName( )
throw(RuntimeException) throw(RuntimeException)
{ {
return OUString(RTL_CONSTASCII_USTRINGPARAM( WINCLIPBOARD_IMPL_NAME )); return OUString( WINCLIPBOARD_IMPL_NAME );
} }
// ------------------------------------------------- // -------------------------------------------------

View File

@@ -509,7 +509,7 @@ sal_Bool SAL_CALL CDOTransferable::compareDataFlavors(
if ( !m_rXMimeCntFactory.is( ) ) if ( !m_rXMimeCntFactory.is( ) )
{ {
m_rXMimeCntFactory = Reference< XMimeContentTypeFactory >( m_SrvMgr->createInstance( m_rXMimeCntFactory = Reference< XMimeContentTypeFactory >( m_SrvMgr->createInstance(
OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.MimeContentTypeFactory")) ), UNO_QUERY ); OUString("com.sun.star.datatransfer.MimeContentTypeFactory") ), UNO_QUERY );
} }
OSL_ASSERT( m_rXMimeCntFactory.is( ) ); OSL_ASSERT( m_rXMimeCntFactory.is( ) );

View File

@@ -75,11 +75,11 @@ const Type CPPUTYPE_OUSTRING = getCppuType((OUString*)0);
const Type CPPUTYPE_SEQSALINT8 = getCppuType((Sequence< sal_Int8>*)0); const Type CPPUTYPE_SEQSALINT8 = getCppuType((Sequence< sal_Int8>*)0);
const sal_Int32 MAX_CLIPFORMAT_NAME = 256; const sal_Int32 MAX_CLIPFORMAT_NAME = 256;
const OUString TEXT_PLAIN_CHARSET (RTL_CONSTASCII_USTRINGPARAM("text/plain;charset=")); const OUString TEXT_PLAIN_CHARSET ("text/plain;charset=");
const OUString HPNAME_OEM_ANSI_TEXT (RTL_CONSTASCII_USTRINGPARAM("OEM/ANSI Text")); const OUString HPNAME_OEM_ANSI_TEXT ("OEM/ANSI Text");
const OUString HTML_FORMAT_NAME_WINDOWS (RTL_CONSTASCII_USTRINGPARAM("HTML Format")); const OUString HTML_FORMAT_NAME_WINDOWS ("HTML Format");
const OUString HTML_FORMAT_NAME_SOFFICE (RTL_CONSTASCII_USTRINGPARAM("HTML (HyperText Markup Language)")); const OUString HTML_FORMAT_NAME_SOFFICE ("HTML (HyperText Markup Language"));
//------------------------------------------------------------------------ //------------------------------------------------------------------------
// //
@@ -89,7 +89,7 @@ CDataFormatTranslator::CDataFormatTranslator( const Reference< XMultiServiceFact
m_SrvMgr( aServiceManager ) m_SrvMgr( aServiceManager )
{ {
m_XDataFormatTranslator = Reference< XDataFormatTranslator >( m_XDataFormatTranslator = Reference< XDataFormatTranslator >(
m_SrvMgr->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.DataFormatTranslator")) ), UNO_QUERY ); m_SrvMgr->createInstance( OUString("com.sun.star.datatransfer.DataFormatTranslator") ), UNO_QUERY );
} }
//------------------------------------------------------------------------ //------------------------------------------------------------------------

View File

@@ -281,7 +281,7 @@ void SAL_CALL CFormatRegistrar::RegisterFormats(
aFormatEtcContainer.addFormatEtc( fetc ); aFormatEtcContainer.addFormatEtc( fetc );
// and HTML Format // and HTML Format
OUString htmlFormat( RTL_CONSTASCII_USTRINGPARAM("HTML Format") ); OUString htmlFormat( "HTML Format" );
aFormatEtcContainer.addFormatEtc( aFormatEtcContainer.addFormatEtc(
m_DataFormatTranslator.getFormatEtcForClipformatName( htmlFormat ) ); m_DataFormatTranslator.getFormatEtcForClipformatName( htmlFormat ) );
} }
@@ -359,8 +359,7 @@ OUString SAL_CALL CFormatRegistrar::getCharsetFromDataFlavor( const DataFlavor&
try try
{ {
Reference< XMimeContentTypeFactory > xMimeFac( Reference< XMimeContentTypeFactory > xMimeFac(
m_SrvMgr->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM( \ m_SrvMgr->createInstance( OUString( "com.sun.star.datatransfer.MimeContentTypeFactory" ) ), UNO_QUERY );
"com.sun.star.datatransfer.MimeContentTypeFactory" )) ), UNO_QUERY );
if( xMimeFac.is( ) ) if( xMimeFac.is( ) )
{ {

View File

@@ -455,7 +455,7 @@ void SAL_CALL CXTDataObject::renderSynthesizedHtmlAndSetupStgMedium( FORMATETC&
DataFlavor aFlavor; DataFlavor aFlavor;
// creating a DataFlavor on the fly // creating a DataFlavor on the fly
aFlavor.MimeType = OUString(RTL_CONSTASCII_USTRINGPARAM("text/html")); aFlavor.MimeType = OUString("text/html");
aFlavor.DataType = getCppuType( (Sequence< sal_Int8 >*)0 ); aFlavor.DataType = getCppuType( (Sequence< sal_Int8 >*)0 );
Any aAny = m_XTransferable->getTransferData( aFlavor ); Any aAny = m_XTransferable->getTransferData( aFlavor );

View File

@@ -55,10 +55,10 @@
#define CPPUTYPE_DEFAULT CPPUTYPE_SEQSALINT8 #define CPPUTYPE_DEFAULT CPPUTYPE_SEQSALINT8
#define CPPUTYPE_OUSTR getCppuType( (const ::rtl::OUString*) 0 ) #define CPPUTYPE_OUSTR getCppuType( (const ::rtl::OUString*) 0 )
#define CPPUTYPE_SALINT32 getCppuType( ( sal_Int32 * ) 0 ) #define CPPUTYPE_SALINT32 getCppuType( ( sal_Int32 * ) 0 )
#define OUSTR( str ) OUString(RTL_CONSTASCII_USTRINGPARAM( #str )) #define OUSTR( str ) OUString( #str )
#define EMPTY_OUSTR OUString() #define EMPTY_OUSTR OUString()
const rtl::OUString Windows_FormatName (RTL_CONSTASCII_USTRINGPARAM("windows_formatname")); const rtl::OUString Windows_FormatName ("windows_formatname");
const com::sun::star::uno::Type CppuType_ByteSequence = ::getCppuType((const com::sun::star::uno::Sequence<sal_Int8>*)0); const com::sun::star::uno::Type CppuType_ByteSequence = ::getCppuType((const com::sun::star::uno::Sequence<sal_Int8>*)0);
const com::sun::star::uno::Type CppuType_String = ::getCppuType((const ::rtl::OUString*)0); const com::sun::star::uno::Type CppuType_String = ::getCppuType((const ::rtl::OUString*)0);
@@ -84,7 +84,7 @@ namespace MODULE_PRIVATE
Sequence< OUString > SAL_CALL DataFormatTranslator_getSupportedServiceNames( ) Sequence< OUString > SAL_CALL DataFormatTranslator_getSupportedServiceNames( )
{ {
Sequence< OUString > aRet(1); Sequence< OUString > aRet(1);
aRet[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.DataFormatTranslator")); aRet[0] = OUString("com.sun.star.datatransfer.DataFormatTranslator");
return aRet; return aRet;
} }
} }
@@ -231,7 +231,7 @@ DataFlavor SAL_CALL CDataFormatTranslator::getDataFlavorFromSystemDataType( cons
OUString SAL_CALL CDataFormatTranslator::getImplementationName( ) OUString SAL_CALL CDataFormatTranslator::getImplementationName( )
throw( RuntimeException ) throw( RuntimeException )
{ {
return OUString(RTL_CONSTASCII_USTRINGPARAM( IMPL_NAME )); return OUString( IMPL_NAME );
} }
// ------------------------------------------------- // -------------------------------------------------

View File

@@ -163,7 +163,7 @@ private:
CTransferable::CTransferable( ) : CTransferable::CTransferable( ) :
m_FlavorList( 1 ), m_FlavorList( 1 ),
m_Data( OUString(RTL_CONSTASCII_USTRINGPARAM("Ich habe mir ein neues Fahrrad gekauft!")) ) m_Data( OUString("Ich habe mir ein neues Fahrrad gekauft!") )
{ {
DataFlavor df; DataFlavor df;
@@ -269,7 +269,7 @@ int SAL_CALL main( int nArgc, char* Argv[] )
// get the global service-manager // get the global service-manager
//------------------------------------------------- //-------------------------------------------------
OUString rdbName = OUString( RTL_CONSTASCII_USTRINGPARAM( RDB_SYSPATH ) ); OUString rdbName = OUString( RDB_SYSPATH );
Reference< XMultiServiceFactory > g_xFactory( createRegistryServiceFactory( rdbName ) ); Reference< XMultiServiceFactory > g_xFactory( createRegistryServiceFactory( rdbName ) );
// Print a message if an error occurred. // Print a message if an error occurred.

View File

@@ -53,7 +53,7 @@ void SAL_CALL DropTargetListener::drop( const DropTargetDropEvent& e )
{ {
e.Context->rejectDrop(); e.Context->rejectDrop();
DataFlavor flavor( OUString(OUString(RTL_CONSTASCII_USTRINGPARAM("text/plain;charset=windows-1252"))), DataFlavor flavor( OUString(OUString("text/plain;charset=windows-1252")),
OUString(L"Text plain"), getCppuType( ( Sequence<sal_Int8>*)0 ) ); OUString(L"Text plain"), getCppuType( ( Sequence<sal_Int8>*)0 ) );
Any anyData= e.Transferable->getTransferData( flavor); Any anyData= e.Transferable->getTransferData( flavor);

View File

@@ -251,8 +251,7 @@ m_rServiceFactory(r), m_bTerminated(sal_False), m_bError(sal_False)
OUString( OUString(
"com.sun.star.util.PathSubstitution" )), "com.sun.star.util.PathSubstitution" )),
UNO_QUERY); UNO_QUERY);
OUString aWorkingDir(subs->getSubstituteVariableValue(OUString( OUString aWorkingDir(subs->getSubstituteVariableValue(OUString( "$(progurl)")));
"$(progurl"))));
INetURLObject aObj(aWorkingDir); INetURLObject aObj(aWorkingDir);
aObj.setFinalSlash(); aObj.setFinalSlash();
bool bWasAbsolute; bool bWasAbsolute;

View File

@@ -133,7 +133,7 @@ static void getRuntimeImpl( PyRef & globalDict, PyRef &runtimeImpl )
PyThreadState * state = PyThreadState_Get(); PyThreadState * state = PyThreadState_Get();
if( ! state ) if( ! state )
{ {
throw RuntimeException( OUString( "python global interpreter must be held (thread must be attached" )), throw RuntimeException( OUString( "python global interpreter must be held (thread must be attached)" ),
Reference< XInterface > () ); Reference< XInterface > () );
} }
@@ -361,7 +361,7 @@ Runtime::Runtime() throw( RuntimeException )
{ {
throw RuntimeException( throw RuntimeException(
OUString( "pyuno runtime is not initialized, " OUString( "pyuno runtime is not initialized, "
"(the pyuno.bootstrap needs to be called before using any uno classes")), "(the pyuno.bootstrap needs to be called before using any uno classes)"),
Reference< XInterface > () ); Reference< XInterface > () );
} }
impl = reinterpret_cast< RuntimeImpl * > (runtime.get()); impl = reinterpret_cast< RuntimeImpl * > (runtime.get());

View File

@@ -171,8 +171,7 @@ lcl_initGenerator(SvXMLImport & rImport,
xPath->registerNS(GetXMLToken(XML_NP_OFFICE),GetXMLToken(XML_N_OFFICE)); xPath->registerNS(GetXMLToken(XML_NP_OFFICE),GetXMLToken(XML_N_OFFICE));
xPath->registerNS(GetXMLToken(XML_NP_META), GetXMLToken(XML_N_META)); xPath->registerNS(GetXMLToken(XML_NP_META), GetXMLToken(XML_N_META));
::rtl::OUString const expr( ::rtl::OUString const expr( "string(/office:document-meta/office:meta/meta:generator)");
"string(/office:document-meta/office:meta/meta:generator"));
uno::Reference< xml::xpath::XXPathObject > const xObj( uno::Reference< xml::xpath::XXPathObject > const xObj(
xPath->eval(xDoc.get(), expr), uno::UNO_SET_THROW); xPath->eval(xDoc.get(), expr), uno::UNO_SET_THROW);
OUString const value(xObj->getString()); OUString const value(xObj->getString());