]> git.lyx.org Git - features.git/commitdiff
Cut and paste solution to get export working. The issue is that the old
authorRichard Heck <rgheck@comcast.net>
Tue, 19 Oct 2010 15:10:13 +0000 (15:10 +0000)
committerRichard Heck <rgheck@comcast.net>
Tue, 19 Oct 2010 15:10:13 +0000 (15:10 +0000)
exportAndDestroy was calling:
  buffer->doExport(format, true, update_unincluded);
where "true" means: Leave it in the tempdir. We need false, which means
we need another parameter, if we're not doing it as cut and paste.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35715 a592a061-630c-0410-9148-cb99ea01b6c8

src/Buffer.cpp
src/frontends/qt4/GuiView.cpp

index b2c3d8ddd8ec5c20a011ed596ba0ab4c847410ce..c9277d642f9f88e2e3c522d66208190382ed4076 100644 (file)
@@ -70,6 +70,7 @@
 #include "insets/InsetBibtex.h"
 #include "insets/InsetBranch.h"
 #include "insets/InsetInclude.h"
+#include "insets/InsetTabular.h"
 #include "insets/InsetText.h"
 
 #include "mathed/InsetMathHull.h"
@@ -2732,6 +2733,17 @@ void Buffer::Impl::updateMacros(DocIterator & it, DocIterator & scope)
                                it.pop_back();
                                continue;
                        }
+                       
+                       if (iit->inset->asInsetTabular()) {
+                               CursorSlice slice(*iit->inset);
+                               size_t const numcells = slice.nargs();
+                               for (; slice.idx() < numcells; slice.forwardIdx()) {
+                                       it.push_back(slice);
+                                       updateMacros(it, scope);
+                                       it.pop_back();
+                               }
+                               continue;
+                       }
 
                        // is it an external file?
                        if (iit->inset->lyxCode() == INCLUDE_CODE) {
index 724e4f4f47ff10ebac72a82565e26289133acc5e..1e499ce139afd768b6c3ba6cefde61e3e0d83610 100644 (file)
@@ -367,6 +367,7 @@ public:
        static QSet<Buffer const *> busyBuffers;
        static docstring previewAndDestroy(Buffer const * orig, Buffer * buffer, string const & format);
        static docstring exportAndDestroy(Buffer const * orig, Buffer * buffer, string const & format);
+       static docstring compileAndDestroy(Buffer const * orig, Buffer * buffer, string const & format);
        static docstring saveAndDestroy(Buffer const * orig, Buffer * buffer, FileName const & fname);
 
        // TODO syncFunc/previewFunc: use bind
@@ -2814,7 +2815,7 @@ bool GuiView::goToFileRow(string const & argument)
 
 
 #if (QT_VERSION >= 0x040400)
-docstring GuiView::GuiViewPrivate::exportAndDestroy(Buffer const * orig, Buffer * buffer, string const & format)
+docstring GuiView::GuiViewPrivate::compileAndDestroy(Buffer const * orig, Buffer * buffer, string const & format)
 {
        bool const update_unincluded =
                                buffer->params().maintain_unincluded_children
@@ -2822,6 +2823,20 @@ docstring GuiView::GuiViewPrivate::exportAndDestroy(Buffer const * orig, Buffer
        bool const success = buffer->doExport(format, true, update_unincluded);
        delete buffer;
        busyBuffers.remove(orig);
+       return success
+               ? bformat(_("Successful compilation to format: %1$s"), from_utf8(format))
+               : bformat(_("Error compiling format: %1$s"), from_utf8(format));
+}
+
+
+docstring GuiView::GuiViewPrivate::exportAndDestroy(Buffer const * orig, Buffer * buffer, string const & format)
+{
+       bool const update_unincluded =
+                               buffer->params().maintain_unincluded_children
+                               && !buffer->params().getIncludedChildren().empty();
+       bool const success = buffer->doExport(format, false, update_unincluded);
+       delete buffer;
+       busyBuffers.remove(orig);
        return success
                ? bformat(_("Successful export to format: %1$s"), from_utf8(format))
                : bformat(_("Error exporting to format: %1$s"), from_utf8(format));
@@ -2951,7 +2966,7 @@ void GuiView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                        d.asyncBufferProcessing(argument,
                                                doc_buffer,
                                                _("Exporting ..."),
-                                               &GuiViewPrivate::exportAndDestroy,
+                                               &GuiViewPrivate::compileAndDestroy,
                                                &Buffer::doExport,
                                                0);
                        break;
@@ -2969,7 +2984,7 @@ void GuiView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                        d.asyncBufferProcessing(argument,
                                                (doc_buffer ? doc_buffer->masterBuffer() : 0),
                                                docstring(),
-                                               &GuiViewPrivate::exportAndDestroy,
+                                               &GuiViewPrivate::compileAndDestroy,
                                                &Buffer::doExport,
                                                0);
                        break;