diff --git a/source/distro/changelog.txt b/source/distro/changelog.txt index 3909e3a..3934723 100644 --- a/source/distro/changelog.txt +++ b/source/distro/changelog.txt @@ -2,6 +2,12 @@ Changelog for Writer2LaTeX version 1.0 -> 1.2 ---------- version 1.1.7 ---------- +[w2x] Bugfix: Positioning of text boxes (left, right, center, floating) now works correctly + +[w2x] Support the value "biggest" for the style:wrap attribute + +[w2l] Bugfix: No longer creates run-in headings if bottom margin is zero and formatting>=convert_most + [all] Filter bugfix: Do not exclude surrogate pairs [w2l] Bugfix: Fixed indentation problem with lists after tables if formatting>=convert_most diff --git a/source/java/writer2latex/api/ConverterFactory.java b/source/java/writer2latex/api/ConverterFactory.java index 9ba11ac..ecffe4a 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 (2011-03-23) + * Version 1.2 (2011-03-29) * */ @@ -33,7 +33,7 @@ public class ConverterFactory { // Version information private static final String VERSION = "1.1.7"; - private static final String DATE = "2011-03-23"; + private static final String DATE = "2011-03-29"; /** Return the Writer2LaTeX version in the form * (major version).(minor version).(patch level)
diff --git a/source/java/writer2latex/latex/BlockConverter.java b/source/java/writer2latex/latex/BlockConverter.java index 90d6ffa..ca04b6f 100644 --- a/source/java/writer2latex/latex/BlockConverter.java +++ b/source/java/writer2latex/latex/BlockConverter.java @@ -311,7 +311,7 @@ public class BlockConverter extends ConverterHelper { node.getNodeName().equals(XMLString.TEXT_LIST_HEADER), "true".equals(node.getAttribute(XMLString.TEXT_RESTART_NUMBERING)), Misc.getPosInteger(node.getAttribute(XMLString.TEXT_START_VALUE),1)-1, - ba); + ba,oc); // export the list item (note the special treatment of lists in tables) if (ba.getBefore().length()>0) { diff --git a/source/java/writer2latex/latex/HeadingConverter.java b/source/java/writer2latex/latex/HeadingConverter.java index 860e146..4d01987 100644 --- a/source/java/writer2latex/latex/HeadingConverter.java +++ b/source/java/writer2latex/latex/HeadingConverter.java @@ -20,7 +20,7 @@ * * All Rights Reserved. * - * Version 1.2 (2011-03-10) + * Version 1.2 (2011-03-29) * */ @@ -239,7 +239,9 @@ public class HeadingConverter extends ConverterHelper { // Suppress indentation after heading? currently not.. // ldp.append("-"); ldp.append(sMarginTop) - .append("}{").append(sMarginBottom).append("}{"); + .append("}{") + .append(Misc.isZero(sMarginBottom) ? "0.1mm" : sMarginBottom) + .append("}{"); // Note: decl.getAfter() may include a page break after, which we ignore ldp.append(decl.getBefore()); if (!comm.isEmpty()) { diff --git a/source/java/writer2latex/latex/ListStyleConverter.java b/source/java/writer2latex/latex/ListStyleConverter.java index 45d7edc..c6fdedc 100644 --- a/source/java/writer2latex/latex/ListStyleConverter.java +++ b/source/java/writer2latex/latex/ListStyleConverter.java @@ -135,7 +135,7 @@ public class ListStyleConverter extends StyleConverter { /**

Apply a list style to a list item.

