]> git.lyx.org Git - lyx.git/blobdiff - src/output_xhtml.cpp
Get rid of all-insets-toggle and explain how to replace it with inset-forall.
[lyx.git] / src / output_xhtml.cpp
index 57711fe77805bc97cc4b0335ef9d30cde07614ba..0a8222c8fb31cad5d0b96ffa946a73877ee44ecd 100644 (file)
@@ -18,6 +18,7 @@
 #include "buffer_funcs.h"
 #include "BufferParams.h"
 #include "Counters.h"
+#include "Font.h"
 #include "Layout.h"
 #include "OutputParams.h"
 #include "Paragraph.h"
@@ -329,7 +330,6 @@ bool XHTMLStream::isTagOpen(string const & stag)
        TagStack::const_iterator sit = tag_stack_.begin();
        TagStack::const_iterator const sen = tag_stack_.end();
        for (; sit != sen; ++sit)
-               // we could check for the
                if (sit->tag_ == stag) 
                        return true;
        return false;
@@ -574,7 +574,7 @@ ParagraphList::const_iterator makeParagraphs(Buffer const & buf,
        for (; par != pend; ++par) {
                Layout const & lay = par->layout();
                if (!lay.counter.empty())
-                       buf.params().documentClass().counters().step(lay.counter);
+                       buf.params().documentClass().counters().step(lay.counter, OutputUpdate);
                // FIXME We should see if there's a label to be output and
                // do something with it.
                if (par != pbegin)
@@ -621,6 +621,8 @@ ParagraphList::const_iterator makeBibliography(Buffer const & buf,
                                ParagraphList::const_iterator const & pbegin,
                                ParagraphList::const_iterator const & pend) 
 {
+       // FIXME XHTML
+       // Use TextClass::htmlTOCLayout() to figure out how we should look.
        xs << html::StartTag("h2", "class='bibliography'");
        xs << pbegin->layout().labelstring(false);
        xs << html::EndTag("h2");
@@ -673,7 +675,7 @@ ParagraphList::const_iterator makeEnvironmentHtml(Buffer const & buf,
                    && (par == pbegin || !isNormalEnv(style)) 
                                && cnts.hasCounter(cntr)
                )
-                       cnts.step(cntr);
+                       cnts.step(cntr, OutputUpdate);
                ParagraphList::const_iterator send;
                // this will be positive, if we want to skip the initial word
                // (if it's been taken for the label).
@@ -698,7 +700,7 @@ ParagraphList::const_iterator makeEnvironmentHtml(Buffer const & buf,
                                        openItemTag(xs, style);
                                        if (par == pbegin && style.htmllabeltag() != "NONE") {
                                                docstring const lbl = 
-                                                               pbegin->expandLabel(style, buf.params(), false);
+                                                               pbegin->params().labelString();
                                                if (!lbl.empty()) {
                                                        openLabelTag(xs, style);
                                                        xs << lbl;
@@ -720,7 +722,7 @@ ParagraphList::const_iterator makeEnvironmentHtml(Buffer const & buf,
                                        else if (style.labeltype != LABEL_NO_LABEL
                                                 && style.htmllabeltag() != "NONE") {
                                                openLabelTag(xs, style);
-                                               xs << par->expandLabel(style, buf.params(), false);
+                                               xs << par->params().labelString();
                                                closeLabelTag(xs, style);
                                                xs.cr();
                                        }
@@ -785,7 +787,7 @@ void makeCommand(Buffer const & buf,
 {
        Layout const & style = pbegin->layout();
        if (!style.counter.empty())
-               buf.params().documentClass().counters().step(style.counter);
+               buf.params().documentClass().counters().step(style.counter, OutputUpdate);
 
        openTag(xs, style);
 
@@ -793,7 +795,7 @@ void makeCommand(Buffer const & buf,
        // FIXME Probably need to account for LABEL_MANUAL
        if (style.labeltype != LABEL_NO_LABEL) {
                openLabelTag(xs, style);
-               xs << pbegin->expandLabel(style, buf.params(), false);
+               xs << pbegin->params().labelString();
                closeLabelTag(xs, style);
                // Otherwise the label might run together with the text
                xs << from_ascii(" ");
@@ -820,6 +822,13 @@ void xhtmlParagraphs(Text const & text,
 
        OutputParams ourparams = runparams;
        while (par != pend) {
+               if (par->params().startOfAppendix()) {
+                       // FIXME: only the counter corresponding to toplevel
+                       // sectioning should be reset
+                       Counters & cnts = buf.masterBuffer()->params().documentClass().counters();
+                       cnts.reset();
+                       cnts.appendix(true);
+               }
                Layout const & style = par->layout();
                ParagraphList::const_iterator lastpar = par;
                ParagraphList::const_iterator send;