From 2a44c3167e5f24b5e8fa620be479c506c8a607be Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 27 Aug 2010 12:23:43 +0200 Subject: dba33h: #i112652#: reportbuilder: write XMLSchema-2 conformant NaN --- .../star/report/pentaho/layoutprocessor/TableCellLayoutController.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'reportbuilder') 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 74fe1728fc5f..506ea6347d4a 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/TableCellLayoutController.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/TableCellLayoutController.java @@ -81,7 +81,8 @@ public class TableCellLayoutController extends SectionLayoutController } else if ( "float".equals(valueType)) { - attributeMap.setAttribute(OfficeNamespaces.OFFICE_NS, FormatValueUtility.VALUE, "1.#NAN"); + attributeMap.setAttribute(OfficeNamespaces.OFFICE_NS, + FormatValueUtility.VALUE, "NaN"); } } catch (Exception e) -- cgit From 2ba3b618bea27646eec902ac33f0b713eddf47a3 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Mon, 30 Aug 2010 11:26:49 +0200 Subject: dba33h: #i114105# fix version number --- .../sun/star/report/pentaho/output/OfficeDocumentReportTarget.java | 7 ++++++- .../java/com/sun/star/report/pentaho/output/StylesWriter.java | 3 ++- .../sun/star/report/pentaho/output/text/TextRawReportTarget.java | 3 ++- 3 files changed, 10 insertions(+), 3 deletions(-) (limited to 'reportbuilder') diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/OfficeDocumentReportTarget.java b/reportbuilder/java/com/sun/star/report/pentaho/output/OfficeDocumentReportTarget.java index d4046424e07d..b41252a17089 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/output/OfficeDocumentReportTarget.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/output/OfficeDocumentReportTarget.java @@ -138,6 +138,10 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget public static final String VERTICAL_POS = "vertical-pos"; private static final String ZERO_CM = "0cm"; + /** the verison of the ODF specification to which generated documents + * shall conform. */ + public static final String ODF_VERSION = "1.2"; + protected static class BufferState { @@ -376,7 +380,8 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget rootAttributes.addNamespaceDeclaration("xsd", OfficeNamespaces.XSD_NS); rootAttributes.addNamespaceDeclaration("xsi", OfficeNamespaces.XSI_NS); rootAttributes.addNamespaceDeclaration("grddl", OfficeNamespaces.GRDDL_NS); - rootAttributes.setAttribute(OfficeNamespaces.OFFICE_NS, "version", "1.2"); + rootAttributes.setAttribute(OfficeNamespaces.OFFICE_NS, "version", + ODF_VERSION); this.rootXmlWriter.writeXmlDeclaration("UTF-8"); this.rootXmlWriter.writeTag(OfficeNamespaces.OFFICE_NS, "document-content", rootAttributes, XmlWriterSupport.OPEN); diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/StylesWriter.java b/reportbuilder/java/com/sun/star/report/pentaho/output/StylesWriter.java index 9b2e6b33b5f7..7c2671921d3f 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/output/StylesWriter.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/output/StylesWriter.java @@ -374,7 +374,8 @@ public class StylesWriter rootAttributes.addNamespaceDeclaration("xsd", OfficeNamespaces.XSD_NS); rootAttributes.addNamespaceDeclaration("xsi", OfficeNamespaces.XSI_NS); rootAttributes.addNamespaceDeclaration("grddl", OfficeNamespaces.GRDDL_NS); - rootAttributes.setAttribute(OfficeNamespaces.OFFICE_NS, "version", "1.2"); + rootAttributes.setAttribute(OfficeNamespaces.OFFICE_NS, "version", + OfficeDocumentReportTarget.ODF_VERSION); this.xmlWriter.writeXmlDeclaration("UTF-8"); this.xmlWriter.writeTag(OfficeNamespaces.OFFICE_NS, diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/text/TextRawReportTarget.java b/reportbuilder/java/com/sun/star/report/pentaho/output/text/TextRawReportTarget.java index 7c90bf1fd0ec..9f3746086b87 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/output/text/TextRawReportTarget.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/output/text/TextRawReportTarget.java @@ -1269,7 +1269,8 @@ public class TextRawReportTarget extends OfficeDocumentReportTarget rootAttributes.addNamespaceDeclaration("office", OfficeNamespaces.OFFICE_NS); rootAttributes.addNamespaceDeclaration("config", OfficeNamespaces.CONFIG); rootAttributes.addNamespaceDeclaration("ooo", OfficeNamespaces.OO2004_NS); - rootAttributes.setAttribute(OfficeNamespaces.OFFICE_NS, "version", "1.0"); + rootAttributes.setAttribute(OfficeNamespaces.OFFICE_NS, "version", + OfficeDocumentReportTarget.ODF_VERSION); final OutputStream outputStream = getOutputRepository().createOutputStream("settings.xml", "text/xml"); final XmlWriter xmlWriter = new XmlWriter(new OutputStreamWriter(outputStream, "UTF-8"), createTagDescription()); xmlWriter.setAlwaysAddNamespace(true); -- cgit From 2d9f7d9a9104a0679fb303e58b24a973f8a0a0ad Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Mon, 30 Aug 2010 11:28:34 +0200 Subject: dba33h: #i114106# fix invalid root element for styles --- .../java/com/sun/star/report/pentaho/output/StylesWriter.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'reportbuilder') diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/StylesWriter.java b/reportbuilder/java/com/sun/star/report/pentaho/output/StylesWriter.java index 7c2671921d3f..54b7d0d0159c 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/output/StylesWriter.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/output/StylesWriter.java @@ -117,11 +117,11 @@ public class StylesWriter { globals }); - writeAutomaticStylesSection(new OfficeStylesCollection[] + writeCommonStylesSection(new OfficeStylesCollection[] { globals }); - writeCommonStylesSection(new OfficeStylesCollection[] + writeAutomaticStylesSection(new OfficeStylesCollection[] { globals }); @@ -379,7 +379,7 @@ public class StylesWriter this.xmlWriter.writeXmlDeclaration("UTF-8"); this.xmlWriter.writeTag(OfficeNamespaces.OFFICE_NS, - "document-content", rootAttributes, XmlWriterSupport.OPEN); + "document-styles", rootAttributes, XmlWriterSupport.OPEN); } public void close() -- cgit From 42af84d9127d16c33e1efdb8b3cb9dc02b9364b3 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Mon, 30 Aug 2010 11:31:28 +0200 Subject: dba33h: #i114106# fix missing value-type --- .../report/pentaho/layoutprocessor/TableCellLayoutController.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'reportbuilder') 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 506ea6347d4a..f3c5ef383057 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/TableCellLayoutController.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/TableCellLayoutController.java @@ -84,6 +84,13 @@ public class TableCellLayoutController extends SectionLayoutController attributeMap.setAttribute(OfficeNamespaces.OFFICE_NS, FormatValueUtility.VALUE, "NaN"); } + // #i114108#: except on form elements, the only value-type that can + // occur without an accomanying value attribute is "string" + else if (!"string".equals(valueType)) + { + attributeMap.setAttribute(OfficeNamespaces.OFFICE_NS, + FormatValueUtility.VALUE_TYPE, "string"); + } } catch (Exception e) { -- cgit From 18d1017ba00291e4ab938f2456fd2a4afb9889f4 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Mon, 30 Aug 2010 11:33:41 +0200 Subject: dba3h: #i114111#: reportbuilder: do not use Double.toString() when writing the 2 column-width attribute, it may write an exponent, which is invalid.. --- .../report/pentaho/output/spreadsheet/SpreadsheetRawReportTarget.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'reportbuilder') diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportTarget.java b/reportbuilder/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportTarget.java index 11351b656ea1..d2c4ebd96e3c 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportTarget.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportTarget.java @@ -624,7 +624,9 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget final Section tableColumnProperties = new Section(); tableColumnProperties.setType("table-column-properties"); tableColumnProperties.setNamespace(style.getNamespace()); - tableColumnProperties.setAttribute(style.getNamespace(), "column-width", columnWidth + getUnitsOfMeasure(null)); + final String width = String.format("%f", columnWidth); + tableColumnProperties.setAttribute(style.getNamespace(), + "column-width", width + getUnitsOfMeasure(null)); style.addNode(tableColumnProperties); final AttributeList myAttrList = new AttributeList(); -- cgit