*/ public void applyListItemStyle(String sStyleName, int nLevel, boolean bHeader, - boolean bRestart, int nStartValue, BeforeAfter ba) { + boolean bRestart, int nStartValue, BeforeAfter ba, Context oc) { // Step 1. We may have a style map, this always takes precedence String sDisplayName = ofr.getListStyles().getDisplayName(sStyleName); if (config.getListItemStyleMap().contains(sDisplayName)) { @@ -154,7 +154,9 @@ public class ListStyleConverter extends StyleConverter { return; } // Step 3: Export as default lists (with redefined labels) - if (config.formatting()==LaTeXConfig.CONVERT_BASIC) { + // (for list in tables this is the maximum formatting we export) + if (config.formatting()==LaTeXConfig.CONVERT_BASIC || + (config.formatting()>=LaTeXConfig.CONVERT_MOST && oc.isInTable())) { if (nLevel<=4) { if (bHeader) { ba.add("\\item[] ",""); diff --git a/source/java/writer2latex/latex/ParConverter.java b/source/java/writer2latex/latex/ParConverter.java index fa32f4e..b068301 100644 --- a/source/java/writer2latex/latex/ParConverter.java +++ b/source/java/writer2latex/latex/ParConverter.java @@ -20,7 +20,7 @@ * * All Rights Reserved. * - * Version 1.2 (2011-03-22) + * Version 1.2 (2011-03-29) * */ @@ -232,7 +232,8 @@ public class ParConverter extends StyleConverter { } else { // Export character formatting + alignment only - BeforeAfter baFormat = new BeforeAfter(); + BeforeAfter baPar = new BeforeAfter(); + BeforeAfter baText = new BeforeAfter(); // Apply hard formatting attributes // Note: Left justified text is exported as full justified text! @@ -240,25 +241,34 @@ public class ParConverter extends StyleConverter { if (style!=null) { String sTextAlign = style.getProperty(XMLString.FO_TEXT_ALIGN,true); if (bLastInBlock && context.isInLastTableColumn()) { // no grouping needed, but need to fix problem with \\ - if ("center".equals(sTextAlign)) { baFormat.add("\\centering\\arraybslash",""); } - else if ("end".equals(sTextAlign)) { baFormat.add("\\raggedleft\\arraybslash",""); } + if ("center".equals(sTextAlign)) { baPar.add("\\centering\\arraybslash",""); } + else if ("end".equals(sTextAlign)) { baPar.add("\\raggedleft\\arraybslash",""); } bNeedArrayBslash = true; } else if (bLastInBlock) { // no \par needed - if ("center".equals(sTextAlign)) { baFormat.add("\\centering",""); } - else if ("end".equals(sTextAlign)) { baFormat.add("\\raggedleft",""); } + if ("center".equals(sTextAlign)) { baPar.add("\\centering",""); } + else if ("end".equals(sTextAlign)) { baPar.add("\\raggedleft",""); } } else { - if ("center".equals(sTextAlign)) { baFormat.add("\\centering","\\par"); } - else if ("end".equals(sTextAlign)) { baFormat.add("\\raggedleft","\\par"); } + if ("center".equals(sTextAlign)) { baPar.add("\\centering","\\par"); } + else if ("end".equals(sTextAlign)) { baPar.add("\\raggedleft","\\par"); } } - palette.getI18n().applyLanguage(style,true,true,baFormat); - palette.getCharSc().applyFont(style,true,true,baFormat,context); + palette.getI18n().applyLanguage(style,true,true,baText); + palette.getCharSc().applyFont(style,true,true,baText,context); } - // If there is any hard character formatting or alignment we must group the contents. - if (!baFormat.isEmpty() && !bLastInBlock) { ba.add("{","}"); } - ba.add(baFormat); + // Group the contents if this is not the last paragraph in the cell + boolean bIsGrouped = false; + if ((!baPar.isEmpty() || !baText.isEmpty()) && !bLastInBlock) { + ba.add("{","}"); + bIsGrouped = true; + } + ba.add(baPar); + // Group the text formatting in any case (supertabular needs this) + if (!baText.isEmpty() && !bIsGrouped) { + ba.add("{", "}"); + } + ba.add(baText); if (ba.getBefore().length()>0) { ba.add(" ",""); } } diff --git a/source/java/writer2latex/latex/util/BeforeAfter.java b/source/java/writer2latex/latex/util/BeforeAfter.java index d337b84..c89fcbc 100644 --- a/source/java/writer2latex/latex/util/BeforeAfter.java +++ b/source/java/writer2latex/latex/util/BeforeAfter.java @@ -20,7 +20,7 @@ * * All Rights Reserved. * - * Version 1.2 (2011-03-22) + * Version 1.2 (2011-03-29) * */ @@ -57,6 +57,19 @@ public class BeforeAfter { sBefore+=sBefore1; sAfter=sAfter1+sAfter; } + /**

Add data to the BeforeAfter

+ *

The new data will be be added "outside", thus for example

+ * + *

will create the pair \textit{\textsf{, }}

+ * + * @param sBefore1 LaTeX code to put before + * @param sAfter1 LaTeX code to put after + */ + public void enclose(String sBefore1, String sAfter1) { + sBefore=sBefore1+sBefore; sAfter+=sAfter1; + } + /**

Add the content of another BeforeAfter to this BeforeAfter

*

The new data will be be added "inside"

* diff --git a/source/java/writer2latex/util/Misc.java b/source/java/writer2latex/util/Misc.java index 1cb4853..36ae8cb 100644 --- a/source/java/writer2latex/util/Misc.java +++ b/source/java/writer2latex/util/Misc.java @@ -20,7 +20,7 @@ * * All Rights Reserved. * - * Version 1.2 (2011-03-16) + * Version 1.2 (2011-03-29) * */ @@ -161,8 +161,6 @@ public class Misc{ return n; } - //public static int min(int n, int m) { return n Use relative size (%): Image sizes will be exported as - percentages. This has the advantage that the image size will adapt to the size of the reader screen. + a percentage of the total width. + This has the advantage that the image size will adapt to the size of the reader screen. Use original image size: Often images in a %PRODUCTNAME document