diff options
author | August Sodora <augsod@gmail.com> | 2011-11-03 16:50:24 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2011-11-04 08:21:25 +0100 |
commit | e04249337551653f63ba9b2a2302578961e38562 (patch) | |
tree | c8780254acf0b87c16f47725657a0b8c38871bfe /desktop | |
parent | fb17dce09e29c4518129587d347cc3787f74c396 (diff) |
String->OUString, remove unused code
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/app/app.cxx | 43 | ||||
-rw-r--r-- | desktop/source/app/cmdlineargs.cxx | 8 | ||||
-rw-r--r-- | desktop/source/app/officeipcthread.cxx | 28 |
3 files changed, 36 insertions, 43 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index be33faca1b9e..00850aae039c 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -2990,7 +2990,7 @@ String GetURL_Impl( void Desktop::HandleAppEvent( const ApplicationEvent& rAppEvent ) { - if ( rAppEvent.GetEvent() == "APPEAR" && !GetCommandLineArgs().IsInvisible() ) + if ( rAppEvent.GetEvent() == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("APPEAR")) && !GetCommandLineArgs().IsInvisible() ) { css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory(); @@ -3046,7 +3046,7 @@ void Desktop::HandleAppEvent( const ApplicationEvent& rAppEvent ) } } } - else if ( rAppEvent.GetEvent() == "QUICKSTART" && !GetCommandLineArgs().IsInvisible() ) + else if ( rAppEvent.GetEvent() == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("QUICKSTART")) && !GetCommandLineArgs().IsInvisible() ) { // If the office has been started the second time its command line arguments are sent through a pipe // connection to the first office. We want to reuse the quickstart option for the first office. @@ -3063,57 +3063,50 @@ void Desktop::HandleAppEvent( const ApplicationEvent& rAppEvent ) if ( xQuickstart.is() ) xQuickstart->initialize( aSeq ); } - else if ( rAppEvent.GetEvent() == "ACCEPT" ) + else if ( rAppEvent.GetEvent() == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ACCEPT")) ) { // every time an accept parameter is used we create an acceptor // with the corresponding accept-string - OUString aAcceptString(rAppEvent.GetData().GetBuffer()); - createAcceptor(aAcceptString); + createAcceptor(rAppEvent.GetData()); } - else if ( rAppEvent.GetEvent() == "UNACCEPT" ) + else if ( rAppEvent.GetEvent() == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UNACCEPT")) ) { // try to remove corresponding acceptor - OUString aUnAcceptString(rAppEvent.GetData().GetBuffer()); - destroyAcceptor(aUnAcceptString); + destroyAcceptor(rAppEvent.GetData()); } - else if ( rAppEvent.GetEvent() == "SaveDocuments" ) + else if ( rAppEvent.GetEvent() == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SaveDocuments")) ) { Desktop::_bTasksSaved = sal_False; Desktop::_bTasksSaved = SaveTasks(); } - else if ( rAppEvent.GetEvent() == "OPENHELPURL" ) + else if ( rAppEvent.GetEvent() == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OPENHELPURL")) ) { // start help for a specific URL - OUString aHelpURL(rAppEvent.GetData().GetBuffer()); Help *pHelp = Application::GetHelp(); - pHelp->Start(aHelpURL, NULL); + pHelp->Start(rAppEvent.GetData(), NULL); } - else if ( rAppEvent.GetEvent() == APPEVENT_OPEN_STRING ) + else if ( rAppEvent.GetEvent() == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(APPEVENT_OPEN_STRING)) ) { - OUString aOpenURL(rAppEvent.GetData().GetBuffer()); - const CommandLineArgs& rCmdLine = GetCommandLineArgs(); if ( !rCmdLine.IsInvisible() && !rCmdLine.IsTerminateAfterInit() ) { ProcessDocumentsRequest* pDocsRequest = new ProcessDocumentsRequest( rCmdLine.getCwdUrl()); - pDocsRequest->aOpenList = aOpenURL; + pDocsRequest->aOpenList = rAppEvent.GetData(); pDocsRequest->pcProcessed = NULL; OfficeIPCThread::ExecuteCmdLineRequests( *pDocsRequest ); delete pDocsRequest; } } - else if ( rAppEvent.GetEvent() == APPEVENT_PRINT_STRING ) + else if ( rAppEvent.GetEvent() == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(APPEVENT_PRINT_STRING)) ) { - OUString aPrintURL(rAppEvent.GetData().GetBuffer()); - const CommandLineArgs& rCmdLine = GetCommandLineArgs(); if ( !rCmdLine.IsInvisible() && !rCmdLine.IsTerminateAfterInit() ) { ProcessDocumentsRequest* pDocsRequest = new ProcessDocumentsRequest( rCmdLine.getCwdUrl()); - pDocsRequest->aPrintList = aPrintURL; + pDocsRequest->aPrintList = rAppEvent.GetData(); pDocsRequest->pcProcessed = NULL; OfficeIPCThread::ExecuteCmdLineRequests( *pDocsRequest ); @@ -3121,13 +3114,13 @@ void Desktop::HandleAppEvent( const ApplicationEvent& rAppEvent ) } } #ifndef UNX - else if ( rAppEvent.GetEvent() == "HELP" ) + else if ( rAppEvent.GetEvent() == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HELP")) ) { // in non unix version allow showing of cmdline help window displayCmdlineHelp(); } #endif - else if ( rAppEvent.GetEvent() == "SHOWDIALOG" ) + else if ( rAppEvent.GetEvent() == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SHOWDIALOG")) ) { // ignore all errors here. It's clicking a menu entry only ... // The user will try it again, in case nothing happens .-) @@ -3145,9 +3138,9 @@ void Desktop::HandleAppEvent( const ApplicationEvent& rAppEvent ) css::uno::Reference< css::util::XURLTransformer > xParser(xSMGR->createInstance(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), css::uno::UNO_QUERY_THROW); css::util::URL aCommand; - if( rAppEvent.GetData().EqualsAscii( "PREFERENCES" ) ) + if( rAppEvent.GetData() == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PREFERENCES")) ) aCommand.Complete = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:OptionsTreeDialog" ) ); - else if( rAppEvent.GetData().EqualsAscii( "ABOUT" ) ) + else if( rAppEvent.GetData() == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ABOUT")) ) aCommand.Complete = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:About" ) ); if( aCommand.Complete.getLength() ) { @@ -3161,7 +3154,7 @@ void Desktop::HandleAppEvent( const ApplicationEvent& rAppEvent ) catch(const css::uno::Exception&) {} } - else if( rAppEvent.GetEvent() == "PRIVATE:DOSHUTDOWN" ) + else if( rAppEvent.GetEvent() == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PRIVATE:DOSHUTDOWN")) ) { Desktop* pD = dynamic_cast<Desktop*>(GetpApp()); OSL_ENSURE( pD, "no desktop ?!?" ); diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx index f2555623c560..78c6e719e8d7 100644 --- a/desktop/source/app/cmdlineargs.cxx +++ b/desktop/source/app/cmdlineargs.cxx @@ -399,10 +399,12 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier ) void CommandLineArgs::AddStringListParam_Impl( StringParam eParam, const rtl::OUString& aParam ) { + ::rtl::OUStringBuffer aParamBuf(m_aStrParams[eParam]); OSL_ASSERT( eParam >= 0 && eParam < CMD_STRINGPARAM_COUNT ); - if ( m_aStrParams[eParam].getLength() ) - m_aStrParams[eParam] += ::rtl::OUString::valueOf( (sal_Unicode)APPEVENT_PARAM_DELIMITER ); - m_aStrParams[eParam] += aParam; + if ( aParamBuf.getLength() ) + aParamBuf.append('\n'); + aParamBuf.append(aParam); + m_aStrParams[eParam] = aParamBuf.makeStringAndClear(); m_aStrSetParams[eParam] = sal_True; } diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx index 9d1ea0fe57bc..af30005d42d9 100644 --- a/desktop/source/app/officeipcthread.cxx +++ b/desktop/source/app/officeipcthread.cxx @@ -634,9 +634,11 @@ OfficeIPCThread::~OfficeIPCThread() static void AddURLToStringList( const rtl::OUString& aURL, rtl::OUString& aStringList ) { - if ( aStringList.getLength() ) - aStringList += ::rtl::OUString::valueOf( (sal_Unicode)APPEVENT_PARAM_DELIMITER ); - aStringList += aURL; + ::rtl::OUStringBuffer aStringListBuf(aStringList); + if ( aStringListBuf.getLength() ) + aStringListBuf.append('\n'); + aStringListBuf.append(aURL); + aStringList = aStringListBuf.makeStringAndClear(); } void OfficeIPCThread::SetReady(OfficeIPCThread* pThread) @@ -713,8 +715,7 @@ void SAL_CALL OfficeIPCThread::run() { // we have to use application event, because we have to start quickstart service in main thread!! ApplicationEvent* pAppEvent = - new ApplicationEvent( aEmpty, aEmpty, - "QUICKSTART", aEmpty ); + new ApplicationEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("QUICKSTART"))); ImplPostForeignAppEvent( pAppEvent ); } @@ -722,16 +723,14 @@ void SAL_CALL OfficeIPCThread::run() OUString aAcceptString; if ( aCmdLineArgs->GetAcceptString(aAcceptString) ) { ApplicationEvent* pAppEvent = - new ApplicationEvent( aEmpty, aEmpty, - "ACCEPT", aAcceptString ); + new ApplicationEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ACCEPT")), aAcceptString); ImplPostForeignAppEvent( pAppEvent ); } // handle acceptor removal OUString aUnAcceptString; if ( aCmdLineArgs->GetUnAcceptString(aUnAcceptString) ) { ApplicationEvent* pAppEvent = - new ApplicationEvent( aEmpty, aEmpty, - "UNACCEPT", aUnAcceptString ); + new ApplicationEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UNACCEPT")), aUnAcceptString); ImplPostForeignAppEvent( pAppEvent ); } @@ -740,7 +739,7 @@ void SAL_CALL OfficeIPCThread::run() // in a running instance in order to display the command line help if ( aCmdLineArgs->IsHelp() ) { ApplicationEvent* pAppEvent = - new ApplicationEvent( aEmpty, aEmpty, "HELP", aEmpty ); + new ApplicationEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HELP"))); ImplPostForeignAppEvent( pAppEvent ); } #endif @@ -839,8 +838,7 @@ void SAL_CALL OfficeIPCThread::run() aHelpURLBuffer.appendAscii("&System=WIN"); #endif ApplicationEvent* pAppEvent = - new ApplicationEvent( aEmpty, aEmpty, - "OPENHELPURL", aHelpURLBuffer.makeStringAndClear()); + new ApplicationEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OPENHELPURL")), aHelpURLBuffer.makeStringAndClear()); ImplPostForeignAppEvent( pAppEvent ); } } @@ -878,7 +876,7 @@ void SAL_CALL OfficeIPCThread::run() { // no document was sent, just bring Office to front ApplicationEvent* pAppEvent = - new ApplicationEvent( aEmpty, aEmpty, "APPEAR", aEmpty ); + new ApplicationEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("APPEAR"))); ImplPostForeignAppEvent( pAppEvent ); } @@ -919,7 +917,7 @@ static void AddToDispatchList( sal_Int32 nIndex = 0; do { - OUString aToken = aRequestList.getToken( 0, APPEVENT_PARAM_DELIMITER, nIndex ); + OUString aToken = aRequestList.getToken( 0, '\n', nIndex ); if ( aToken.getLength() > 0 ) rDispatchList.push_back( DispatchWatcher::DispatchRequest( nType, aToken, cwdUrl, aParam, aFactory )); @@ -974,7 +972,7 @@ static void AddConversionsToDispatchList( sal_Int32 nIndex = 0; do { - OUString aToken = rRequestList.getToken( 0, APPEVENT_PARAM_DELIMITER, nIndex ); + OUString aToken = rRequestList.getToken( 0, '\n', nIndex ); if ( aToken.getLength() > 0 ) rDispatchList.push_back( DispatchWatcher::DispatchRequest( nType, aToken, cwdUrl, aParam, rFactory )); |