[jboss-cvs] jboss-seam/src/pdf/org/jboss/seam/pdf/ui ...
Norman Richards
norman.richards at jboss.com
Wed Mar 7 00:41:26 EST 2007
User: nrichards
Date: 07/03/07 00:41:26
Modified: src/pdf/org/jboss/seam/pdf/ui ITextComponent.java
UIPage.java
Log:
JBSEAM-988: itext 2 and entities
Revision Changes Path
1.10 +7 -13 jboss-seam/src/pdf/org/jboss/seam/pdf/ui/ITextComponent.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ITextComponent.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/pdf/org/jboss/seam/pdf/ui/ITextComponent.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- ITextComponent.java 7 Feb 2007 07:15:13 -0000 1.9
+++ ITextComponent.java 7 Mar 2007 05:41:26 -0000 1.10
@@ -7,9 +7,12 @@
import java.io.*;
import java.util.List;
+
+import org.jboss.seam.pdf.EntitiesToEncode;
import org.jboss.seam.ui.JSF;
import com.lowagie.text.*;
+//import com.lowagie.text.xml.simpleparser.EntitiesToUnicode;
public abstract class ITextComponent
extends UIComponentBase
@@ -223,19 +226,10 @@
* sufficient.
*/
private String replaceEntities(String text) {
- StringBuffer buffer = new StringBuffer(text);
-
- replaceAll(buffer, """, "\"");
- // XXX - etc....
-
- return buffer.toString();
- }
-
- private void replaceAll(StringBuffer buffer, String original, String changeTo) {
- int pos;
- while ((pos = buffer.indexOf(original)) != -1) {
- buffer.replace(pos,pos+original.length(), changeTo);
- }
+ System.out.println("PRE:" + text);
+ String result = EntitiesToEncode.decodeString(text);
+ System.out.println("POST: " + result);
+ return result;
}
1.7 +1 -5 jboss-seam/src/pdf/org/jboss/seam/pdf/ui/UIPage.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: UIPage.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/pdf/org/jboss/seam/pdf/ui/UIPage.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- UIPage.java 20 Feb 2007 04:06:09 -0000 1.6
+++ UIPage.java 7 Mar 2007 05:41:26 -0000 1.7
@@ -38,11 +38,7 @@
super.encodeBegin(context);
Document document = findDocument();
if (document != null) {
- try {
document.newPage();
- } catch (DocumentException e) {
- throw new RuntimeException(e);
- }
} else {
throw new IllegalArgumentException("Cannot find parent document");
}
More information about the jboss-cvs-commits
mailing list