User: kz      
Date: 2008-05-05 13:46:26+0000
Modified:
   
dba/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/AbstractReportElementLayoutController.java

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

File Changes:

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

File [changed]: AbstractReportElementLayoutController.java
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/AbstractReportElementLayoutController.java?r1=1.3&r2=1.4
Delta lines:  +183 -203
-----------------------
--- AbstractReportElementLayoutController.java  2008-04-10 17:22:38+0000        
1.3
+++ AbstractReportElementLayoutController.java  2008-05-05 13:46:23+0000        
1.4
@@ -27,8 +27,6 @@
  * for a copy of the LGPLv3 License.
  *
  ************************************************************************/
-
-
 package com.sun.star.report.pentaho.layoutprocessor;
 
 import com.sun.star.report.pentaho.model.ReportElement;
@@ -60,16 +58,15 @@
 public abstract class AbstractReportElementLayoutController
     extends AbstractLayoutController
 {
+
   public static final int NOT_STARTED = 0;
   public static final int FINISHED = 2;
-
   private int state;
 
   protected AbstractReportElementLayoutController()
   {
   }
 
-
   /**
    * Advances the processing position.
    *
@@ -99,36 +96,24 @@
     //
     //    Whether we use the next one or the one after that depends on whether
     //    this element is a child of a group-header or group-footer.
-    if (text.isPrintWhenGroupChanges())
-    {
-      // if this is set to true, then we print the element only if this is the
-      // first occurrence in this group.
-      if (isGroupChanged() == false)
-      {
-//        Log.debug ("Group Change Condition");
-        isPrintableContent = false;
-      }
-    }
 
     // 2. Print repeated values. This never applies to static text or static
     //    elements.
-    if (text.isPrintRepeatedValues() == false)
+        if ((text.isPrintWhenGroupChanges() && !isGroupChanged()) || 
(!text.isPrintRepeatedValues() && !isValueChanged()))
     {
+            // if this is set to true, then we print the element only if this 
is the
+            // first occurrence in this group.
+            // or
       // If this is set to true, we evaluate the formula of the element and
       // try to derive whether there was a change.
-      if (isValueChanged() == false)
-      {
-//        Log.debug ("Value Repeat Condition");
         isPrintableContent = false;
       }
-    }
 
     // 3. Evaluate the Display Condition
     final Expression dc = text.getDisplayCondition();
     if (dc != null)
     {
-      final Object o = LayoutControllerUtil.evaluateExpression
-          (getFlowController(), text, dc);
+            final Object o = 
LayoutControllerUtil.evaluateExpression(getFlowController(), text, dc);
       if (Boolean.FALSE.equals(o))
       {
 //        Log.debug ("DISPLAY Condition forbids printing");
@@ -136,10 +121,10 @@
       }
     }
 
-    if (isPrintableContent == false)
+        if (!isPrintableContent)
     {
       // There is no printable content at all. Set the state to FINISHED
-      return join (getFlowController());
+            return join(getFlowController());
     }
     else
     {
@@ -172,12 +157,12 @@
     boolean skipNext = false;
     while (parent != null)
     {
-      if (parent instanceof SectionLayoutController == false)
+            if (!(parent instanceof SectionLayoutController))
       {
         parent = parent.getParent();
-        continue;
       }
-
+            else
+            {
       final SectionLayoutController slc = (SectionLayoutController) parent;
       final Element element = slc.getElement();
       if (element instanceof OfficeGroupSection)
@@ -185,24 +170,22 @@
         // This is a header or footer. So we take the next group instead.
         skipNext = true;
         parent = parent.getParent();
-        continue;
       }
-
-      if (element instanceof Group == false)
+                else if (!(element instanceof Group))
       {
         parent = parent.getParent();
-        continue;
       }
-
-      if (skipNext)
+                else if (skipNext)
       {
         skipNext = false;
         parent = parent.getParent();
-        continue;
       }
-
+                else
+                {
       return (SectionLayoutController) parent;
     }
+            }
+        }
     return null;
   }
 
@@ -225,7 +208,7 @@
     return alc;
   }
 
-  protected abstract LayoutController delegateContentGeneration (final 
ReportTarget target)
+    protected abstract LayoutController delegateContentGeneration(final 
ReportTarget target)
       throws ReportProcessingException, ReportDataFactoryException,
       DataSourceException;
 
@@ -240,7 +223,7 @@
     return state != AbstractReportElementLayoutController.FINISHED;
   }
 
-  protected boolean isReferenceChanged (final LValue lValue)
+    protected boolean isReferenceChanged(final LValue lValue)
   {
     if (lValue instanceof ContextLookup)
     {
@@ -250,14 +233,11 @@
       try
       {
         final DataFlags flags = view.getFlags(s);
-        if (flags != null)
-        {
-          if (flags.isChanged())
+                if (flags != null && flags.isChanged())
           {
 //            Log.debug ("Reference " + s + " is changed");
             return true;
           }
-        }
 //        Log.debug ("Reference " + s + " is unchanged");
       }
       catch (DataSourceException e)




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

Reply via email to