]> git.lyx.org Git - features.git/commitdiff
Let all doExport calls have the same behaviour
authorVincent van Ravesteijn <vfr@lyx.org>
Sun, 30 Oct 2011 08:53:20 +0000 (08:53 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Sun, 30 Oct 2011 08:53:20 +0000 (08:53 +0000)
- Let all doExport calls honor maintain_unincluded_children
- Also don't let the behaviour depend on supplying the result_file parameter

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

src/Buffer.cpp
src/Buffer.h

index 237a7924a1bf94b4d133f87aa724283fcac71a09..bc86f8a5bf866618b57dcbcd8e1894f5596f5d56 100644 (file)
@@ -2116,7 +2116,7 @@ void Buffer::dispatch(FuncRequest const & func, DispatchResult & dr)
                break;
 
        case LFUN_BUFFER_EXPORT: {
-               ExportStatus const status = doExport(argument, false, false);
+               ExportStatus const status = doExport(argument, false);
                dr.setError(status != ExportSuccess);
                if (status != ExportSuccess)
                        dr.setMessage(bformat(_("Error exporting to format: %1$s."), 
@@ -2125,7 +2125,7 @@ void Buffer::dispatch(FuncRequest const & func, DispatchResult & dr)
        }
 
        case LFUN_BUILD_PROGRAM:
-               doExport("program", true, false);
+               doExport("program", true);
                break;
 
        case LFUN_BUFFER_CHKTEX:
@@ -2157,7 +2157,7 @@ void Buffer::dispatch(FuncRequest const & func, DispatchResult & dr)
                                break;
 
                } else {
-                       doExport(format_name, true, false, filename);
+                       doExport(format_name, true, filename);
                }
 
                // Substitute $$FName for filename
@@ -3511,12 +3511,29 @@ bool Buffer::isExporting() const
 }
 
 
-Buffer::ExportStatus Buffer::doExport(string const & target, bool put_in_tempdir) const
+Buffer::ExportStatus Buffer::doExport(string const & target, bool put_in_tempdir)
+       const
+{
+       string result_file;
+       return doExport(target, put_in_tempdir, result_file);
+}
+
+Buffer::ExportStatus Buffer::doExport(string const & target, bool put_in_tempdir,
+       string & result_file) const
 {
        bool const update_unincluded =
                        params().maintain_unincluded_children
                        && !params().getIncludedChildren().empty();
-       return doExport(target, put_in_tempdir, update_unincluded);
+
+       // (1) export with all included children (omit \includeonly)
+       if (update_unincluded) { 
+               ExportStatus const status = 
+                       doExport(target, put_in_tempdir, true, result_file);
+               if (status != ExportSuccess)
+                       return status;
+       }
+       // (2) export with included children only
+       return doExport(target, put_in_tempdir, false, result_file);
 }
 
 
@@ -3752,22 +3769,6 @@ Buffer::ExportStatus Buffer::doExport(string const & target, bool put_in_tempdir
 }
 
 
-Buffer::ExportStatus Buffer::doExport(string const & target, bool put_in_tempdir,
-       bool includeall) const
-{
-       string result_file;
-       // (1) export with all included children (omit \includeonly)
-       if (includeall) { 
-               ExportStatus const status = 
-                       doExport(target, put_in_tempdir, true, result_file);
-               if (status != ExportSuccess)
-                       return status;
-       }
-       // (2) export with included children only
-       return doExport(target, put_in_tempdir, false, result_file);
-}
-
-
 Buffer::ExportStatus Buffer::preview(string const & format) const
 {
        bool const update_unincluded =
@@ -3782,7 +3783,7 @@ Buffer::ExportStatus Buffer::preview(string const & format, bool includeall) con
        string result_file;
        // (1) export with all included children (omit \includeonly)
        if (includeall) { 
-               ExportStatus const status = doExport(format, true, true);
+               ExportStatus const status = doExport(format, true, true, result_file);
                if (status != ExportSuccess)
                        return status;
        }
index fe39b4653f33bbb0390498a1be5edf2100c9f222..f4cb22f964a54391fa168d53e870f839a62ea52f 100644 (file)
@@ -621,6 +621,9 @@ public:
        ///
        ExportStatus doExport(std::string const & target, bool put_in_tempdir) const;
        ///
+       ExportStatus doExport(std::string const & target, bool put_in_tempdir,
+               std::string & result_file) const;
+       ///
        ExportStatus preview(std::string const & format) const;
 
 private: