Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


Hello,

It seems to me that class ApplicationAddress in vcl/svapp.hxx is
unused and that ApplicationEvent has two useless fields, one for the
application address and another string that is always empty and never
compared against or modified. I've attached a patch that cleans this
up a little bit and switches from String to rtl::OUString but
unfortunately I cannot compile the code that is in aqua, etc. Does
someone who has this capability mind building this and making sure
that nothing broke in those few areas?

August Sodora
augsod@gmail.com
(201) 280-8138
From 685b21b2f3826e0953d15ddba928699140e26a75 Mon Sep 17 00:00:00 2001
From: August Sodora <augsod@gmail.com>
Date: Wed, 2 Nov 2011 20:35:19 -0400
Subject: [PATCH] String->OUString, remove unused code

---
 desktop/source/app/app.cxx             |   43 +++++-------
 desktop/source/app/cmdlineargs.cxx     |    8 ++-
 desktop/source/app/officeipcthread.cxx |   28 ++++----
 sfx2/source/appl/appdde.cxx            |   24 +++----
 vcl/aqua/source/app/vclnsapp.mm        |   14 ++---
 vcl/inc/vcl/svapp.hxx                  |  114 +++++++-------------------------
 vcl/ios/source/app/vcluiapp.mm         |    3 +-
 7 files changed, 76 insertions(+), 158 deletions(-)

diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index be33fac..00850aa 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 f255562..78c6e71 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 9d1ea0f..af30005 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 5dbbdd0..ff9adf5 100644
--- a/sfx2/source/appl/appdde.cxx
+++ b/sfx2/source/appl/appdde.cxx
@@ -265,23 +265,21 @@ 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 = aData.getLength(); n >= 0; --n )
             {
-                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');
+                if ( aData[n] == 0x0020 ) // SPACE = 20h
+                    aData[n] = '\n';
+                else if( aData[n] == 0x0022 )
+                    aData.remove( n, 1 );
             }
-            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 612aca6..5a4dfaa 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;
@@ -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;
 }
@@ -377,8 +374,7 @@
             aFileList.append( sal_Unicode( APPEVENT_PARAM_DELIMITER ) );
         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/inc/vcl/svapp.hxx b/vcl/inc/vcl/svapp.hxx
index 1cc0a40..fb32a8b 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 c7461d9..c47669e 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 );
     }
 }
-- 
1.7.4.4


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.