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

2014-05-27 Thread Lionel Elie Mamane
 
reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/FormatValueUtility.java
 |   25 ++
 reportdesign/source/filter/xml/xmlExport.cxx   
   |4 -
 2 files changed, 9 insertions(+), 20 deletions(-)

New commits:
commit aa48af57531851a16204381854f1ee19ebb63a6a
Author: Lionel Elie Mamane lio...@mamane.lu
Date:   Tue May 27 12:09:37 2014 +0200

fdo#67935 print on group change acted as print in first group instance

The parent group changed iff this is the first iteration of *this*
group *or* *detail* *section*.

The parent group's first iteration means that we are in the first
value of the parent group (in other words, the *grand*-*parent* group
changed).

Change-Id: Ia4a798cb37db2f17e7deef1058b25795bfc02648
Reviewed-on: https://gerrit.libreoffice.org/9503
Reviewed-by: Lionel Elie Mamane lio...@mamane.lu
Tested-by: Lionel Elie Mamane lio...@mamane.lu

diff --git 
a/reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/FormatValueUtility.java
 
b/reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/FormatValueUtility.java
index eca94e6..b4c5180 100644
--- 
a/reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/FormatValueUtility.java
+++ 
b/reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/FormatValueUtility.java
@@ -44,6 +44,7 @@ import 
org.jfree.report.flow.layoutprocessor.LayoutControllerUtil;
 import org.jfree.report.flow.layoutprocessor.SectionLayoutController;
 import org.jfree.report.structure.Element;
 import org.jfree.report.structure.Group;
+import org.jfree.report.structure.DetailSection;
 
 import org.pentaho.reporting.libraries.formula.lvalues.ContextLookup;
 import org.pentaho.reporting.libraries.formula.lvalues.LValue;
@@ -257,14 +258,14 @@ public class FormatValueUtility
 return true;
 }
 
-public static boolean isGroupChanged(LayoutController ref)
+private static boolean isGroupChanged(LayoutController ref)
 {
 // search the group.
-final SectionLayoutController slc = findGroup(ref);
+final SectionLayoutController slc = findGroupOrDetail(ref);
 if (slc == null)
 {
-// Always print the content of the report header and footer and
-// the page header and footer.
+// {Page, Report} × {Header, Footer} have no usable iteration 
count
+// err on the side of showing them rather than not showing them
 return true;
 }
 
@@ -272,10 +273,9 @@ public class FormatValueUtility
 return slc.getIterationCount() == 0;
 }
 
