sw/source/ui/index/cnttab.cxx |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 66e48719c0a58508d75c0204531513541ae6db09
Author:     Andreas Heinisch <andreas.heini...@yahoo.de>
AuthorDate: Sun Nov 20 11:35:03 2022 +0100
Commit:     Andreas Heinisch <andreas.heini...@yahoo.de>
CommitDate: Tue Nov 22 09:01:07 2022 +0100

    tdf#120405 - Use previously selected file, if selection is aborted
    
    If a user aborts the selection of a concordance file, use the previously 
selected one, if it exists.
    
    Change-Id: I55547ca98034269e897d6bc86ccc4dcfd63be9fd
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142997
    Tested-by: Jenkins
    Reviewed-by: Andreas Heinisch <andreas.heini...@yahoo.de>

diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 4db6f48abcbf..d2671d2dd664 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -102,10 +102,16 @@ static OUString lcl_CreateAutoMarkFileDlg(weld::Window* 
pParent, const OUString&
         xFP->setDisplayDirectory( aPathOpt.GetUserConfigPath() );
     }
 
-    if( aDlgHelper.Execute() == ERRCODE_NONE )
+    const ErrCode aErrCode = aDlgHelper.Execute();
+    if (aErrCode == ERRCODE_NONE)
     {
         sRet = xFP->getSelectedFiles().getConstArray()[0];
     }
+    // tdf#120405 - use previously selected file, if selection is aborted
+    else if (aErrCode == ERRCODE_ABORT && !rURL.isEmpty())
+    {
+        sRet = rURL;
+    }
 
     return sRet;
 }

Reply via email to