From 90d1b47551627ce86b3a4f0eb2ba2be9f3159f30 Mon Sep 17 00:00:00 2001 From: henrikjust Date: Fri, 24 Feb 2012 10:36:20 +0000 Subject: [PATCH] w2x: Use zero body margin for the file containing the cover image in EPUB export git-svn-id: svn://svn.code.sf.net/p/writer2latex/code/trunk@133 f0f2a975-2e09-46c8-9428-3b39399b9f3c --- source/distro/changelog.txt | 2 ++ source/java/writer2latex/latex/StarMathConverter.java | 1 - source/java/writer2latex/xhtml/DrawConverter.java | 8 ++++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/source/distro/changelog.txt b/source/distro/changelog.txt index a1f1d0e..0dfb0ff 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.9 ---------- +[w2x] The file containing the cover image in EPUB export is now created with a body margin of zero + [w2l] The StarMath converter now leaves out the \text command if the argument is a plain number [w2l] Properly detect and ignore empty formulas (avoiding any occurrences of $ $ in the document) diff --git a/source/java/writer2latex/latex/StarMathConverter.java b/source/java/writer2latex/latex/StarMathConverter.java index b3f6cad..a4f396c 100644 --- a/source/java/writer2latex/latex/StarMathConverter.java +++ b/source/java/writer2latex/latex/StarMathConverter.java @@ -26,7 +26,6 @@ package writer2latex.latex; import java.util.Map; -import java.util.regex.Matcher; import java.util.regex.Pattern; import writer2latex.util.*; diff --git a/source/java/writer2latex/xhtml/DrawConverter.java b/source/java/writer2latex/xhtml/DrawConverter.java index 1fc68e2..f3e7bcb 100644 --- a/source/java/writer2latex/xhtml/DrawConverter.java +++ b/source/java/writer2latex/xhtml/DrawConverter.java @@ -242,6 +242,14 @@ public class DrawConverter extends ConverterHelper { bCollectFullscreenFrames = false; handleDrawElement(cover,currentNode,null,FULL_SCREEN); bCollectFullscreenFrames = true; + // Add margin:0 to body + Element head = Misc.getChildByTagName(hnode.getOwnerDocument().getDocumentElement(),"head"); + if (head!=null) { + Element style = converter.createElement("style"); + head.appendChild(style); + style.setAttribute("type", "text/css"); + style.appendChild(converter.createTextNode("body { margin:0 }")); + } currentNode = getTextCv().doMaybeSplit(hnode, 0); } }