[Libreoffice-commits] core.git: reportbuilder/java

Lionel Elie Mamane lionel at mamane.lu
Mon Aug 12 09:44:10 PDT 2013


 reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/FormattedTextLayoutController.java |   57 +++++-----
 1 file changed, 33 insertions(+), 24 deletions(-)

New commits:
commit fc92c1abebcfe9b18649d35b76bf22e001e332da
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Mon Aug 12 18:41:44 2013 +0200

    fdo#67930 don't use variables for formattedtext in header/footer
    
    I don't know why it was going through variables.
    Instead, put the value where it is supposed to,
    like for formattedtext in detail section.
    Try it, and if something breaks, we can revert.
    
    This also works around fdo#67930
    
    Change-Id: Ia7f08afd8a037d3ac75676c5221ddb36aa791354

diff --git a/reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/FormattedTextLayoutController.java b/reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/FormattedTextLayoutController.java
index dcc153c..5bda08b 100644
--- a/reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/FormattedTextLayoutController.java
+++ b/reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/FormattedTextLayoutController.java
@@ -100,30 +100,39 @@ public class FormattedTextLayoutController
             DataSourceException
     {
         final FormattedTextElement element = (FormattedTextElement) getNode();
-        final VariablesCollection vc = getVariablesCollection();
-        if (vc != null)
-        {
-            final String name = vc.addVariable(element);
-            final AttributeMap variablesGet = new AttributeMap();
-            variablesGet.setAttribute(JFreeReportInfo.REPORT_NAMESPACE,
-                    Element.TYPE_ATTRIBUTE, "variable-get");
-            variablesGet.setAttribute(JFreeReportInfo.REPORT_NAMESPACE,
-                    Element.NAMESPACE_ATTRIBUTE, OfficeNamespaces.TEXT_NS);
-            variablesGet.setAttribute(OfficeNamespaces.TEXT_NS, "name", name);
-
-            final String dataStyleName = computeValueStyle();
-            if (dataStyleName != null)
-            {
-                variablesGet.setAttribute(OfficeNamespaces.STYLE_NS, "data-style-name", dataStyleName);
-            }
-
-            final String valueType = computeValueType();
-            variablesGet.setAttribute(OfficeNamespaces.OFFICE_NS, FormatValueUtility.VALUE_TYPE, valueType);
-            target.startElement(variablesGet);
-
-            target.endElement(variablesGet);
-        }
-        else
+        // LEM 20130812 I have absolutely no clue why it wants to go via
+        // a variable like that. It complicates things, is fragile
+        // (because the variable-set is done in *every* detail section
+        //  again and again. This in itself is not that bad, but when
+        //  the detail section is of height zero, the "set" us never done...
+        //  and this whole schema fails). For now, keep the code in case
+        //  something break. If we survive the 4.2 cycle (in its entirety)
+        //  without regression traced to this, then remove it (for 4.4 or
+        //  something like that).
+        // final VariablesCollection vc = getVariablesCollection();
+        // if (vc != null)
+        // {
+        //     final String name = vc.addVariable(element);
+        //     final AttributeMap variablesGet = new AttributeMap();
+        //     variablesGet.setAttribute(JFreeReportInfo.REPORT_NAMESPACE,
+        //             Element.TYPE_ATTRIBUTE, "variable-get");
+        //     variablesGet.setAttribute(JFreeReportInfo.REPORT_NAMESPACE,
+        //             Element.NAMESPACE_ATTRIBUTE, OfficeNamespaces.TEXT_NS);
+        //     variablesGet.setAttribute(OfficeNamespaces.TEXT_NS, "name", name);
+
+        //     final String dataStyleName = computeValueStyle();
+        //     if (dataStyleName != null)
+        //     {
+        //         variablesGet.setAttribute(OfficeNamespaces.STYLE_NS, "data-style-name", dataStyleName);
+        //     }
+
+        //     final String valueType = computeValueType();
+        //     variablesGet.setAttribute(OfficeNamespaces.OFFICE_NS, FormatValueUtility.VALUE_TYPE, valueType);
+        //     target.startElement(variablesGet);
+
+        //     target.endElement(variablesGet);
+        // }
+        // else
         {
             final DataFlags df = FormatValueUtility.computeDataFlag(element, getFlowController());
             if (df != null)


More information about the Libreoffice-commits mailing list