commit 5686ad11f39121113e4f039932f357047ca2713f
Author: Juergen Spitzmueller <[email protected]>
Date:   Mon Sep 16 10:13:16 2013 +0200

    Fix loop when trying to export a read-only document

diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp
index c9f68f5..a5438b9 100644
--- a/src/frontends/qt4/GuiView.cpp
+++ b/src/frontends/qt4/GuiView.cpp
@@ -3307,12 +3307,16 @@ void GuiView::dispatch(FuncRequest const & cmd, 
DispatchResult & dr)
                case LFUN_BUFFER_EXPORT: {
                        if (!doc_buffer)
                                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
                        if (::lyx::operator==(cmd.argument(), "custom")) {
                                dispatch(FuncRequest(LFUN_DIALOG_SHOW, 
"sendto"), dr);
                                break;
                        }
-                       if (!doc_buffer->fileName().onlyPath().isDirWritable()) 
{
+                       if (!target_dir.isDirWritable()) {
                                exportBufferAs(*doc_buffer);
                                break;
                        }

Reply via email to