]> git.lyx.org Git - features.git/commitdiff
Make sure the counters get updated.
authorRichard Heck <rgheck@comcast.net>
Sat, 6 Jun 2009 01:29:39 +0000 (01:29 +0000)
committerRichard Heck <rgheck@comcast.net>
Sat, 6 Jun 2009 01:29:39 +0000 (01:29 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29978 a592a061-630c-0410-9148-cb99ea01b6c8

src/output_xhtml.cpp

index 38a5c97d410fe0bddf03d29b6630f6972942936f..830764d2c8df6490fc6fcdfdb11d54a9faf43b56 100644 (file)
@@ -194,6 +194,8 @@ ParagraphList::const_iterator makeParagraphs(Buffer const & buf,
        ParagraphList::const_iterator par = pbegin;
        for (; par != pend; ++par) {
                Layout const & lay = par->layout();
+               if (!lay.counter.empty())
+                       buf.params().documentClass().counters().step(lay.counter);
                if (par != pbegin)
                        os << '\n';
                bool const opened = openTag(os, lay);
@@ -228,6 +230,8 @@ ParagraphList::const_iterator makeEnvironment(Buffer const & buf,
 
        while (par != pend) {
                Layout const & style = par->layout();
+               if (!style.counter.empty())
+                       buf.params().documentClass().counters().step(style.counter);
                ParagraphList::const_iterator send;
                // this will be positive, if we want to skip the initial word
                // (if it's been taken for the label).
@@ -255,8 +259,6 @@ ParagraphList::const_iterator makeEnvironment(Buffer const & buf,
                                } else if (style.latextype == LATEX_ENVIRONMENT 
                                           && style.labeltype != LABEL_NO_LABEL) {
                                        bool const label_tag_opened = openLabelTag(os, cstyle);
-                                       if (!style.counter.empty())
-                                               buf.params().documentClass().counters().step(cstyle.counter);
                                        os << pbegin->expandLabel(style, buf.params(), false);
                                        if (label_tag_opened)
                                                closeLabelTag(os, cstyle);
@@ -318,14 +320,14 @@ void makeCommand(Buffer const & buf,
                                          ParagraphList::const_iterator const & pbegin)
 {
        Layout const & style = pbegin->layout();
+       if (!style.counter.empty())
+               buf.params().documentClass().counters().step(style.counter);
 
        bool const main_tag_opened = openTag(os, style);
 
        // Label around sectioning number:
        if (style.labeltype != LABEL_NO_LABEL) {
                bool const label_tag_opened = openLabelTag(os, style);
-               if (!style.counter.empty())
-                       buf.params().documentClass().counters().step(style.counter);
                os << pbegin->expandLabel(style, buf.params(), false);
                if (label_tag_opened)
                        closeLabelTag(os, style);