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

Mike Kaganski mike.kaganski at collabora.com
Tue May 22 06:58:21 UTC 2018


 desktop/source/app/app.cxx |   24 ++++++++----------------
 1 file changed, 8 insertions(+), 16 deletions(-)

New commits:
commit c8c7f19073eb7c2697cfe78de9e708ddc714c42a
Author: Mike Kaganski <mike.kaganski at collabora.com>
Date:   Sun May 20 20:44:25 2018 +0300

    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 at libreoffice.org>
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

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 );


More information about the Libreoffice-commits mailing list