Opened 21 years ago

Closed 21 years ago

Last modified 20 years ago

#821 closed defect (fixed)

bug in docbook export ( code inside list).

Reported by: José Matos Owned by: José Matos
Priority: high Milestone:
Component: docbook export Version: unspecified
Severity: normal Keywords: VERIFIED
Cc: totschnig.michael@…

Description

In the description list
with a nested code environment, the generated docbook has two listitem
closing tags instead of one.

Attachments (3)

modules.lyx (1.2 KB ) - added by José Matos 21 years ago.
testcase for the bug
modules.sgml (939 bytes ) - added by José Matos 21 years ago.
exported file
patch-docbook.txt (709 bytes ) - added by José Matos 21 years ago.
patch for 1.4, it should work also for 1.3

Download all attachments as: .zip

Change History (13)

by José Matos, 21 years ago

Attachment: modules.lyx added

testcase for the bug

by José Matos, 21 years ago

Attachment: modules.sgml added

exported file

comment:1 by totschnig.michael@…, 21 years ago

is soembody working on this bug? If there is something I can do to help resolve
it...

comment:2 by totschnig.michael@…, 21 years ago

Cc: totschnig.michael@… added

comment:3 by levon, 21 years ago

Jose ?

Michael, if you know C++, finding the exact bit of code that causes
the problem would help

comment:4 by totschnig.michael@…, 21 years ago

unfortunately, I do not know C++, but by looking at function makeDocBookFile in
buffer.C, it seems obvious that the problems is in the following section:

environment tag closing
for (; depth > par->params().depth(); --depth) {

if (environment_inner[depth] != "!-- --") {

item_name = "listitem";
sgml::closeTag(ofs, command_depth + depth, false, item_name);
if (environment_inner[depth] == "varlistentry")

sgml::closeTag(ofs, depth+command_depth, false, environment_inner[depth]);

}
sgml::closeTag(ofs, depth + command_depth, false, environment_stack[depth]);
environment_stack[depth].erase();
environment_inner[depth].erase();

}

if (depth == par->params().depth()

&& environment_stack[depth] != style->latexname()
&& !environment_stack[depth].empty()) {

if (environment_inner[depth] != "!-- --") {

item_name= "listitem";
sgml::closeTag(ofs, command_depth+depth, false, item_name);
if (environment_inner[depth] == "varlistentry")

sgml::closeTag(ofs, depth + command_depth, false, environment_inner[depth]);

}

sgml::closeTag(ofs, depth + command_depth, false, environment_stack[depth]);

environment_stack[depth].erase();
environment_inner[depth].erase();

}

two times in this block you have
if (environment_inner[depth] != "!-- --") {

item_name= "listitem";
sgml::closeTag(ofs, command_depth+depth, false, item_name);

it seems that in certain conditions both of this occurences are executed, thus
leading to two listitem closing tags.

comment:5 by José Matos, 21 years ago

Hi,

yes, I have an eye on it but real work got in the way.


For 1.3.x the idea is to chase the bug and squash it.

I will play a bit with it, and expect to have some news soon.

For 1.4 the idea is to rewrote the code in a way similar
to the present latex export.

by José Matos, 21 years ago

Attachment: patch-docbook.txt added

patch for 1.4, it should work also for 1.3

comment:6 by José Matos, 21 years ago

Subject: lyx-devel src/: ChangeLog buffer.C

CVSROOT: /usr/local/lyx/cvsroot
Module name: lyx-devel
Repository: lyx-devel/src/
Changes by: jamatos@… 03/06/06 13:28:13

Modified files:

lyx-devel/src/: ChangeLog buffer.C

Log message:

Fix docbook export (#821)

Bugs:
#821

Patches:
http://www.lyx.org/cgi-bin/viewcvs.cgi/lyx-devel/src/ChangeLog?r1=1.1367&r2=1.1368
http://www.lyx.org/cgi-bin/viewcvs.cgi/lyx-devel/src/buffer.C?r1=1.478&r2=1.479

Complete Diff:
/usr/bin/cvs -f diff -kk -u -r 1.1367 -r 1.1368 src/ChangeLog
/usr/bin/cvs -f diff -kk -u -r 1.478 -r 1.479 src/buffer.C

comment:7 by José Matos, 21 years ago

Subject: lyx-devel src/: Tag: BRANCH_1_3_X ChangeLog buff ...

CVSROOT: /usr/local/lyx/cvsroot
Module name: lyx-devel
Repository: lyx-devel/src/
Changes by: jamatos@… 03/06/06 15:04:48

Modified files:

lyx-devel/src/: Tag: BRANCH_1_3_X ChangeLog buffer.C

Log message:

Fix docbook export (#821)

Bugs:
#821

Patches:
http://www.lyx.org/cgi-bin/viewcvs.cgi/lyx-devel/src/ChangeLog?r1=1.1021.2.14&r2=1.1021.2.15
http://www.lyx.org/cgi-bin/viewcvs.cgi/lyx-devel/src/buffer.C?r1=1.399.2.2&r2=1.399.2.3

Complete Diff:
/usr/bin/cvs -f diff -kk -u -r 1.1021.2.14 -r 1.1021.2.15 src/ChangeLog
/usr/bin/cvs -f diff -kk -u -r 1.399.2.2 -r 1.399.2.3 src/buffer.C

comment:8 by José Matos, 21 years ago

Resolution: fixed
Status: newclosed

I commited the fix to both 1.3 and 1.4 trees.
Bug closed unless you have any other cases where this code fails.

comment:9 by totschnig.michael@…, 21 years ago

I applied the patch to 1.3.2 and the problem goes away. Thank you!

comment:10 by michael.gerz@…, 21 years ago

Keywords: VERIFIED added

Looks good. => VERIFIED

Note: See TracTickets for help on using tickets.