From f6ce71c6a5755136e80ec8c7e1e8d1b8a3e856b3 Mon Sep 17 00:00:00 2001 From: henrikjust Date: Fri, 2 Jul 2010 11:12:11 +0000 Subject: [PATCH] A few w2x fixes git-svn-id: svn://svn.code.sf.net/p/writer2latex/code/trunk@71 f0f2a975-2e09-46c8-9428-3b39399b9f3c --- source/distro/changelog.txt | 2 ++ source/java/writer2latex/api/ConverterFactory.java | 4 ++-- source/java/writer2latex/epub/NCXWriter.java | 6 +++--- source/java/writer2latex/epub/OPFWriter.java | 6 +++--- source/java/writer2latex/xhtml/TextConverter.java | 13 ++++++++++++- 5 files changed, 22 insertions(+), 9 deletions(-) diff --git a/source/distro/changelog.txt b/source/distro/changelog.txt index b65c4fe..28a4fc5 100644 --- a/source/distro/changelog.txt +++ b/source/distro/changelog.txt @@ -2,6 +2,8 @@ Changelog for Writer2LaTeX version 1.0 -> 1.2 ---------- version 1.1.4 ---------- +[w2x] EPUB bugfix: Fixed problem with URL encoding of fragment identifier in links to document parts + [w2x] New option endnotes_heading: The value of this (if non-empty) is used as heading for the endnotes [w2x] The option add_bom now only has effect if the encoding is UTF-8 diff --git a/source/java/writer2latex/api/ConverterFactory.java b/source/java/writer2latex/api/ConverterFactory.java index 931ad59..1f23227 100644 --- a/source/java/writer2latex/api/ConverterFactory.java +++ b/source/java/writer2latex/api/ConverterFactory.java @@ -20,7 +20,7 @@ * * All Rights Reserved. * - * Version 1.2 (2010-06-20) + * Version 1.2 (2010-07-02) * */ @@ -33,7 +33,7 @@ public class ConverterFactory { // Version information private static final String VERSION = "1.1.4"; - private static final String DATE = "2010-06-20"; + private static final String DATE = "2010-07-02"; /** Return the Writer2LaTeX version in the form * (major version).(minor version).(patch level)
diff --git a/source/java/writer2latex/epub/NCXWriter.java b/source/java/writer2latex/epub/NCXWriter.java index f13634e..75169b0 100644 --- a/source/java/writer2latex/epub/NCXWriter.java +++ b/source/java/writer2latex/epub/NCXWriter.java @@ -20,7 +20,7 @@ * * All Rights Reserved. * - * version 1.2 (2010-05-13) + * version 1.2 (2010-07-02) * */ @@ -140,9 +140,9 @@ public class NCXWriter extends NewDOMDocument { navLabelText.appendChild(contentDOM.createTextNode(entry.getTitle())); Element navPointContent = contentDOM.createElement("content"); - String sHref = entry.getFile().getFileName(); + String sHref = Misc.makeHref(entry.getFile().getFileName()); if (entry.getTarget()!=null) { sHref+="#"+entry.getTarget(); } - navPointContent.setAttribute("src", Misc.makeHref(sHref)); + navPointContent.setAttribute("src", sHref); navPoint.appendChild(navPointContent); nDepth = Math.max(nDepth, nCurrentLevel); diff --git a/source/java/writer2latex/epub/OPFWriter.java b/source/java/writer2latex/epub/OPFWriter.java index 0ed0ba6..8a23f6c 100644 --- a/source/java/writer2latex/epub/OPFWriter.java +++ b/source/java/writer2latex/epub/OPFWriter.java @@ -20,7 +20,7 @@ * * All Rights Reserved. * - * version 1.2 (2010-05-13) + * version 1.2 (2010-07-02) * */ @@ -145,9 +145,9 @@ public class OPFWriter extends NewDOMDocument { Element reference = contentDOM.createElement("reference"); reference.setAttribute("type", sType); reference.setAttribute("title", entry.getTitle()); - String sHref = entry.getFile().getFileName(); + String sHref = Misc.makeHref(entry.getFile().getFileName()); if (entry.getTarget()!=null) { sHref+="#"+entry.getTarget(); } - reference.setAttribute("href", Misc.makeHref(sHref)); + reference.setAttribute("href", sHref); guide.appendChild(reference); } } diff --git a/source/java/writer2latex/xhtml/TextConverter.java b/source/java/writer2latex/xhtml/TextConverter.java index 5507b26..0e2f11f 100644 --- a/source/java/writer2latex/xhtml/TextConverter.java +++ b/source/java/writer2latex/xhtml/TextConverter.java @@ -20,7 +20,7 @@ * * All Rights Reserved. * - * Version 1.2 (2010-06-20) + * Version 1.2 (2010-07-02) * */ @@ -1621,11 +1621,22 @@ public class TextConverter extends ConverterHelper { int n = endnotes.size(); if (n>0) { if (nSplit>0) { hnode = converter.nextOutFile(); } + String sHeading = config.getEndnotesHeading(); if (sHeading.length()>0) { Element heading = converter.createElement("h1"); hnode.appendChild(heading); heading.appendChild(converter.createTextNode(sHeading)); + + // Add to external content. + if (nSplit>0) { + converter.addContentEntry(sHeading, 1, null); + } + else { + //For single output file we need a target + converter.addTarget(heading,"endnotes"); + converter.addContentEntry(sHeading, 1, "endnotes"); + } } for (int i=0; i