From 29f3b82fc2857aaefc8f7ab2e7bca176bdf15b3c Mon Sep 17 00:00:00 2001 From: "luca.conte" Date: Fri, 23 May 2014 12:31:38 +0000 Subject: [PATCH] added support for user's defined style classes --- .classpath | 3 +++ pom.xml | 2 +- src/main/java/org/bazu/jotex/OdtEPUBlisher.java | 17 +++++++---------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.classpath b/.classpath index fd7ad7f..049ade5 100644 --- a/.classpath +++ b/.classpath @@ -22,5 +22,8 @@ + + + diff --git a/pom.xml b/pom.xml index c7992b1..2bc8c6d 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.bazu jotex jar - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT jotex http://maven.apache.org diff --git a/src/main/java/org/bazu/jotex/OdtEPUBlisher.java b/src/main/java/org/bazu/jotex/OdtEPUBlisher.java index 04bb4d5..c34d6f7 100644 --- a/src/main/java/org/bazu/jotex/OdtEPUBlisher.java +++ b/src/main/java/org/bazu/jotex/OdtEPUBlisher.java @@ -196,11 +196,9 @@ public class OdtEPUBlisher { Utils.processMetadata(getOdt().getMetaDom(), getEpub(), getXpath()); - // stylesPropsToCSS( getOdtDocument().getDocumentStyles().get, - // className) - // System.out.println(getOdtDocument().getDocumentStyles()); - extractDefaultStyles(getOdt().getDocumentStyles()); + //System.out.println(getOdt().getDocumentStyles()); + extractDefaultStyles(getOdt().getDocumentStyles()); if(getCoverPath()!=null&&getCoverPath().trim().length()>0){//a cover will be processed @@ -915,21 +913,20 @@ public class OdtEPUBlisher { stylesPropsToCSS(s.getStyleProperties(), "h9", null); stylesPropsToCSS(s.getStyleProperties(), "h10", null); - } - if (s.getAttribute("style:name").startsWith("Heading")) { + }else if (s.getAttribute("style:name").startsWith("Heading")) { String level = s.getAttribute("style:default-outline-level"); if (level != null && level.trim().length() > 0) { stylesPropsToCSS(s.getStyleProperties(), "h" + level, null); } - } - if (s.getAttribute("style:name").startsWith("Standard")) { + }else if (s.getAttribute("style:name").startsWith("Standard")) { stylesPropsToCSS(s.getStyleProperties(), "p", null); - } - if (s.getAttribute("style:name").startsWith("Footnote")) { + }else if (s.getAttribute("style:name").startsWith("Footnote")) { stylesPropsToCSS(s.getStyleProperties(), null, "Footnote"); stylesPropsToCSS(s.getStyleProperties(), null, "fnDiv"); + }else if (s.getAttribute("style:name")!=null&&!s.getAttribute("style:name").trim().equals("")) { + stylesPropsToCSS(s.getStyleProperties(), null, s.getAttribute("style:name")); } if (isDebugMode()) { System.out.println("Nome: " + s.getAttribute("style:name") + " Classe: "