summaryrefslogtreecommitdiff
path: root/reportbuilder
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2011-05-24 15:03:17 +0200
committerJan Holesovsky <kendy@suse.cz>2011-05-24 15:03:17 +0200
commit33f2f512191c4c730345ae7e113fa5e0334b28b0 (patch)
treeaa0542f4d56f9fffd03d67cfb46fc1d459a02648 /reportbuilder
parentcd9c9307ddb284531f46b32f788982a1ff2465f0 (diff)
parent66c4b436fc35d3259a3a2ab335a93c89e1347696 (diff)
Merge remote-tracking branch 'origin/integration/dev300_m106'
Diffstat (limited to 'reportbuilder')
-rw-r--r--reportbuilder/java/com/sun/star/report/function/metadata/makefile.mk15
-rwxr-xr-xreportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java39
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/TableCellLayoutController.java8
3 files changed, 40 insertions, 22 deletions
diff --git a/reportbuilder/java/com/sun/star/report/function/metadata/makefile.mk b/reportbuilder/java/com/sun/star/report/function/metadata/makefile.mk
index 11501b16437e..a2452646f2c7 100644
--- a/reportbuilder/java/com/sun/star/report/function/metadata/makefile.mk
+++ b/reportbuilder/java/com/sun/star/report/function/metadata/makefile.mk
@@ -49,21 +49,18 @@ JAVAFILES := AuthorFunction.java \
TitleFunctionDescription.java \
MetaDataFunctionCategory.java
-# PROPERTYFILES := $(shell @$(FIND) . -name "*.properties")
-PROPERTYFILES:=$(CLASSDIR)$/$(PACKAGE)$/category.properties \
+COPYFILES := $(CLASSDIR)$/$(PACKAGE)$/category.properties \
$(CLASSDIR)$/$(PACKAGE)$/Title-Function.properties\
$(CLASSDIR)$/$(PACKAGE)$/category_en_US.properties \
$(CLASSDIR)$/$(PACKAGE)$/Author-Function.properties \
$(CLASSDIR)$/$(PACKAGE)$/Author-Function_en_US.properties \
$(CLASSDIR)$/$(PACKAGE)$/Title-Function_en_US.properties
-L10NPROPERTYFILES = $(PROPERTYFILES)
-ALLTAR : $(PROPERTYFILES)
+ALLTAR : $(COPYFILES)
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
-.IF "$(WITH_LANG)"==""
-$(CLASSDIR)/$(PACKAGE)/%.properties : %.properties
- @@-$(MKDIRHIER) $(@:d)
- $(COMMAND_ECHO)$(COPY) $< $@
-.ENDIF
+$(COPYFILES): $$(@:f)
+ +$(MKDIRHIER) $(CLASSDIR)$/$(PACKAGE)
+ +$(COPY) $< $@
+
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java
index fc1baaa8c9a3..76ee85b52aba 100755
--- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java
@@ -29,6 +29,7 @@ package com.sun.star.report.pentaho.layoutprocessor;
import com.sun.star.report.OfficeToken;
import com.sun.star.report.pentaho.OfficeNamespaces;
import com.sun.star.report.pentaho.model.FormattedTextElement;
+import java.math.BigDecimal;
import java.sql.Time;
@@ -46,7 +47,6 @@ import org.jfree.report.flow.layoutprocessor.LayoutControllerUtil;
import org.pentaho.reporting.libraries.formula.util.HSSFDateUtil;
-
/**
* Creation-Date: 06.06.2007, 17:03:30
*
@@ -125,31 +125,52 @@ public class FormatValueUtility
}
else if (value instanceof java.sql.Date)
{
- if ( "float".equals(valueType))//@see http://qa.openoffice.org/issues/show_bug.cgi?id=108954
+ if ("float".equals(valueType))//@see http://qa.openoffice.org/issues/show_bug.cgi?id=108954
{
variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE, HSSFDateUtil.getExcelDate((Date) value, false, 2).toString());
}
else
+ {
variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "date-value", formatDate((Date) value));
+ }
}
else if (value instanceof Date)
{
variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE_TYPE, "float");
variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE, HSSFDateUtil.getExcelDate((Date) value, false, 2).toString());
}
+ else if (value instanceof BigDecimal)
+ {
+ if ("date".equals(valueType))
+ {
+ variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "date-value", formatDate(HSSFDateUtil.getJavaDate((BigDecimal) value, false, 0)));
+ }
+ else
+ {
+ variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE, String.valueOf(value));
+ }
+ }
else if (value instanceof Number)
{
variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE, String.valueOf(value));
}
else if (value instanceof Boolean)
{
- if (Boolean.TRUE.equals(value))
+ if ("float".equals(valueType))
{
- variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, BOOLEAN_VALUE, OfficeToken.TRUE);
+ float fvalue = Boolean.TRUE.equals(value) ? 1 : 0;
+ variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE, String.valueOf(fvalue));
}
else
{
- variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, BOOLEAN_VALUE, OfficeToken.FALSE);
+ if (Boolean.TRUE.equals(value))
+ {
+ variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, BOOLEAN_VALUE, OfficeToken.TRUE);
+ }
+ else
+ {
+ variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, BOOLEAN_VALUE, OfficeToken.FALSE);
+ }
}
}
else if (value != null)
@@ -165,12 +186,10 @@ public class FormatValueUtility
}
if (!"string".equals(valueType))
{
- variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE, String.valueOf(value));
- }
- else
- {
- variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, STRING_VALUE, String.valueOf(value));
+ variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE_TYPE, "string");
+ //variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE, String.valueOf(value));
}
+ variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, STRING_VALUE, String.valueOf(value));
}
else
{
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/TableCellLayoutController.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/TableCellLayoutController.java
index f3c5ef383057..e575831ebf2a 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/TableCellLayoutController.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/TableCellLayoutController.java
@@ -69,12 +69,12 @@ public class TableCellLayoutController extends SectionLayoutController
{
final AttributeMap attributeMap = new AttributeMap(super.computeAttributes(fc, element, target));
final String definedStyle = (String) attributeMap.getAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME);
- final String valueType = (String) attributeMap.getAttribute(OfficeNamespaces.OFFICE_NS, FormatValueUtility.VALUE_TYPE);
attributeMap.setAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME, getDisplayStyleName((Section) element, definedStyle));
try
{
- final DataFlags value = computeValue();
+ final DataFlags value = computeValue(attributeMap);
+ final String valueType = (String) attributeMap.getAttribute(OfficeNamespaces.OFFICE_NS, FormatValueUtility.VALUE_TYPE);
if (value != null)
{
FormatValueUtility.applyValueForCell(value.getValue(), attributeMap, valueType);
@@ -100,7 +100,7 @@ public class TableCellLayoutController extends SectionLayoutController
return attributeMap;
}
- private DataFlags computeValue() throws DataSourceException
+ private DataFlags computeValue(final AttributeMap attributeMap) throws DataSourceException
{
// Search for the first FormattedTextElement
final Section cell = (Section) getElement();
@@ -115,6 +115,8 @@ public class TableCellLayoutController extends SectionLayoutController
final Object o = LayoutControllerUtil.evaluateExpression(getFlowController(), element, dc);
if (Boolean.FALSE.equals(o))
{
+ attributeMap.setAttribute(OfficeNamespaces.OFFICE_NS,
+ FormatValueUtility.VALUE_TYPE, "string");
return null;
}
}