Tag: cws_src680_rpt23fix02
User: tmorgner
Date: 2007-07-30 13:08:52+0000
Modified:
   dba/reportdesign/java/com/sun/star/report/pentaho/configuration.properties
   
dba/reportdesign/java/com/sun/star/report/pentaho/output/OfficeDocumentReportTarget.java
   
dba/reportdesign/java/com/sun/star/report/pentaho/output/text/TextRawReportTarget.java
   
dba/reportdesign/java/com/sun/star/report/pentaho/parser/text/TextContentReadHandler.java

Log:
 Issue number:  80157
 
 Keep-Together is now applied to the paragraph-style instead of the cell-style.
 However, as cell-styles dont (yet) get inherited if the paragraph has a style
 defined, this now breaks the fonts of the first cell. Either we or the text/
 style team should fix or work around this issue.
 
 Also fixed: 
 A possible nullpointer if the image-data is invalid.
 
 

File Changes:

Directory: /dba/reportdesign/java/com/sun/star/report/pentaho/
==============================================================

File [changed]: configuration.properties
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/java/com/sun/star/report/pentaho/configuration.properties?r1=1.2.4.1&r2=1.2.4.2
Delta lines:  +4 -2
-------------------
--- configuration.properties    2007-07-25 15:05:45+0000        1.2.4.1
+++ configuration.properties    2007-07-30 13:08:49+0000        1.2.4.2
@@ -4,9 +4,9 @@
 #
 #   $RCSfile: configuration.properties,v $
 #
-#   $Revision: 1.2.4.1 $
+#   $Revision: 1.2.4.2 $
 #
-#   last change: $Author: tmorgner $ $Date: 2007/07/25 15:05:45 $
+#   last change: $Author: tmorgner $ $Date: 2007/07/30 13:08:49 $
 #
 #   The Contents of this file are made available subject to
 #   the terms of GNU Lesser General Public License Version 2.1.
@@ -139,6 +139,8 @@
 com.sun.star.report.pentaho.output.default.oasis-data=allow
 com.sun.star.report.pentaho.output.tag.oasis-data.text=deny
 
+com.sun.star.report.pentaho.output.namespace.oasis-draw=urn:oasis:names:tc:opendocument:xmlns:drawing:1.0
+com.sun.star.report.pentaho.output.default.oasis-draw=deny
 
 
org.jfree.report.flow.structure.com.sun.star.report.pentaho.model.FixedTextElement=com.sun.star.report.pentaho.layoutprocessor.FixedTextLayoutController
 
org.jfree.report.flow.structure.com.sun.star.report.pentaho.model.FormattedTextElement=com.sun.star.report.pentaho.layoutprocessor.FormattedTextLayoutController

Directory: /dba/reportdesign/java/com/sun/star/report/pentaho/output/
=====================================================================

File [changed]: OfficeDocumentReportTarget.java
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/java/com/sun/star/report/pentaho/output/OfficeDocumentReportTarget.java?r1=1.2.4.1&r2=1.2.4.2
Delta lines:  +86 -74
---------------------
--- OfficeDocumentReportTarget.java     2007-07-25 15:05:46+0000        1.2.4.1
+++ OfficeDocumentReportTarget.java     2007-07-30 13:08:49+0000        1.2.4.2
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: OfficeDocumentReportTarget.java,v $
  *
- *  $Revision: 1.2.4.1 $
+ *  $Revision: 1.2.4.2 $
  *
- *  last change: $Author: tmorgner $ $Date: 2007/07/25 15:05:46 $
+ *  last change: $Author: tmorgner $ $Date: 2007/07/30 13:08:49 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -1253,6 +1253,10 @@
       final CSSNumericValue height = image.getHeight(); // always in 100th of 
a mm
 
       Log.debug("Image " + imageData + " Width: " + width + ", Height: " + 
height);
+      if (width == null || height == null)
+      {
+        return;
+      }
 
       CSSNumericValue imageAreaWidthVal;
       CSSNumericValue imageAreaHeightVal;
