]> git.lyx.org Git - lyx.git/commitdiff
Only step counters we have.
authorRichard Heck <rgheck@comcast.net>
Thu, 3 Dec 2009 19:35:31 +0000 (19:35 +0000)
committerRichard Heck <rgheck@comcast.net>
Thu, 3 Dec 2009 19:35:31 +0000 (19:35 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32292 a592a061-630c-0410-9148-cb99ea01b6c8

src/output_xhtml.cpp

index 1cddb7c9d97a00d1d7a8b8270c2c01097f955ab1..d458c248e541e04f6dba284941f221e044902d0b 100644 (file)
@@ -644,9 +644,13 @@ ParagraphList::const_iterator makeEnvironmentHtml(Buffer const & buf,
                // FIXME There may be a bug here about user defined enumeration
                // types. If so, then we'll need to take the counter and add "i",
                // "ii", etc, as with enum.
-               if (!style.counter.empty() && 
-                   (par == pbegin || !isNormalEnv(style)))
-                       buf.params().documentClass().counters().step(style.counter);
+               Counters & cnts = buf.params().documentClass().counters();
+               docstring const & cntr = style.counter;
+               if (!style.counter.empty() 
+                   && (par == pbegin || !isNormalEnv(style)) 
+                               && cnts.hasCounter(cntr)
+               )
+                       cnts.step(cntr);
                ParagraphList::const_iterator send;
                // this will be positive, if we want to skip the initial word
                // (if it's been taken for the label).