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 | |
parent | fb17dce09e29c4518129587d347cc3787f74c396 (diff) |
String->OUString, remove unused code
-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 | ||||
-rw-r--r-- | sfx2/source/appl/appdde.cxx | 36 | ||||
-rw-r--r-- | vcl/aqua/source/app/vclnsapp.mm | 18 | ||||
-rw-r--r-- | vcl/aqua/source/window/salmenu.cxx | 12 | ||||
-rw-r--r-- | vcl/inc/vcl/svapp.hxx | 114 | ||||
-rw-r--r-- | vcl/ios/source/app/vcluiapp.mm | 3 |
8 files changed, 95 insertions, 167 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 )); diff --git a/sfx2/source/appl/appdde.cxx b/sfx2/source/appl/appdde.cxx index 5dbbdd007e33..f7d3c0e22d9c 100644 --- a/sfx2/source/appl/appdde.cxx +++ b/sfx2/source/appl/appdde.cxx @@ -265,23 +265,33 @@ sal_Bool SfxAppEvent_Impl( ApplicationEvent &rAppEvent, aEvent += '('; if ( rCmd.CompareIgnoreCaseToAscii( aEvent, aEvent.Len() ) == COMPARE_EQUAL ) { - String aData( rCmd ); - aData.Erase( 0, aEvent.Len() ); - if ( aData.Len() > 2 ) + ::rtl::OUStringBuffer aData( rCmd ); + aData.remove( 0, aEvent.Len() ); + if ( aData.getLength() > 2 ) { // Transform into the ApplicationEvent Format - aData.Erase( aData.Len()-1, 1 ); - for ( sal_uInt16 n = 0; n < aData.Len(); ++n ) + aData.remove( aData.getLength() - 1, 1 ); + for ( sal_Int32 n = 0; n < aData.getLength(); ) { - if ( aData.GetChar(n) == 0x0022 ) // " = 22h - for ( ; aData.GetChar(++n) != 0x0022 ; ) - /* empty loop */ ; - else if ( aData.GetChar(n) == 0x0020 ) // SPACE = 20h - aData.SetChar(n, '\n'); + switch ( aData[n] == '"' ) + { + case '"': + aData.remove( n, 1 ); + while ( n < aData.getLength() && aData[n] != '"' ) + ++n; + if ( n < aData.getLength() ) + aData.remove( n, 1 ); + break; + case ' ': + aData[n++] = '\n'; + break; + default: + ++n; + break; + } } - aData.EraseAllChars( 0x0022 ); - ApplicationAddress aAddr; - rAppEvent = ApplicationEvent( String(), aAddr, U2S(rEvent), aData ); + + rAppEvent = ApplicationEvent(rEvent, aData.makeStringAndClear()); return sal_True; } } diff --git a/vcl/aqua/source/app/vclnsapp.mm b/vcl/aqua/source/app/vclnsapp.mm index 612aca6e37bb..e2da47c8bc5b 100644 --- a/vcl/aqua/source/app/vclnsapp.mm +++ b/vcl/aqua/source/app/vclnsapp.mm @@ -314,8 +314,7 @@ const rtl::OUString aFile( GetOUString( pFile ) ); if( ! AquaSalInstance::isOnCommandLine( aFile ) ) { - const ApplicationEvent* pAppEvent = new ApplicationEvent( String(), ApplicationAddress(), - APPEVENT_OPEN_STRING, aFile ); + const ApplicationEvent* pAppEvent = new ApplicationEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(APPEVENT_OPEN_STRING)), aFile); AquaSalInstance::aAppEventList.push_back( pAppEvent ); } return YES; @@ -335,7 +334,7 @@ if( ! AquaSalInstance::isOnCommandLine( aFile ) ) { if( aFileList.getLength() > 0 ) - aFileList.append( sal_Unicode( APPEVENT_PARAM_DELIMITER ) ); + aFileList.append('\n'); aFileList.append( aFile ); } } @@ -345,8 +344,7 @@ // we have no back channel here, we have to assume success, in which case // replyToOpenOrPrint does not need to be called according to documentation // [app replyToOpenOrPrint: NSApplicationDelegateReplySuccess]; - const ApplicationEvent* pAppEvent = new ApplicationEvent( String(), ApplicationAddress(), - APPEVENT_OPEN_STRING, aFileList.makeStringAndClear() ); + const ApplicationEvent* pAppEvent = new ApplicationEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(APPEVENT_OPEN_STRING)), aFileList.makeStringAndClear()); AquaSalInstance::aAppEventList.push_back( pAppEvent ); } } @@ -355,8 +353,7 @@ { (void)app; const rtl::OUString aFile( GetOUString( pFile ) ); - const ApplicationEvent* pAppEvent = new ApplicationEvent( String(), ApplicationAddress(), - APPEVENT_PRINT_STRING, aFile ); + const ApplicationEvent* pAppEvent = new ApplicationEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(APPEVENT_PRINT_STRING)), aFile); AquaSalInstance::aAppEventList.push_back( pAppEvent ); return YES; } @@ -374,11 +371,10 @@ while( (pFile = [it nextObject]) != nil ) { if( aFileList.getLength() > 0 ) - aFileList.append( sal_Unicode( APPEVENT_PARAM_DELIMITER ) ); + aFileList.append('\n'); aFileList.append( GetOUString( pFile ) ); } - const ApplicationEvent* pAppEvent = new ApplicationEvent( String(), ApplicationAddress(), - APPEVENT_PRINT_STRING, aFileList.makeStringAndClear() ); + const ApplicationEvent* pAppEvent = new ApplicationEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(APPEVENT_PRINT_STRING)), aFileList.makeStringAndClear()); AquaSalInstance::aAppEventList.push_back( pAppEvent ); // we have no back channel here, we have to assume success // correct handling would be NSPrintingReplyLater and then send [app replyToOpenOrPrint] @@ -402,7 +398,7 @@ if( aReply == NSTerminateNow ) { - ApplicationEvent aEv( String(), ApplicationAddress(), ByteString( "PRIVATE:DOSHUTDOWN" ), String() ); + ApplicationEvent aEv(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PRIVATE:DOSHUTDOWN"))); GetpApp()->AppEvent( aEv ); ImplImageTreeSingletonRef()->shutDown(); // DeInitVCL should be called in ImplSVMain - unless someon _exits first which diff --git a/vcl/aqua/source/window/salmenu.cxx b/vcl/aqua/source/window/salmenu.cxx index d719ec5405b4..50aa9a673ed5 100644 --- a/vcl/aqua/source/window/salmenu.cxx +++ b/vcl/aqua/source/window/salmenu.cxx @@ -69,15 +69,13 @@ const AquaSalMenu* AquaSalMenu::pCurrentMenuBar = NULL; } else { - String aDialog; + rtl::OUString aDialog; if( nDialog == SHOWDIALOG_ID_ABOUT ) - aDialog = String( RTL_CONSTASCII_USTRINGPARAM( "ABOUT" ) ); + aDialog = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ABOUT")); else if( nDialog == SHOWDIALOG_ID_PREFERENCES ) - aDialog = String( RTL_CONSTASCII_USTRINGPARAM( "PREFERENCES" ) ); - const ApplicationEvent* pAppEvent = new ApplicationEvent( String(), - ApplicationAddress(), - ByteString( "SHOWDIALOG" ), - aDialog ); + aDialog = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PREFERENCES")); + const ApplicationEvent* pAppEvent = new ApplicationEvent( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SHOWDIALOG")), aDialog); AquaSalInstance::aAppEventList.push_back( pAppEvent ); } } diff --git a/vcl/inc/vcl/svapp.hxx b/vcl/inc/vcl/svapp.hxx index 1cc0a404b19c..fb32a8ba245c 100644 --- a/vcl/inc/vcl/svapp.hxx +++ b/vcl/inc/vcl/svapp.hxx @@ -97,105 +97,37 @@ typedef long (*VCLEventHookProc)( NotifyEvent& rEvt, void* pData ); enum Service { SERVICE_OLE, SERVICE_APPEVENT, SERVICE_IPC }; #endif -class VCL_DLLPUBLIC ApplicationAddress -{ -friend class Application; -protected: - UniString aHostName; - UniString aDisplayName; - UniString aDomainName; - int nPID; - -public: - ApplicationAddress(); - ApplicationAddress( const UniString& rDomain ); - ApplicationAddress( const UniString& rHost, - const UniString& rDisp, - const UniString& rDomain ); - ApplicationAddress( const UniString& rHost, int nPID ); - - const UniString& GetHost() const { return aHostName; } - const UniString& GetDisplay() const { return aDisplayName; } - const UniString& GetDomain() const { return aDomainName; } - int GetPID() const { return nPID; } - - sal_Bool IsConnectToSame( const ApplicationAddress& rAdr ) const; -}; - -inline ApplicationAddress::ApplicationAddress() -{ - nPID = 0; -} - -inline ApplicationAddress::ApplicationAddress( const UniString& rDomain ) -{ - aDomainName = rDomain; - nPID = 0; -} - -inline ApplicationAddress::ApplicationAddress( const UniString& rHost, - const UniString& rDisp, - const UniString& rDomain ) -{ - aHostName = rHost; - aDisplayName = rDisp; - aDomainName = rDomain; - nPID = 0; -} - -inline ApplicationAddress::ApplicationAddress( const UniString& rHost, int nPIDPar ) -{ - aHostName = rHost; - nPID = nPIDPar; -} - -inline sal_Bool ApplicationAddress::IsConnectToSame( const ApplicationAddress& rAdr ) const -{ - if ( nPID && ((nPID == rAdr.nPID) && (aHostName.Equals( rAdr.aHostName))) ) - return sal_True; - else - return sal_False; -} - -#define APPEVENT_PARAM_DELIMITER '\n' - #define APPEVENT_OPEN_STRING "Open" #define APPEVENT_PRINT_STRING "Print" class VCL_DLLPUBLIC ApplicationEvent { -private: - UniString aSenderAppName; // Absender Applikationsname - rtl::OString m_aEvent; // Event - UniString aData; // Uebertragene Daten - ApplicationAddress aAppAddr; // Absender Addresse + rtl::OUString aEvent; + rtl::OUString aData; + std::vector<rtl::OUString> aParams; + ApplicationEvent(); public: - ApplicationEvent() {} - ApplicationEvent( const UniString& rSenderAppName, - const ApplicationAddress& rAppAddr, - const rtl::OString& rEvent, - const UniString& rData ); - - const UniString& GetSenderAppName() const { return aSenderAppName; } - const rtl::OString& GetEvent() const { return m_aEvent; } - const UniString& GetData() const { return aData; } - const ApplicationAddress& GetAppAddress() const { return aAppAddr; } - - sal_uInt16 GetParamCount() const { return aData.GetTokenCount( APPEVENT_PARAM_DELIMITER ); } - UniString GetParam( sal_uInt16 nParam ) const { return aData.GetToken( nParam, APPEVENT_PARAM_DELIMITER ); } -}; + ApplicationEvent(const rtl::OUString& rEvent, + const rtl::OUString& rData = rtl::OUString()): + aEvent(rEvent), + aData(rData) + { + sal_Int32 start = 0; + for(sal_Int32 i = 0; i < rData.getLength(); ++i) + { + if(rData[i] == '\n') + { + aParams.push_back(rData.copy(start, i - start)); + start = ++i; + } + } + } -inline ApplicationEvent::ApplicationEvent( const UniString& rSenderAppName, - const ApplicationAddress& rAppAddr, - const rtl::OString& rEvent, - const UniString& rData ) : - aSenderAppName( rSenderAppName ), - m_aEvent( rEvent ), - aData( rData ), - aAppAddr( rAppAddr ) -{ -} + const rtl::OUString& GetEvent() const { return aEvent; } + const rtl::OUString& GetData() const { return aData; } + const std::vector<rtl::OUString>& GetParams() const { return aParams; } +}; class VCL_DLLPUBLIC PropertyHandler { diff --git a/vcl/ios/source/app/vcluiapp.mm b/vcl/ios/source/app/vcluiapp.mm index c7461d9f6b85..c47669e69138 100644 --- a/vcl/ios/source/app/vcluiapp.mm +++ b/vcl/ios/source/app/vcluiapp.mm @@ -79,8 +79,7 @@ // we have no back channel here, we have to assume success, in which case // replyToOpenOrPrint does not need to be called according to documentation // [app replyToOpenOrPrint: NSApplicationDelegateReplySuccess]; - const ApplicationEvent* pAppEvent = new ApplicationEvent( String(), ApplicationAddress(), - APPEVENT_OPEN_STRING, aFileList.makeStringAndClear() ); + const ApplicationEvent* pAppEvent = new ApplicationEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(APPEVENT_OPEN_STRING)), aFileList.makeStringAndClear()); IosSalInstance::aAppEventList.push_back( pAppEvent ); } } |