summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-11-19 17:32:31 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2018-11-19 21:03:17 +0100
commitc13529cd2e20a0aca6f1d4cd0c85a36ab2f54afb (patch)
treeca75fba64a2e6b433a152a8289c19a118282ed8c /desktop
parent9cc6b8ebe366a909aa8406f26c6775554c65b439 (diff)
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@collabora.com>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/app/app.cxx25
-rw-r--r--desktop/source/app/officeipcthread.cxx14
-rw-r--r--desktop/source/app/sofficemain.cxx4
3 files changed, 3 insertions, 40 deletions
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) {