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.heinisch@yahoo.de>
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 4db6f48..d2671d2 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;
}