summaryrefslogtreecommitdiff
path: root/sw/source/ui/index/swuiidxmrk.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2021-08-13 15:37:49 +0200
committerMiklos Vajna <vmiklos@collabora.com>2021-08-13 18:31:11 +0200
commitf966b9e8bb2b5e7e563807d16088a9f3784f01fe (patch)
tree54fb9125060f4f36b062444bc29757039f1c308d /sw/source/ui/index/swuiidxmrk.cxx
parentc69aadfec031535c5b6266dcb97d40225f40eb9b (diff)
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 <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sw/source/ui/index/swuiidxmrk.cxx')
-rw-r--r--sw/source/ui/index/swuiidxmrk.cxx8
1 files changed, 8 insertions, 0 deletions
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)
{