- Timestamp:
- 02/26/10 03:41:23 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/docx4j/src/pptx4j/java/org/pptx4j/model/TextStyles.java
r1061 r1087 33 33 import org.docx4j.UnitsOfMeasurement; 34 34 import org.docx4j.XmlUtils; 35 import org.docx4j.dml.CTTextCharacterProperties; 35 36 import org.docx4j.dml.CTTextListStyle; 36 37 import org.docx4j.dml.CTTextParagraphProperties; … … 45 46 import org.docx4j.openpackaging.parts.PresentationML.MainPresentationPart; 46 47 import org.docx4j.openpackaging.parts.PresentationML.SlideMasterPart; 48 import org.docx4j.wml.BooleanDefaultTrue; 47 49 import org.docx4j.wml.HpsMeasure; 48 50 import org.docx4j.wml.Jc; … … 54 56 import org.docx4j.wml.Style; 55 57 import org.docx4j.wml.Styles; 58 import org.docx4j.wml.U; 59 import org.docx4j.wml.UnderlineEnumeration; 56 60 import org.docx4j.wml.Style.Name; 57 61 import org.pptx4j.pml.CTSlideMasterTextStyles; … … 209 213 // <w:sz w:val="28" /> 210 214 if (lvlPPr.getDefRPr().getSz()!=null) { 211 HpsMeasure sz = factory.createHpsMeasure(); 212 int halfPts = Math.round(lvlPPr.getDefRPr().getSz()/50); 213 sz.setVal( BigInteger.valueOf(halfPts) ); 214 rPr.setSz(sz); 215 rPr.setSz( convertFontSize(lvlPPr.getDefRPr().getSz()) ); 215 216 } 216 217 … … 233 234 return rPr; 234 235 } 236 237 private static HpsMeasure convertFontSize(Integer in) { 238 ObjectFactory factory = Context.getWmlObjectFactory(); 239 HpsMeasure sz = factory.createHpsMeasure(); 240 int halfPts = Math.round(in/50); 241 sz.setVal( BigInteger.valueOf(halfPts) ); 242 return sz; 243 } 244 235 245 // From Main Presentation Part 236 246 public static List<Style> generateWordStylesFromPresentationPart(CTTextListStyle textStyles, String suffix, … … 346 356 } 347 357 348 358 public static RPr getWmlRPr(CTTextCharacterProperties in) { 359 360 ObjectFactory factory = Context.getWmlObjectFactory(); 361 RPr rPr = factory.createRPr(); 362 363 if (in==null) { 364 System.out.println("Was passed null"); 365 return rPr; 366 } 367 368 // <a:rPr i="true" /> 369 if (in.isI()!=null && in.isI()) { 370 rPr.setI( new BooleanDefaultTrue() ); 371 } 372 373 // <a:rPr b="true" 374 if (in.isB()!=null && in.isB()) { 375 rPr.setB( new BooleanDefaultTrue() ); 376 } 377 378 // <a:rPr u="sng" 379 if (in.getU()!=null) { 380 U u = factory.createU(); 381 u.setVal(UnderlineEnumeration.SINGLE); 382 rPr.setU(u); 383 } 384 // <a:rPr sz="4000" 385 if (in.getSz()!=null) { 386 rPr.setSz( 387 convertFontSize(in.getSz() ) ); 388 } 389 390 return rPr; 391 392 } 349 393 }
Note: See TracChangeset
for help on using the changeset viewer.
