You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by je...@apache.org on 2004/11/01 13:39:14 UTC

cvs commit: xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc RtfTableRow.java

jeremias    2004/11/01 04:39:14

  Modified:    src/java/org/apache/fop/render/rtf
                        TextAttributesConverter.java
                        TableAttributesConverter.java
               src/java/org/apache/fop/render/rtf/rtflib/rtfdoc
                        RtfTableRow.java
  Log:
  Avoid with certain NPEs.
  
  Revision  Changes    Path
  1.21      +5 -4      xml-fop/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java
  
  Index: TextAttributesConverter.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- TextAttributesConverter.java	1 Nov 2004 09:32:25 -0000	1.20
  +++ TextAttributesConverter.java	1 Nov 2004 12:39:14 -0000	1.21
  @@ -132,7 +132,7 @@
       private static void attrFont(CommonFont font, FOPRtfAttributes rtfAttr) {
           rtfAttr.set(RtfText.ATTR_FONT_FAMILY,
                   RtfFontManager.getInstance().getFontNumber(font.fontFamily));
  -        rtfAttr.set("fs", font.fontSize);
  +        rtfAttr.set(RtfText.ATTR_FONT_SIZE, font.fontSize);
   
           if (font.fontWeight.equals("bold") || font.fontWeight.equals("700")) {
               rtfAttr.set("b", 1);
  @@ -230,10 +230,11 @@
              default here. Changing FOP's default to "white" causes problems in
              PDF output, so we will look for the default here & change it to
              "auto". */
  -        if ((fopValue.getRed() == 0)
  +        if ((fopValue == null)
  +                || ((fopValue.getRed() == 0)
                   && (fopValue.getGreen() == 0)
                   && (fopValue.getBlue() == 0)
  -                && (fopValue.getAlpha() == 0)) {
  +                && (fopValue.getAlpha() == 0))) {
               return;
           } else {
               rtfColor = convertFOPColorToRTF(fopValue);
  
  
  
  1.22      +6 -5      xml-fop/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java
  
  Index: TableAttributesConverter.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- TableAttributesConverter.java	28 Oct 2004 15:21:54 -0000	1.21
  +++ TableAttributesConverter.java	1 Nov 2004 12:39:14 -0000	1.22
  @@ -119,10 +119,11 @@
   
           // Cell background color
           ColorType color = fobj.getCommonBorderPaddingBackground().backgroundColor;
  -        if (color.getAlpha() != 0
  -               || color.getRed() != 0
  -               || color.getGreen() != 0
  -               || color.getBlue() != 0) {
  +        if ((color != null) 
  +                && (color.getAlpha() != 0
  +                        || color.getRed() != 0
  +                        || color.getGreen() != 0
  +                        || color.getBlue() != 0)) {
               attrib.set(ITableAttributes.CELL_COLOR_BACKGROUND, color);
           }
   
  
  
  
  1.7       +2 -2      xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java
  
  Index: RtfTableRow.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- RtfTableRow.java	27 Feb 2004 17:54:01 -0000	1.6
  +++ RtfTableRow.java	1 Nov 2004 12:39:14 -0000	1.7
  @@ -264,7 +264,7 @@
                       }
                   }
   
  -                if (parentTable.isHighestRow(id)) {
  +                if ((parentTable != null) && (parentTable.isHighestRow(id))) {
                       if (!cell.getRtfAttributes().isSet(ITableAttributes.CELL_BORDER_BOTTOM)) {
                           cell.getRtfAttributes().set(ITableAttributes.CELL_BORDER_BOTTOM,
                               (String)attrib.getValue(ITableAttributes.ROW_BORDER_BOTTOM));
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-cvs-help@xml.apache.org