-public static SectionLayoutController findGroup(LayoutController ref)
+private static SectionLayoutController findGroupOrDetail(LayoutController 
ref)
 {
 LayoutController parent = ref.getParent();
-boolean skipNext = false;
 while (parent != null)
 {
 if (!(parent instanceof SectionLayoutController))
@@ -286,19 +286,8 @@ public class FormatValueUtility
 {
 final SectionLayoutController slc = (SectionLayoutController) 
parent;
 final Element element = slc.getElement();
-if (element instanceof OfficeGroupSection)
+if (!(element instanceof Group || element instanceof 
DetailSection))
 {
-// This is a header or footer. So we take the next group 
instead.
-skipNext = true;
-parent = parent.getParent();
-}
-else if (!(element instanceof Group))
-{
-parent = parent.getParent();
-}
-else if (skipNext)
-{
-skipNext = false;
 parent = parent.getParent();
 }
 else
commit 7b8e9ea4f9645599f45f7e2f708bab2837dafd0d
Author: Lionel Elie Mamane lio...@mamane.lu
Date:   Tue May 27 12:36:53 2014 +0200

fdo#67937 print on group change defaults to TRUE

Thus it needs to be saved when it is *false*.

Change-Id: I01bae547afe71ede12fb852c1a9040b7e45bf7b9
Reviewed-on: https://gerrit.libreoffice.org/9502
Reviewed-by: Lionel Elie Mamane lio...@mamane.lu
Tested-by: Lionel Elie Mamane lio...@mamane.lu

diff --git a/reportdesign/source/filter/xml/xmlExport.cxx 
b/reportdesign/source/filter/xml/xmlExport.cxx
index a43e13f..9eb4f80 100644
--- a/reportdesign/source/filter/xml/xmlExport.cxx
+++ b/reportdesign/source/filter/xml/xmlExport.cxx
@@ -454,8 +454,8 @@ void ORptExport::exportFormatConditions(const 
ReferenceXReportControlModel _x
 void ORptExport::exportReportElement(const ReferenceXReportControlModel 
_xReportElement)
 {
 OSL_ENSURE(_xReportElement.is(),_xReportElement is NULL - GPF);
-if ( _xReportElement-getPrintWhenGroupChange() )
-AddAttribute(XML_NAMESPACE_REPORT, 

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

2013-07-23 Thread Lionel Elie Mamane
 reportbuilder/java/libformula.properties   
  |4 
 
reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/FormatValueUtility.java
|   57 ++
 
reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/TableCellLayoutController.java
 |4 
 
reportbuilder/java/org/libreoffice/report/pentaho/output/OfficeDocumentReportTarget.java
 |2 
 reportdesign/source/core/sdr/RptObject.cxx 
  |2 
 reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx
  |2 
 6 files changed, 24 insertions(+), 47 deletions(-)

New commits:
commit c4ed35820178c6c990311e8fb48ea91b39c05988
Author: Lionel Elie Mamane lio...@mamane.lu
Date:   Tue Jul 23 19:24:54 2013 +0200

a date is a date, not a float

Change-Id: Id9beab6a9cd9b7fa15ce0699b6eeb8a1e32448fe

diff --git 
a/reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/FormatValueUtility.java
 
b/reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/FormatValueUtility.java
index d4c86c6..eca94e6 100644
--- 
a/reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/FormatValueUtility.java
+++ 
b/reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/FormatValueUtility.java
@@ -84,9 +84,9 @@ public class FormatValueUtility
 }
 else if (value instanceof Date)
 {
-variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, 
VALUE_TYPE, float);
-ret = HSSFDateUtil.getExcelDate((Date) value).toString();
-variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE, 
ret);
+variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, 
VALUE_TYPE, date);
+ret = formatDate((Date) value);
+variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, 
date-value, ret);
 }
 else if (value instanceof Number)
 {
commit cab9b82fb31217223511afcea88ad7446999492b
Author: Lionel Elie Mamane lio...@mamane.lu
Date:   Tue Jul 23 19:14:04 2013 +0200

fdo#67186 switch reporbuilder to null date == 1899-12-30

This brings it in line with the default for other LibreOffice
components (e.g. Calc), or with the only supported value (e.g. Writer
tables), respectively.

Configure Pentaho jfreereport to also take null date == 1899-12-30

This combined allows reportbuilder to make absolutely no fiddly
conversion itself, leaving them to jfreereport and Writer table
cell format.

Also:

 - Make absolutely no conversion itself, also e.g. for booleans.

 - ODF compliance: make the value-type match the set foo-value attribute.

 - Use value-type=void instead of empty value-type=string

Change-Id: I67990232dbc9e86ac3fa37cd0c20edecb87cf8ee

diff --git a/reportbuilder/java/libformula.properties 
b/reportbuilder/java/libformula.properties
index f903736..79022b6 100644
--- a/reportbuilder/java/libformula.properties
+++ b/reportbuilder/java/libformula.properties
@@ -19,8 +19,8 @@
 
 ##
 # Any configuration will happen here.
-org.pentaho.reporting.libraries.formula.datesystem.StartYear=1930
-org.pentaho.reporting.libraries.formula.datesystem.ExcelHack=false
+org.pentaho.reporting.libraries.formula.ZeroDate=1899
+org.pentaho.reporting.libraries.formula.ExcelDateBugAware=false
 
 #
 # A list of all known functions.
diff --git 
a/reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/FormatValueUtility.java
 
b/reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/FormatValueUtility.java
index 4c1b8dd..d4c86c6 100644
--- 
a/reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/FormatValueUtility.java
+++ 
b/reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/FormatValueUtility.java
@@ -85,7 +85,7 @@ public class FormatValueUtility
 else if (value instanceof Date)
 {
 variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, 
VALUE_TYPE, float);
-ret = HSSFDateUtil.getExcelDate((Date) value, false, 2).toString();
+ret = HSSFDateUtil.getExcelDate((Date) value).toString();
 variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE, 
ret);
 }
 else if (value instanceof Number)
@@ -112,8 +112,7 @@ public class FormatValueUtility
 }
 else
 {
-variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, 
VALUE_TYPE, string);
-variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, 
STRING_VALUE, );
+variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, 
VALUE_TYPE, void);
 }
 return ret;
 }
@@ -122,61 +121,39 @@ public class FormatValueUtility
 {
 if (value instanceof Time)
 {
+variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, 
VALUE_TYPE,