Tag: mws_bea300
User: obo     
Date: 2008-04-28 15:19:04+0000
Modified:
   
dba/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/TableCellLayoutController.java

Log:
 INTEGRATION: CWS dba30beta_BEA300 (1.3.6); FILE MERGED
 2008/04/22 10:30:26 oj 1.3.6.1: #i88503# merge changes from rptchart02

File Changes:

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

File [changed]: TableCellLayoutController.java
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/TableCellLayoutController.java?r1=1.3&r2=1.3.4.1
Delta lines:  +105 -122
-----------------------
--- TableCellLayoutController.java      2008-04-10 17:26:42+0000        1.3
+++ TableCellLayoutController.java      2008-04-28 15:19:01+0000        1.3.4.1
@@ -27,11 +27,10 @@
  * for a copy of the LGPLv3 License.
  *
  ************************************************************************/
-
-
 package com.sun.star.report.pentaho.layoutprocessor;
 
 import com.sun.star.report.pentaho.OfficeNamespaces;
+import com.sun.star.report.OfficeToken;
 import com.sun.star.report.pentaho.model.FormatCondition;
 import com.sun.star.report.pentaho.model.FormattedTextElement;
 import com.sun.star.report.pentaho.model.ReportElement;
@@ -59,6 +58,7 @@
  */
 public class TableCellLayoutController extends SectionLayoutController
 {
+
   public TableCellLayoutController()
   {
   }
@@ -69,8 +69,8 @@
       throws DataSourceException
   {
     final AttributeMap attributeMap = super.computeAttributes(fc, element, 
target);
-    final String definedStyle = (String) 
attributeMap.getAttribute(OfficeNamespaces.TABLE_NS, "style-name");
-    attributeMap.setAttribute(OfficeNamespaces.TABLE_NS, "style-name", 
getDisplayStyleName((Section) element, definedStyle));
+        final String definedStyle = (String) 
attributeMap.getAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME);
+        attributeMap.setAttribute(OfficeNamespaces.TABLE_NS, 
OfficeToken.STYLE_NAME, getDisplayStyleName((Section) element, definedStyle));
 
     try
     {
@@ -109,7 +109,7 @@
       {
         return (FormattedTextElement) node;
       }
-      if (node instanceof Section)
+            else if (node instanceof Section)
       {
         final FormattedTextElement retval = findFormattedTextElement((Section) 
node);
         if (retval != null)
@@ -124,11 +124,7 @@
   private String getDisplayStyleName(final Section section,
                                      final String defaultStyle)
   {
-    if (section.isEnabled() == false)
-    {
-      return defaultStyle;
-    }
-    if (section.getNodeCount() == 0)
+        if (!section.isEnabled() || section.getNodeCount() == 0)
     {
       return defaultStyle;
     }
@@ -137,26 +133,17 @@
     for (int i = 0; i < nodes.length; i++)
     {
       final Node child = nodes[i];
-      if (child instanceof ReportElement)
+            if (child instanceof ReportElement && child.isEnabled())
       {
         final ReportElement element = (ReportElement) child;
-        if (element.isEnabled() == false)
-        {
-          continue;
-        }
-
-        if (element.getFormatConditionCount() == 0)
+                if (element.getFormatConditionCount() > 0)
         {
-          continue;
-        }
-
         final Expression displayCond = element.getDisplayCondition();
         if (displayCond != null)
         {
           try
           {
-            if (Boolean.FALSE.equals(LayoutControllerUtil.evaluateExpression
-                (getFlowController(), element, displayCond)))
+                            if 
(Boolean.FALSE.equals(LayoutControllerUtil.evaluateExpression(getFlowController(),
 element, displayCond)))
             {
               continue;
             }
@@ -171,15 +158,11 @@
         for (int j = 0; j < conditions.length; j++)
         {
           final FormatCondition formCond = conditions[j];
-          if (formCond.isEnabled() == false)
+                        if (formCond.isEnabled())
           {
-            continue;
-          }
-
           try
           {
-            final Object o = LayoutControllerUtil.evaluateExpression
-                (getFlowController(), element, formCond.getFormula());
+                                final Object o = 
LayoutControllerUtil.evaluateExpression(getFlowController(), element, 
formCond.getFormula());
             if (Boolean.TRUE.equals(o))
             {
               return formCond.getStyleName();
@@ -191,12 +174,14 @@
           }
         }
       }
+                }
+            }
 
       if (child instanceof Section)
       {
         final String childFormatCondition =
             getDisplayStyleName((Section) child, defaultStyle);
-        if (ObjectUtilities.equal(childFormatCondition, defaultStyle) == false)
+                if (!ObjectUtilities.equal(childFormatCondition, defaultStyle))
         {
           return childFormatCondition;
         }
@@ -204,6 +189,4 @@
     }
     return defaultStyle;
   }
-
-
 }




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

Reply via email to