[Libreoffice-commits] core.git: desktop/source include/vcl

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Nov 19 20:03:39 UTC 2018


 desktop/source/app/app.cxx             |   25 -------------------------
 desktop/source/app/officeipcthread.cxx |   14 +-------------
 desktop/source/app/sofficemain.cxx     |    4 ++--
 include/vcl/svapp.hxx                  |   16 ++++++----------
 4 files changed, 9 insertions(+), 50 deletions(-)

New commits:
commit c13529cd2e20a0aca6f1d4cd0c85a36ab2f54afb
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Mon Nov 19 17:32:31 2018 +0300
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Mon Nov 19 21:03:17 2018 +0100

    tdf#121498: also process --help/--version before VCL init on Win
    
    Otherwise they would be passed to the other running instance, and
    processed there, without outputting the data to the callng console
    
    Change-Id: I5cd9d11b567dfed06e19e9a2c4c29bc82868c064
    Reviewed-on: https://gerrit.libreoffice.org/63577
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index b74defb1f640..324f24e37970 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1256,25 +1256,6 @@ int Desktop::Main()
 
     CommandLineArgs& rCmdLineArgs = GetCommandLineArgs();
 
-#if HAVE_FEATURE_DESKTOP
-    const OUString& aUnknown( rCmdLineArgs.GetUnknown() );
-    if ( !aUnknown.isEmpty() )
-    {
-        displayCmdlineHelp( aUnknown );
-        return EXIT_FAILURE;
-    }
-    if ( rCmdLineArgs.IsHelp() )
-    {
-        displayCmdlineHelp( OUString() );
-        return EXIT_SUCCESS;
-    }
-    if ( rCmdLineArgs.IsVersion() )
-    {
-        displayVersion();
-        return EXIT_SUCCESS;
-    }
-#endif
-
     Translate::SetReadStringHook(ReplaceStringHookProc);
 
     // Startup screen
@@ -2341,12 +2322,6 @@ void Desktop::HandleAppEvent( const ApplicationEvent& rAppEvent )
             }
         }
         break;
-    case ApplicationEvent::Type::Help:
-        displayCmdlineHelp(rAppEvent.GetStringData());
-        break;
-    case ApplicationEvent::Type::Version:
-        displayVersion();
-        break;
     case ApplicationEvent::Type::Open:
         {
             const CommandLineArgs& rCmdLine = GetCommandLineArgs();
diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx
index 91a0b84fd940..92e5a65bb3b8 100644
--- a/desktop/source/app/officeipcthread.cxx
+++ b/desktop/source/app/officeipcthread.cxx
@@ -947,19 +947,7 @@ bool IpcThread::process(OString const & arguments, bool * waitProcessed) {
     bool bDocRequestSent = false;
 
     OUString aUnknown( aCmdLineArgs->GetUnknown() );
-    if ( !aUnknown.isEmpty() || aCmdLineArgs->IsHelp() )
-    {
-        ApplicationEvent* pAppEvent =
-            new ApplicationEvent(ApplicationEvent::Type::Help, aUnknown);
-        ImplPostForeignAppEvent( pAppEvent );
-    }
-    else if ( aCmdLineArgs->IsVersion() )
-    {
-        ApplicationEvent* pAppEvent =
-            new ApplicationEvent(ApplicationEvent::Type::Version);
-        ImplPostForeignAppEvent( pAppEvent );
-    }
-    else
+    if (aUnknown.isEmpty() && !aCmdLineArgs->IsHelp() && !aCmdLineArgs->IsVersion())
     {
         const CommandLineArgs &rCurrentCmdLineArgs = Desktop::GetCommandLineArgs();
 
diff --git a/desktop/source/app/sofficemain.cxx b/desktop/source/app/sofficemain.cxx
index 372598abdb9d..67bb08f48022 100644
--- a/desktop/source/app/sofficemain.cxx
+++ b/desktop/source/app/sofficemain.cxx
@@ -142,7 +142,7 @@ extern "C" int DESKTOP_DLLPUBLIC soffice_main()
     desktop::Desktop aDesktop;
     // This string is used during initialization of the Gtk+ VCL module
     Application::SetAppName( "soffice" );
-#ifdef UNX
+
     // handle --version and --help already here, otherwise they would be handled
     // after VCL initialization that might fail if $DISPLAY is not set
     const desktop::CommandLineArgs& rCmdLineArgs = desktop::Desktop::GetCommandLineArgs();
@@ -165,7 +165,7 @@ extern "C" int DESKTOP_DLLPUBLIC soffice_main()
         desktop::displayVersion();
         return EXIT_SUCCESS;
     }
-#endif
+
     return SVMain();
 #if defined ANDROID
     } catch (const css::uno::Exception &e) {
diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx
index 664f8ba8d56a..7e7d4c205299 100644
--- a/include/vcl/svapp.hxx
+++ b/include/vcl/svapp.hxx
@@ -128,8 +128,6 @@ public:
     enum class Type {
         Accept,                ///< Listen for connections
         Appear,                ///< Make application appear
-        Help,                  ///< Bring up help options (command-line help)
-        Version,               ///< Display product version
         Open,                  ///< Open a document
         OpenHelpUrl,           ///< Open a help URL
         Print,                 ///< Print document
@@ -141,29 +139,27 @@ public:
 
     /** Explicit constructor for ApplicationEvent.
 
-     @attention Type::Appear, Type::Version, Type::PrivateDoShutdown and
+     @attention Type::Appear, Type::PrivateDoShutdown and
         Type::QuickStart are the \em only events that don't need to include
         a data string with the event. No other events should use this
         constructor!
     */
     explicit ApplicationEvent(Type type): aEvent(type)
     {
-        assert(
-            type == Type::Appear || type == Type::Version
-            || type == Type::PrivateDoShutdown || type == Type::QuickStart);
+        assert(type == Type::Appear || type == Type::PrivateDoShutdown || type == Type::QuickStart);
     }
 
     /** Constructor for ApplicationEvent, accepts a string for the data
      associated with the event.
 
-     @attention Type::Accept, Type::Help, Type::OpenHelpUrl, Type::ShowDialog
+     @attention Type::Accept, Type::OpenHelpUrl, Type::ShowDialog
         and Type::Unaccept are the \em only events that accept a single
         string as event data. No other events should use this constructor!
     */
     ApplicationEvent(Type type, OUString const & data): aEvent(type)
     {
         assert(
-            type == Type::Accept || type == Type::Help || type == Type::OpenHelpUrl
+            type == Type::Accept || type == Type::OpenHelpUrl
             || type == Type::ShowDialog || type == Type::Unaccept);
         aData.push_back(data);
     }
@@ -193,14 +189,14 @@ public:
     /** Gets the application event's data string.
 
      @attention The \em only events that need a single string Type::Accept,
-        Type::Help, Type::OpenHelpUrl, Type::ShowDialog and Type::Unaccept
+        Type::OpenHelpUrl, Type::ShowDialog and Type::Unaccept
 
      @returns The event's data string.
     */
     OUString const & GetStringData() const
     {
         assert(
-            aEvent == Type::Accept || aEvent == Type::Help
+            aEvent == Type::Accept
             || aEvent == Type::OpenHelpUrl || aEvent == Type::ShowDialog
             || aEvent == Type::Unaccept);
         assert(aData.size() == 1);


More information about the Libreoffice-commits mailing list