- Timestamp:
- 02/26/10 03:41:23 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/docx4j/src/pptx4j/java/org/pptx4j/convert/out/svginhtml/SvgExporter.java
r1086 r1087 22 22 import org.docx4j.convert.out.html.HtmlExporterNG; 23 23 import org.docx4j.convert.out.html.AbstractHtmlExporter.HtmlSettings; 24 import org.docx4j.dml.CTTextCharacterProperties; 24 25 import org.docx4j.dml.CTTextListStyle; 25 26 import org.docx4j.dml.CTTextParagraphProperties; … … 36 37 import org.docx4j.wml.PPr; 37 38 import org.docx4j.wml.Pict; 39 import org.docx4j.wml.RPr; 40 //import org.docx4j.wml.RPr; 38 41 import org.docx4j.wml.Style; 39 42 import org.plutext.jaxb.svg11.Line; … … 131 134 String pStyleVal; 132 135 136 System.out.println("cNvPrName: " + cNvPrName + "; " + "phType: " + phType ); 137 133 138 if (cNvPrName.toLowerCase().indexOf("subtitle")>-1 134 139 || phType.toLowerCase().indexOf("subtitle")>-1) { … … 139 144 pStyleVal = "Lvl" + level + "Master" + rl.getMasterNumber() + "Title"; 140 145 } else { 141 pStyleVal = "Lvl" + level + "Master" + rl.getMasterNumber() + "Body"; 142 } 146 // eg cNvPrName: TextBox 2; phType: 147 pStyleVal = "Lvl" + level + "Master" + rl.getMasterNumber() + "Other"; 148 } 149 System.out.println("--> " + pStyleVal ); 143 150 144 151 try { … … 291 298 292 299 } 293 294 // public static CTTextListStyle unmarshalFormatting(NodeIterator lstStyleNodeIt ) { 300 301 public static DocumentFragment createBlockForR( 302 PresentationMLPackage pmlPackage, NodeIterator rPrNodeIt, 303 NodeIterator childResults) { 304 305 DocumentFragment docfrag = null; 306 Document d = null; 307 Element span = null; 308 309 try { 310 311 // Create a DOM builder and parse the fragment 312 DocumentBuilderFactory factory = DocumentBuilderFactory 313 .newInstance(); 314 d = factory.newDocumentBuilder().newDocument(); 315 316 span = d.createElement("span"); 317 d.appendChild(span); 318 319 CTTextCharacterProperties textCharProps = (CTTextCharacterProperties) nodeToObjectModel( 320 rPrNodeIt.nextNode(), CTTextCharacterProperties.class); 321 322 RPr rPr = TextStyles.getWmlRPr(textCharProps); 323 324 // Does our rPr contain anything else? 325 StringBuffer inlineStyle = new StringBuffer(); 326 HtmlExporterNG.createCss(pmlPackage, rPr, inlineStyle); 327 if (!inlineStyle.toString().equals("")) { 328 span.setAttribute("style", inlineStyle.toString()); 329 } 330 331 Node n = childResults.nextNode(); 332 XmlUtils.treeCopy((DTMNodeProxy) n, span); 333 334 } catch (Exception e) { 335 e.printStackTrace(); 336 log.error(e); 337 // If something went wrong with the formatting, 338 // still try to display the text! 339 Node n = childResults.nextNode(); 340 XmlUtils.treeCopy((DTMNodeProxy) n, span); 341 } 342 343 // Machinery 344 docfrag = d.createDocumentFragment(); 345 docfrag.appendChild(d.getDocumentElement()); 346 return docfrag; 347 348 } 349 350 // public static CTTextListStyle unmarshalFormatting(NodeIterator lstStyleNodeIt ) { 295 351 // 296 352 // // Get the pPr node as a JAXB object, … … 467 523 468 524 public static Object nodeToObjectModel(Node n, Class declaredType) throws Docx4JException { 525 526 if (n==null) { 527 throw new Docx4JException("null input"); 528 } 529 530 // if (log.isDebugEnabled() ) { 531 // System.out.println("IN: " + XmlUtils.w3CDomNodeToString(n)); 532 // } 533 469 534 Object jaxb=null; 470 535 try {
Note: See TracChangeset
for help on using the changeset viewer.