@@ -1262,6 +1266,13 @@
         imageAreaWidthVal = computeImageWidth(imageContext);
         imageAreaHeightVal = computeImageHeight(imageContext);
 
+        if (imageAreaWidthVal == null || imageAreaHeightVal == null)
+        {
+          Log.debug ("Image data returned from context is invalid. Maybe this 
is not an image?");
+          return;
+        }
+        else
+        {
         // compute the clip-area ..
         final CSSNumericValue normalizedImageWidth =
             CSSValueResolverUtility.convertLength(width, 
imageAreaWidthVal.getType());
@@ -1338,6 +1349,7 @@
             imageAreaHeightVal = normalizedImageHeight;
           }
         }
+        }
         // If we do scale, then we simply use the given image-area-size as 
valid image size and dont
         // care about the image itself ..
       }

Directory: /dba/reportdesign/java/com/sun/star/report/pentaho/output/text/
==========================================================================

File [changed]: TextRawReportTarget.java
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/java/com/sun/star/report/pentaho/output/text/TextRawReportTarget.java?r1=1.2.4.4&r2=1.2.4.5
Delta lines:  +49 -42
---------------------
--- TextRawReportTarget.java    2007-07-26 12:27:36+0000        1.2.4.4
+++ TextRawReportTarget.java    2007-07-30 13:08:49+0000        1.2.4.5
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: TextRawReportTarget.java,v $
  *
- *  $Revision: 1.2.4.4 $
+ *  $Revision: 1.2.4.5 $
  *
- *  last change: $Author: tmorgner $ $Date: 2007/07/26 12:27:36 $
+ *  last change: $Author: tmorgner $ $Date: 2007/07/30 13:08:49 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -71,7 +71,7 @@
 import org.jfree.resourceloader.ResourceManager;
 import org.jfree.util.FastStack;
 import org.jfree.util.ObjectUtilities;
-import org.jfree.util.Log;
+//import org.jfree.util.Log;
 import org.jfree.xmlns.common.AttributeList;
 import org.jfree.xmlns.writer.XmlWriter;
 import org.jfree.xmlns.writer.XmlWriterSupport;
@@ -129,6 +129,7 @@
   private int tableLayoutConfig;
   private int expectedTableRowCount;
   private boolean firstCellSeen;
+  private boolean cellEmpty;
 
   public TextRawReportTarget(final ReportJob reportJob,
                              final ResourceManager resourceManager,
@@ -620,7 +621,7 @@
     {
       // This cannot happen as long as the report sections only contain 
tables. But at some point in the
       // future they will be made of paragraphs, and then we are prepared ..
-//      Log.debug("Variables-Section in own paragraph " + variables);
+      // Log.debug("Variables-Section in own paragraph " + variables);
 
       StyleUtilities.copyStyle("paragraph",
           TextRawReportTarget.VARIABLES_HIDDEN_STYLE_WITH_KEEPWNEXT, 
getStylesCollection(),
@@ -632,8 +633,15 @@
       variables = null;
     }
 
-    if (firstCellSeen == false && sectionKeepTogether &&
-        ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, 
"table-cell", attrs))
+    if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, 
"table-cell", attrs))
+    {
+      cellEmpty = true;
+    }
+
+    if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TEXT_NS, "p", attrs))
+    {
+      cellEmpty = false;
+      if (firstCellSeen == false && sectionKeepTogether)
     {
       final String styleName = (String) 
attrs.getAttribute(OfficeNamespaces.TEXT_NS, "style-name");
       final OfficeStyle style = deriveStyle("paragraph", styleName);
@@ -657,26 +665,29 @@
         paragraphProps.setAttribute(OfficeNamespaces.FO_NS, "keep-with-next", 
"always");
       }
 
-      attrs.setAttribute(OfficeNamespaces.TABLE_NS, "style-name", 
style.getStyleName());
+        attrs.setAttribute(OfficeNamespaces.TEXT_NS, "style-name", 
style.getStyleName());
+      }
     }
 
     // process the styles as usual
     performStyleProcessing(attrs);
 
     final AttributeList attrList = buildAttributeList(attrs);
