From f966b9e8bb2b5e7e563807d16088a9f3784f01fe Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Fri, 13 Aug 2021 15:37:49 +0200 Subject: bibliography, local URL: better starting directory when picking a new file Improve the case when we have no old file, so we can't take its old parent directory as a starting point in the file picker, opened by the browse button. It turns out both places that open that file picker have access to the base URL of the current document, so can open the directory of that instead. Change-Id: I4db84b6036771f48962d49ae5e4c46a99c306def Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120455 Reviewed-by: Miklos Vajna Tested-by: Jenkins --- sw/source/ui/index/swuiidxmrk.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sw/source/ui') diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx index 7b0787caf5ff..fb5ae141563c 100644 --- a/sw/source/ui/index/swuiidxmrk.cxx +++ b/sw/source/ui/index/swuiidxmrk.cxx @@ -1810,6 +1810,14 @@ IMPL_LINK(SwCreateAuthEntryDlg_Impl, BrowseHdl, weld::Button&, rButton, void) { aFileDlg.SetDisplayDirectory(aPath); } + else + { + OUString aBaseURL = rWrtSh.GetDoc()->GetDocShell()->getDocumentBaseURL(); + if (!aBaseURL.isEmpty()) + { + aFileDlg.SetDisplayDirectory(aBaseURL); + } + } if (aFileDlg.Execute() != ERRCODE_NONE) { -- cgit v1.2.3