mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 19:07:45 +00:00
Do not allow the manual insertion of a directory (without filename) into the import dialog and thus prevent an assertion.
Fixes: #7437(cherry picked from commit afd897029917a083fbeb84cccd4e6cb0a21db7ed)
This commit is contained in:
parent
9fef2346d6
commit
2c88e6ab2f
@ -2108,6 +2108,18 @@ void GuiView::importDocument(string const & argument)
|
|||||||
// get absolute path of file
|
// get absolute path of file
|
||||||
FileName const fullname(support::makeAbsPath(filename));
|
FileName const fullname(support::makeAbsPath(filename));
|
||||||
|
|
||||||
|
// Can happen if the user entered a path into the dialog
|
||||||
|
// (see bug #7437)
|
||||||
|
if (fullname.onlyFileName().empty()) {
|
||||||
|
docstring msg = bformat(_("The file name '%1$s' is invalid!\n"
|
||||||
|
"Aborting import."),
|
||||||
|
from_utf8(fullname.absFileName()));
|
||||||
|
frontend::Alert::error(_("File name error"), msg);
|
||||||
|
message(_("Canceled."));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
FileName const lyxfile(support::changeExtension(fullname.absFileName(), ".lyx"));
|
FileName const lyxfile(support::changeExtension(fullname.absFileName(), ".lyx"));
|
||||||
|
|
||||||
// Check if the document already is open
|
// Check if the document already is open
|
||||||
|
@ -98,6 +98,8 @@ What's new
|
|||||||
|
|
||||||
- Fix hang when selecting text (bug 8837).
|
- Fix hang when selecting text (bug 8837).
|
||||||
|
|
||||||
|
- Fix assertion when entering a path into the import dialog (bug 7437).
|
||||||
|
|
||||||
- Fix math-ams-matrix function that could corrupt documents if not used properly
|
- Fix math-ams-matrix function that could corrupt documents if not used properly
|
||||||
(part of bug 8359).
|
(part of bug 8359).
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user