-    xmlWriter.writeTag(namespace, elementType, attrList,
-        XmlWriterSupport.OPEN);
+    xmlWriter.writeTag(namespace, elementType, attrList, 
XmlWriterSupport.OPEN);
 
-    if (tableLayoutConfig != TABLE_LAYOUT_VARIABLES_PARAGRAPH &&
-        ReportTargetUtil.isElementOfType(OfficeNamespaces.TEXT_NS, "p", attrs))
+    if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TEXT_NS, "p", attrs))
+    {
+      cellEmpty = false;
+      if (tableLayoutConfig != TABLE_LAYOUT_VARIABLES_PARAGRAPH)
     {
       if (variables != null)
       {
-//        Log.debug("Variables-Section in existing cell " + variables);
+          //Log.debug("Variables-Section in existing cell " + variables);
         xmlWriter.writeText(variables);
         variables = null;
       }
     }
+    }
 
   }
 
@@ -721,11 +732,6 @@
       expectedTableRowCount = trc.intValue();
     }
 
-    if (getCurrentRole() == ROLE_REPORT_FOOTER)
-    {
-      Log.debug ("HERE");
-    }
-
     if (isSectionPagebreakBefore(attrs))
     {
       // force a pagebreak ..
@@ -1275,7 +1281,7 @@
       {
         // This cannot happen as long as the report sections only contain 
tables. But at some point in the
         // future they will be made of paragraphs, and then we are prepared ..
-//        Log.debug("Variables-Section " + variables);
+        //Log.debug("Variables-Section " + variables);
         if (sectionKeepTogether == true && expectedTableRowCount > 0)
         {
           StyleUtilities.copyStyle("paragraph",
@@ -1300,7 +1306,8 @@
         }
       }
       // Only generate the empty paragraph, if we have to add the 
keep-together ..
-      else if (expectedTableRowCount > 0 && sectionKeepTogether == true && 
firstCellSeen == false)
+      else if (cellEmpty && expectedTableRowCount > 0 &&
+          sectionKeepTogether == true && firstCellSeen == false)
       {
         // we have no variables ..
         StyleUtilities.copyStyle("paragraph",

Directory: /dba/reportdesign/java/com/sun/star/report/pentaho/parser/text/
==========================================================================

File [changed]: TextContentReadHandler.java
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/java/com/sun/star/report/pentaho/parser/text/TextContentReadHandler.java?r1=1.2&r2=1.2.4.1
Delta lines:  +3 -4
-------------------
--- TextContentReadHandler.java 2007-07-09 11:56:12+0000        1.2
+++ TextContentReadHandler.java 2007-07-30 13:08:50+0000        1.2.4.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: TextContentReadHandler.java,v $
  *
- *  $Revision: 1.2 $
+ *  $Revision: 1.2.4.1 $
  *
- *  last change: $Author: rt $ $Date: 2007/07/09 11:56:12 $
+ *  last change: $Author: tmorgner $ $Date: 2007/07/30 13:08:50 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -38,12 +38,11 @@
 
 import java.util.ArrayList;
 
+import com.sun.star.report.pentaho.OfficeNamespaces;
 import com.sun.star.report.pentaho.parser.ElementReadHandler;
-import com.sun.star.report.pentaho.parser.StarXmlFactoryModule;
 import com.sun.star.report.pentaho.parser.rpt.FixedContentReadHandler;
 import com.sun.star.report.pentaho.parser.rpt.FormattedTextReadHandler;
 import com.sun.star.report.pentaho.parser.rpt.ImageReadHandler;
-import com.sun.star.report.pentaho.OfficeNamespaces;
 import org.jfree.report.structure.Element;
 import org.jfree.report.structure.Section;
 import org.jfree.report.structure.StaticText;




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to