User: hr      
Date: 2007-08-03 09:49:17+0000
Modified:
   
dba/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/FormattedTextLayoutController.java

Log:
 INTEGRATION: CWS rpt23fix02 (1.2.4); FILE MERGED
 2007/07/24 17:19:27 tmorgner 1.2.4.1: Issue number:  #78502, #77039
 
 The formatted-text-layout controller did not look for the correct node,
 and therefore never found the expected 'office:value-type' attribute.
 This now fixes the #78502 bug, and possibly addresses the #77039 bug as
 well (although this bug might be connected to a writer-bug).
 
 Fixed the repositories so that the StorageRepository does no longer log
 exceptions whenever we test for an non-existing file. We expect the
 exception and can safely swallow it here.
 
 The FileRepository now maintains its own manifest for all files that
 are written. This class is needed for all test-runs outside of OpenOffice.

File Changes:

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

File [changed]: FormattedTextLayoutController.java
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/FormattedTextLayoutController.java?r1=1.2&r2=1.3
Delta lines:  +7 -39
--------------------
--- FormattedTextLayoutController.java  2007-07-09 11:56:05+0000        1.2
+++ FormattedTextLayoutController.java  2007-08-03 09:49:15+0000        1.3
@@ -64,43 +64,10 @@
 public class FormattedTextLayoutController
     extends AbstractReportElementLayoutController
 {
-//  private Boolean inRepeatingSection;
-
   public FormattedTextLayoutController()
   {
   }
 
-//  private boolean isInRepeatingSection ()
-//  {
-//    if (inRepeatingSection == null)
-//    {
-//      LayoutController parent = getParent();
-//      while (parent != null && inRepeatingSection == null)
-//      {
-//        if (parent instanceof OfficeRepeatingStructureLayoutController)
-//        {
-//          final OfficeRepeatingStructureLayoutController orslc =
-//              (OfficeRepeatingStructureLayoutController) parent;
-//          if (orslc.isNormalFlowProcessing())
-//          {
-//            inRepeatingSection = Boolean.FALSE;
-//          }
-//          else
-//          {
-//            inRepeatingSection = Boolean.TRUE;
-//          }
-//        }
-//        parent = parent.getParent();
-//      }
-//
-//      if (inRepeatingSection == null)
-//      {
-//        inRepeatingSection = Boolean.FALSE;
-//      }
-//    }
-//    return inRepeatingSection.booleanValue();
-//  }
-
   private VariablesCollection getVariablesCollection()
   {
     LayoutController parent = getParent();
@@ -179,9 +146,9 @@
     LayoutController parent = getParent();
     while (parent != null)
     {
-      if (parent instanceof ElementLayoutController)
+      if (parent instanceof TableCellLayoutController)
       {
-        final ElementLayoutController cellController = 
(ElementLayoutController) parent;
+        final TableCellLayoutController cellController = 
(TableCellLayoutController) parent;
         return cellController.getElement();
       }
       parent = parent.getParent();
@@ -195,12 +162,13 @@
     if (tce == null)
     {
       // NO particular format means: Fallback to string and hope and pray ..
-      return "string";
+      throw new IllegalStateException("A formatted text element must be a 
child of a Table-Cell.");
     }
 
     final String type = (String) tce.getAttribute(OfficeNamespaces.OFFICE_NS, 
"value-type");
     if (type == null)
     {
+      Log.error ("The Table-Cell does not have a office:value attribute 
defined. Your content will be messed up.");
       return "string";
     }
     return type;




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

Reply via email to