diff --git a/source/distro/changelog.txt b/source/distro/changelog.txt index 87f8770..3fc2ca0 100644 --- a/source/distro/changelog.txt +++ b/source/distro/changelog.txt @@ -2,6 +2,9 @@ Changelog for Writer2LaTeX version 1.0 -> 1.2 ---------- version 1.1.9 ---------- +[w2x] EPUB change: Missing heading levels are now treated more consistent in the toc. E.g. the sequence of heading levels + 2-2-1-3-3-2 is now exported as toc levels 1-1-1-2-2-2 (before it was 1-2-1-2-3-2) + [w2l] Bugfix: Ignore headings inside footnotes (export as normal paragraph). Footnotes should not contain headings, and this change avoids an infinite loop if such a footnote is within a table. diff --git a/source/java/writer2latex/epub/NCXWriter.java b/source/java/writer2latex/epub/NCXWriter.java index 75169b0..4e49844 100644 --- a/source/java/writer2latex/epub/NCXWriter.java +++ b/source/java/writer2latex/epub/NCXWriter.java @@ -16,11 +16,11 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * - * Copyright: 2001-2010 by Henrik Just + * Copyright: 2001-2012 by Henrik Just * * All Rights Reserved. * - * version 1.2 (2010-07-02) + * version 1.2 (2012-02-22) * */ @@ -106,6 +106,7 @@ public class NCXWriter extends NewDOMDocument { Element currentContainer = ncx; int nCurrentLevel = 0; + int nCurrentEntryLevel = 0; // This may differ from nCurrentLevel if the heading levels "jump" in then document int nDepth = 0; int nPlayOrder = 0; @@ -121,13 +122,15 @@ public class NCXWriter extends NewDOMDocument { } nCurrentLevel = nEntryLevel; } - else if (nEntryLevel>nCurrentLevel) { + else if (nEntryLevel>nCurrentEntryLevel) { // To lower level (always one step; a jump from e.g. heading 1 to heading 3 in the document // is considered an error) currentContainer = (Element) currentContainer.getLastChild(); nCurrentLevel++; } + nCurrentEntryLevel = nEntryLevel; + Element navPoint = contentDOM.createElement("navPoint"); navPoint.setAttribute("playOrder", Integer.toString(++nPlayOrder)); navPoint.setAttribute("id", "text"+nPlayOrder);