]> git.lyx.org Git - features.git/commitdiff
Fix bug #7664. Forgot to deal with included files.
authorRichard Heck <rgheck@comcast.net>
Sun, 3 Jul 2011 20:59:03 +0000 (20:59 +0000)
committerRichard Heck <rgheck@comcast.net>
Sun, 3 Jul 2011 20:59:03 +0000 (20:59 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39242 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/InsetInclude.cpp

index 94a996a81edf5c16dd607776bc6be1fd8c15c3bb..c74ec631aa1a5d0197f37f06f65ea1768926c395 100644 (file)
@@ -734,7 +734,7 @@ void InsetInclude::latex(otexstream & os, OutputParams const & runparams) const
 }
 
 
-docstring InsetInclude::xhtml(XHTMLStream & xs, OutputParams const &rp) const
+docstring InsetInclude::xhtml(XHTMLStream & xs, OutputParams const & rp) const
 {
        if (rp.inComment)
                 return docstring();
@@ -778,7 +778,23 @@ docstring InsetInclude::xhtml(XHTMLStream & xs, OutputParams const &rp) const
        Buffer const * const ibuf = loadIfNeeded();
        if (!ibuf)
                return docstring();
-       ibuf->writeLyXHTMLSource(xs.os(), rp, true);
+
+       // are we generating only some paragraphs, or all of them?
+       bool const all_pars = !rp.dryrun || 
+                       (rp.par_begin == 0 && 
+                        rp.par_end == (int)buffer().text().paragraphs().size());
+       
+       OutputParams op = rp;
+       if (all_pars) {
+               op.par_begin = 0;
+               op.par_end = 0;
+               ibuf->writeLyXHTMLSource(xs.os(), op, true);
+       } else
+               xs << XHTMLStream::ESCAPE_NONE 
+                  << "<!-- Included file: " 
+                  << from_utf8(included_file.absFileName()) 
+                  << XHTMLStream::ESCAPE_NONE 
+                        << " -->";
        return docstring();
 }