diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2018-05-20 20:44:25 +0300 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-05-22 08:58:00 +0200 |
commit | c8c7f19073eb7c2697cfe78de9e708ddc714c42a (patch) | |
tree | 41bbfea18de7d09c8e8dce6269f1d0e107a9531a /desktop | |
parent | 059872b47ed957e847a3fe63bd35793ba93c4c32 (diff) |
Really don't show empty Writer document on cancelled recovery
Commit b5ad981518f4407243f89507b2561dd0b1ef28ee tried to make that,
but either didn't work on all platforms, or was broken later. Then,
commit fbe9accf36ac4c52ef5bcb84d455b4d06c317668 handled one special
case.
The problem is that cancelling recovery returns false. It's unclear
why the distinction should be done for the cancelled recovery case:
in any case, if the recovery has opened some documents, it will be
handled in the code that enumerates frames ("no default document if
a document was loaded by recovery..." comment). In other cases, we
need to honour user command line parameters (selected module), and
if none is specified, do the global default, which is currently to
show Start Center. So - let the OpenDefault() do just that.
Change-Id: I90f3581fc72628d1317e97074a4a1d352d630c7e
Reviewed-on: https://gerrit.libreoffice.org/54604
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/app/app.cxx | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 27fb9aa036bc..22092bac9760 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -1972,10 +1972,6 @@ IMPL_LINK_NOARG(Desktop, OpenClients_Impl, void*, void) void Desktop::OpenClients() { - // check if a document has been recovered - if there is one of if a document was loaded by cmdline, no default document - // should be created - bool bRecovery = false; - const CommandLineArgs& rArgs = GetCommandLineArgs(); if (!rArgs.IsQuickstart()) @@ -2070,7 +2066,7 @@ void Desktop::OpenClients() { try { - bRecovery = impl_callRecoveryUI( + impl_callRecoveryUI( false , // false => force recovery instead of emergency save bExistsRecoveryData); } @@ -2079,9 +2075,6 @@ void Desktop::OpenClients() SAL_WARN( "desktop.app", "Error during recovery" << e); } } - else if (bExistsRecoveryData && bDisableRecovery && !rArgs.HasModuleParam()) - // prevent new Writer doc - bRecovery = true; Reference< XSessionManagerListener2 > xSessionListener; try @@ -2188,14 +2181,7 @@ void Desktop::OpenClients() // soffice was started as tray icon ... return; - if ( bRecovery ) - { - ShowBackingComponent(nullptr); - } - else - { - OpenDefault(); - } + OpenDefault(); } void Desktop::OpenDefault() @@ -2228,6 +2214,12 @@ void Desktop::OpenDefault() if ( aName.isEmpty() ) { + if (aOpt.IsModuleInstalled(SvtModuleOptions::EModule::STARTMODULE)) + { + ShowBackingComponent(nullptr); + return; + } + // Old way to create a default document if ( aOpt.IsModuleInstalled( SvtModuleOptions::EModule::WRITER ) ) aName = aOpt.GetFactoryEmptyDocumentURL( SvtModuleOptions::EFactory::WRITER ); |