mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-07 12:32:26 +00:00
Fix loop when trying to export a read-only document
This commit is contained in:
parent
56ca770e79
commit
5686ad11f3
@ -3307,12 +3307,16 @@ void GuiView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
|
|||||||
case LFUN_BUFFER_EXPORT: {
|
case LFUN_BUFFER_EXPORT: {
|
||||||
if (!doc_buffer)
|
if (!doc_buffer)
|
||||||
break;
|
break;
|
||||||
|
FileName target_dir = doc_buffer->fileName().onlyPath();
|
||||||
|
string const dest = cmd.getArg(1);
|
||||||
|
if (!dest.empty() && FileName::isAbsolute(dest))
|
||||||
|
target_dir = FileName(support::onlyPath(dest));
|
||||||
// GCC only sees strfwd.h when building merged
|
// GCC only sees strfwd.h when building merged
|
||||||
if (::lyx::operator==(cmd.argument(), "custom")) {
|
if (::lyx::operator==(cmd.argument(), "custom")) {
|
||||||
dispatch(FuncRequest(LFUN_DIALOG_SHOW, "sendto"), dr);
|
dispatch(FuncRequest(LFUN_DIALOG_SHOW, "sendto"), dr);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!doc_buffer->fileName().onlyPath().isDirWritable()) {
|
if (!target_dir.isDirWritable()) {
|
||||||
exportBufferAs(*doc_buffer);
|
exportBufferAs(*doc_buffer);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user