User: rt      
Date: 2008-06-16 13:15:46+0000
Modified:
   
dba/reportdesign/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportTarget.java

Log:
 INTEGRATION: CWS rptchart02 (1.5.4); FILE MERGED
 2008/05/21 11:56:42 oj 1.5.4.7: RESYNC: (1.6-1.7); FILE MERGED
 2008/04/25 06:37:59 oj 1.5.4.6: #i85660# remove table-cell-properties when the 
background is transparent
 2008/04/24 11:34:50 oj 1.5.4.5: paragraph handling corrected
 2008/04/21 12:53:37 oj 1.5.4.4: export chart for spreadsheet and set default 
command type as command
 2008/04/16 06:23:50 oj 1.5.4.3: RESYNC: (1.5-1.6); FILE MERGED
 2008/04/03 11:59:20 oj 1.5.4.2: export frames of ole object with special style
 2008/03/12 09:42:52 oj 1.5.4.1: impl chart handling and some code refactoring

File Changes:

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

File [changed]: SpreadsheetRawReportTarget.java
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportTarget.java?r1=1.7&r2=1.8
Delta lines:  +51 -28
---------------------
--- SpreadsheetRawReportTarget.java     2008-05-05 14:39:32+0000        1.7
+++ SpreadsheetRawReportTarget.java     2008-06-16 13:15:43+0000        1.8
@@ -200,7 +200,7 @@
         }
 
         final String elementType = 
ReportTargetUtil.getElemenTypeFromAttribute(attrs);
-        if (OfficeNamespaces.TEXT_NS.equals(namespace) && 
OfficeToken.P.equals(elementType))
+        if (OfficeNamespaces.TEXT_NS.equals(namespace) && 
OfficeToken.P.equals(elementType) && !paragraphHandled)
         {
             paragraphFound = true;
             return;
@@ -211,7 +211,6 @@
             if (isElementBoundaryCollectionPass() && getCurrentRole() != 
ROLE_TEMPLATE)
             {
                 final LengthCalculator len = new LengthCalculator();
-                double val = 0.0;
                 for (int i = 0; i < rowHeights.size(); i++)
                 {
                     len.add((CSSNumericValue) rowHeights.get(i));
@@ -308,6 +307,7 @@
                 final XmlWriter xmlWriter = getXmlWriter();
                 xmlWriter.writeTag(OfficeNamespaces.TEXT_NS, OfficeToken.P, 
null, XmlWriterSupport.OPEN);
                 paragraphHandled = true;
+                paragraphFound = false;
             }
             catch (IOException ex)
             {
@@ -409,6 +409,24 @@
         else if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, 
OfficeToken.TABLE_CELL, attrs))
         {
             columnCounter++;
+            final String styleName = (String) 
attrs.getAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME);
+            if (styleName != null)
+            {
+                OfficeStyle cellStyle = 
getPredefinedStylesCollection().getStyle(OfficeToken.TABLE_CELL, styleName);
+                if (cellStyle != null)
+                {
+                    final Element props = cellStyle.getTableCellProperties();
+                    if (props != null)
+                    {
+                        final Object raw = 
props.getAttribute(OfficeNamespaces.FO_NS, OfficeToken.BACKGROUND_COLOR);
+                        if (raw == null || "transparent".equals(raw))
+                        {
+                            cellStyle.removeNode(props);
+                        }
+                    }
+                }
+            }
+
             final String numColSpanStr = (String) 
attrs.getAttribute(namespace, "number-columns-spanned");
             int initialColumnSpan = columnSpanCounter = 1;
             if (numColSpanStr != null)
@@ -523,6 +541,8 @@
 
     private void createTableShapes() throws ReportProcessingException
     {
+        if (!shapes.isEmpty())
+        {
         try
         {
             final XmlWriter xmlWriter = getXmlWriter();
@@ -551,6 +571,7 @@
             throw new ReportProcessingException("Failed", e);
         }
     }
+    }
 
     private void createTableColumns() throws ReportProcessingException
     {
@@ -603,8 +624,7 @@
             return;
         }
 
-        if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, 
OfficeToken.TABLE_ROW, attrs)
-                && isElementBoundaryCollectionPass() && getCurrentRole() != 
ROLE_TEMPLATE )
+        if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, 
OfficeToken.TABLE_ROW, attrs) && isElementBoundaryCollectionPass() && 
getCurrentRole() != ROLE_TEMPLATE)
         {
             final String styleName = (String) 
attrs.getAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME);
             rowHeights.add(computeRowHeight(styleName));
@@ -635,12 +655,15 @@
             return;
         }
 
-        if (!paragraphHandled && OfficeNamespaces.TEXT_NS.equals(namespace) && 
OfficeToken.P.equals(elementType))
+        if ( !paragraphHandled && OfficeNamespaces.TEXT_NS.equals(namespace) 
&& OfficeToken.P.equals(elementType))
+        {
+            if (!paragraphHandled)
         {
             return;
         }
 
         paragraphHandled = false;
+        }
         try
         {
             final XmlWriter xmlWriter = getXmlWriter();




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

Reply via email to