]> git.lyx.org Git - features.git/commitdiff
Fix bug 2841
authorJosé Matox <jamatos@lyx.org>
Mon, 29 Jan 2007 20:28:44 +0000 (20:28 +0000)
committerJosé Matox <jamatos@lyx.org>
Mon, 29 Jan 2007 20:28:44 +0000 (20:28 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16938 a592a061-630c-0410-9148-cb99ea01b6c8

lib/generate_contributions.py
src/output_docbook.C

index a75f75d8fa3d5adca45e366ce4477f0feec9c203..a3c08a33ee8239e5e7413248f6783094a4748a4f 100755 (executable)
@@ -641,6 +641,14 @@ contributers = [
                  "22 February 2005",
                  u"Fix to a very hard-to-find egcs bug that crashed LyX on alpha architecture"),
 
+     contributer(u"Harshula Jayasuriya",
+                 "harshula () gmail ! com",
+                 "GPL",
+                 "Re: Bug in export to DocBook",
+                 "m=116884249725701",
+                 "15 January 2007",
+                 u"Fix docbook generation of nested lists"),
+
      contributer(u"David L. Johnson",
                  "david.johnson () lehigh ! edu",
                  "GPL",
index cb5ec45481dac8ea211d819230870cf5c09d8fa8..2778dde86e67a77fc57fe57bb959ead634675c51 100644 (file)
@@ -167,7 +167,13 @@ ParagraphList::const_iterator makeEnvironment(Buffer const & buf,
                                sgml::closeTag(os, bstyle->labeltag());
                        }
                        wrapper = defaultstyle->latexname();
-                       sgml::openTag(os, bstyle->itemtag());
+                       // If a sub list (embedded list) appears next with a
+                       // different depth, then there is no need to open
+                       // another tag at the current depth.
+                       if(par->params().depth() == pbegin->params().depth()) {
+                               sgml::openTag(os, bstyle->itemtag());
+                       }
+                       break;
                default:
                        break;
                }
@@ -204,7 +210,17 @@ ParagraphList::const_iterator makeEnvironment(Buffer const & buf,
                        }
                        break;
                case LATEX_ITEM_ENVIRONMENT:
-                       sgml::closeTag(os, bstyle->itemtag());
+                       // If a sub list (embedded list) appears next, then
+                       // there is no need to close the current tag.
+                       // par should have already been incremented to the next
+                       // element. So we can compare the depth of the next
+                       // element with pbegin.
+                       // We need to be careful, that we don't dereference par
+                       // when par == pend but at the same time that the
+                       // current tag is closed.
+                       if((par != pend && par->params().depth() == pbegin->params().depth()) || par == pend) {
+                               sgml::closeTag(os, bstyle->itemtag());
+                       }
                        if (!bstyle->labeltag().empty())
                                sgml::closeTag(os, bstyle->innertag());
                        break;