summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2013-02-19 11:38:16 +0100
committerFridrich Strba <fridrich@documentfoundation.org>2013-02-26 07:30:56 +0000
commit3b605c98a1e6385211e1f2ab76a1b86202f988cb (patch)
treeebfe72a5ef70e40e693a09aaadf5e7c7c937fcba
parent5b14af735a87ef5b38909f443465c123591c74fa (diff)
fdo#52948 fix print-repeated-values=no with formatted values
Factorise the "should this element be printed" decision into an utility function, which is used by 1) AbstractReportElementLayoutController (in charge of non-formatted values: string, image, OLE object, ...) which already obeyed PrintRepeatedValues. 2) TableCellLayoutController (in charge of formatted values: dates, numbers, ...) which blissfully ignored PrintRepeatedValues, but obeyed the display condition. Rename the inconsistently named PrintWhenGroupChange PrintWhenGroupChanges print-only-when-group-change print-when-group-change to PrintWhenGroupChange / print-when-group-change Change the meaning of "PrintWhenGroupChange" to "override PrintRepeatedValues in first occurrence in group". Since this feature never worked under the old semantics, no loss of feature. Since we change the XML attribute name, no ascending compatibility problem: it will be reset to its default value. Pursuant to the new meaning of PrintWhenGroupChange, change its default to *true*, which is the sane default. Change-Id: Idbe8e90565a354f70db222d047b3d51eeddbbb9f Reviewed-on: https://gerrit.libreoffice.org/2255 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
-rw-r--r--offapi/com/sun/star/report/XReportControlModel.idl2
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/AbstractReportElementLayoutController.java132
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FixedTextLayoutController.java2
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java132
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormattedTextLayoutController.java4
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/ImageElementLayoutController.java4
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/ObjectOleLayoutController.java2
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/TableCellLayoutController.java38
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/model/ReportElement.java10
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/parser/rpt-schema-v1.0-os.xsd2
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/FormattedTextReadHandler.java2
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/ReportElementReadHandler.java4
-rw-r--r--reportdesign/source/core/inc/ReportControlModel.hxx2
-rw-r--r--reportdesign/source/filter/xml/xmlEnums.hxx4
-rw-r--r--reportdesign/source/filter/xml/xmlExport.cxx2
-rw-r--r--reportdesign/source/filter/xml/xmlReportElement.cxx8
-rw-r--r--reportdesign/source/filter/xml/xmlfilter.cxx2
-rw-r--r--xmloff/inc/xmloff/xmltoken.hxx2
-rw-r--r--xmloff/source/core/xmltoken.cxx2
19 files changed, 194 insertions, 162 deletions
diff --git a/offapi/com/sun/star/report/XReportControlModel.idl b/offapi/com/sun/star/report/XReportControlModel.idl
index ece9a7824750..45e76c00007a 100644
--- a/offapi/com/sun/star/report/XReportControlModel.idl
+++ b/offapi/com/sun/star/report/XReportControlModel.idl
@@ -66,7 +66,7 @@ interface XReportControlModel
};
/** Specifies that the element gets printed when the group changes.
- The default value is <FALSE/>.
+ The default value is <TRUE/>.
*/
[attribute,bound] boolean PrintWhenGroupChange
{
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/AbstractReportElementLayoutController.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/AbstractReportElementLayoutController.java
index dfa7f16863a6..83c572a2591b 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/AbstractReportElementLayoutController.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/AbstractReportElementLayoutController.java
@@ -78,106 +78,19 @@ public abstract class AbstractReportElementLayoutController
throw new IllegalStateException();
}
- boolean isPrintableContent = true;
- final ReportElement text = (ReportElement) getNode();
- // Tests we have to perform:
- // 1. Print when group changes. We can know whether a group changed by
- // looking at the newly introduced iteration counter.
- //
- // Whether we use the next one or the one after that depends on whether
- // this element is a child of a group-header or group-footer.
-
- // 2. Print repeated values. This never applies to static text or static
- // elements.
- if ((text.isPrintWhenGroupChanges() && !isGroupChanged()) || (!text.isPrintRepeatedValues() && !isValueChanged()))
- {
- // if this is set to true, then we print the element only if this is the
- // first occurrence in this group.
- // or
- // If this is set to true, we evaluate the formula of the element and
- // try to derive whether there was a change.
- isPrintableContent = false;
- }
-
- // 3. Evaluate the Display Condition
- final Expression dc = text.getDisplayCondition();
- if (dc != null)
- {
- final Object o = LayoutControllerUtil.evaluateExpression(getFlowController(), text, dc);
- if (Boolean.FALSE.equals(o))
- {
-// LOGGER.debug ("DISPLAY Condition forbids printing");
- isPrintableContent = false;
- }
- }
-
- if (!isPrintableContent)
- {
- // There is no printable content at all. Set the state to FINISHED
- return join(getFlowController());
- }
- else
+ if (FormatValueUtility.shouldPrint(this, (ReportElement)getNode()))
{
// delegate to the handler ..
return delegateContentGeneration(target);
}
-
- }
-
- protected abstract boolean isValueChanged();
-
- protected boolean isGroupChanged()
- {
- // search the group.
- final SectionLayoutController slc = findGroup();
- if (slc == null)
+ else
{
- // Always print the content of the report header and footer and
- // the page header and footer.
- return true;
+ // There is no printable content at all. Set the state to FINISHED
+ return join(getFlowController());
}
-
- // we are in the first iteration, so yes, the group has changed recently.
- return slc.getIterationCount() == 0;
}
- private SectionLayoutController findGroup()
- {
- LayoutController parent = getParent();
- boolean skipNext = false;
- while (parent != null)
- {
- if (!(parent instanceof SectionLayoutController))
- {
- parent = parent.getParent();
- }
- else
- {
- final SectionLayoutController slc = (SectionLayoutController) parent;
- final Element element = slc.getElement();
- if (element instanceof OfficeGroupSection)
- {
- // 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
- {
- return (SectionLayoutController) parent;
- }
- }
- }
- return null;
- }
+ public abstract boolean isValueChanged();
/**
* Joins with a delegated process flow. This is generally called from a child
@@ -213,41 +126,6 @@ public abstract class AbstractReportElementLayoutController
return state != AbstractReportElementLayoutController.FINISHED;
}
- protected boolean isReferenceChanged(final LValue lValue)
- {
- if (lValue instanceof ContextLookup)
- {
- final ContextLookup rval = (ContextLookup) lValue;
- final String s = rval.getName();
- final DataRow view = getFlowController().getMasterRow().getGlobalView();
- try
- {
- final DataFlags flags = view.getFlags(s);
- if (flags != null && flags.isChanged())
- {
-// LOGGER.debug ("Reference " + s + " is changed");
- return true;
- }
-// LOGGER.debug ("Reference " + s + " is unchanged");
- }
- catch (DataSourceException e)
- {
- // ignore .. assume that the reference has not changed.
- }
- }
- final LValue[] childValues = lValue.getChildValues();
- for (int i = 0; i < childValues.length; i++)
- {
- final LValue value = childValues[i];
- if (isReferenceChanged(value))
- {
- return true;
- }
- }
-// LOGGER.debug ("Unchanged.");
- return false;
- }
-
public int getState()
{
return state;
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FixedTextLayoutController.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FixedTextLayoutController.java
index 07070164de3e..2dd554e0543e 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FixedTextLayoutController.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FixedTextLayoutController.java
@@ -49,7 +49,7 @@ public class FixedTextLayoutController
{
}
- protected boolean isValueChanged()
+ public boolean isValueChanged()
{
final FlowController controller = getFlowController();
final GlobalMasterRow masterRow = controller.getMasterRow();
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 ddb3b04fb7d1..99ff3e5fcf27 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java
@@ -21,6 +21,8 @@ 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 com.sun.star.report.pentaho.model.OfficeGroupSection;
+import com.sun.star.report.pentaho.model.ReportElement;
import java.math.BigDecimal;
import java.sql.Time;
@@ -31,12 +33,20 @@ import java.util.Date;
import org.jfree.layouting.util.AttributeMap;
import org.jfree.report.DataFlags;
+import org.jfree.report.DataRow;
import org.jfree.report.DataSourceException;
import org.jfree.report.data.DefaultDataFlags;
+import org.jfree.report.expressions.Expression;
import org.jfree.report.expressions.FormulaExpression;
import org.jfree.report.flow.FlowController;
+import org.jfree.report.flow.layoutprocessor.LayoutController;
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.pentaho.reporting.libraries.formula.lvalues.ContextLookup;
+import org.pentaho.reporting.libraries.formula.lvalues.LValue;
import org.pentaho.reporting.libraries.formula.util.HSSFDateUtil;
/**
@@ -228,4 +238,126 @@ public class FormatValueUtility
return new DefaultDataFlags(null, result, true);
}
}
+
+ public static boolean shouldPrint(final LayoutController ref, final ReportElement text)
+ throws DataSourceException
+ {
+ final boolean isValueChanged;
+ if (ref instanceof AbstractReportElementLayoutController)
+ isValueChanged=((AbstractReportElementLayoutController)ref).isValueChanged();
+ else if (ref instanceof TableCellLayoutController)
+ isValueChanged=((TableCellLayoutController)ref).isValueChanged();
+ else
+ throw new AssertionError("com.sun.star.report.pentaho.layoutprocessor.FormatValueUtility.shouldPrint expects an implementor of isValueChanged as first argument");
+
+ // Tests we have to perform:
+ // 1. If repeated values are supposed to be printed, then print.
+ // (this is always the case for static text and static elements)
+ // 2. If value changed, then print.
+ // 3. If (printing should be forced on group change AND group changed), then print
+ if ( !( isValueChanged
+ || text.isPrintRepeatedValues()
+ || ( text.isPrintWhenGroupChange() && isGroupChanged(ref) )))
+ {
+ return false;
+ }
+
+ final Expression dc = text.getDisplayCondition();
+ if (dc != null)
+ {
+ final Object o = LayoutControllerUtil.evaluateExpression(ref.getFlowController(), text, dc);
+ if (Boolean.FALSE.equals(o))
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public static boolean isGroupChanged(LayoutController ref)
+ {
+ // search the group.
+ final SectionLayoutController slc = findGroup(ref);
+ if (slc == null)
+ {
+ // Always print the content of the report header and footer and
+ // the page header and footer.
+ return true;
+ }
+
+ // we are in the first iteration, so yes, the group has changed recently.
+ return slc.getIterationCount() == 0;
+ }
+
+ public static SectionLayoutController findGroup(LayoutController ref)
+ {
+ LayoutController parent = ref.getParent();
+ boolean skipNext = false;
+ while (parent != null)
+ {
+ if (!(parent instanceof SectionLayoutController))
+ {
+ parent = parent.getParent();
+ }
+ else
+ {
+ final SectionLayoutController slc = (SectionLayoutController) parent;
+ final Element element = slc.getElement();
+ if (element instanceof OfficeGroupSection)
+ {
+ // 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
+ {
+ return (SectionLayoutController) parent;
+ }
+ }
+ }
+ return null;
+ }
+
+ public static boolean isReferenceChanged(LayoutController ref, final LValue lValue)
+ {
+ if (lValue instanceof ContextLookup)
+ {
+ final ContextLookup rval = (ContextLookup) lValue;
+ final String s = rval.getName();
+ final DataRow view = ref.getFlowController().getMasterRow().getGlobalView();
+ try
+ {
+ final DataFlags flags = view.getFlags(s);
+ if (flags != null && flags.isChanged())
+ {
+ return true;
+ }
+ }
+ catch (DataSourceException e)
+ {
+ // ignore .. assume that the reference has not changed.
+ }
+ }
+ final LValue[] childValues = lValue.getChildValues();
+ for (int i = 0; i < childValues.length; i++)
+ {
+ final LValue value = childValues[i];
+ if (isReferenceChanged(ref, value))
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
}
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormattedTextLayoutController.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormattedTextLayoutController.java
index db8c1ffeff15..ea3d22bc169c 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormattedTextLayoutController.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormattedTextLayoutController.java
@@ -78,7 +78,7 @@ public class FormattedTextLayoutController
return null;
}
- protected boolean isValueChanged()
+ public boolean isValueChanged()
{
try
{
@@ -86,7 +86,7 @@ public class FormattedTextLayoutController
final FormulaExpression formulaExpression = element.getValueExpression();
final Formula formula = formulaExpression.getCompiledFormula();
final LValue lValue = formula.getRootReference();
- return isReferenceChanged(lValue);
+ return FormatValueUtility.isReferenceChanged(this, lValue);
}
catch (final ParseException e)
{
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/ImageElementLayoutController.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/ImageElementLayoutController.java
index e164bb367b60..a32073e13224 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/ImageElementLayoutController.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/ImageElementLayoutController.java
@@ -230,7 +230,7 @@ public class ImageElementLayoutController
return null;
}
- protected boolean isValueChanged()
+ public boolean isValueChanged()
{
final ImageElement imageElement = (ImageElement) getNode();
final FormulaExpression formulaExpression = imageElement.getFormula();
@@ -246,7 +246,7 @@ public class ImageElementLayoutController
{
final Formula formula = formulaExpression.getCompiledFormula();
final LValue lValue = formula.getRootReference();
- return isReferenceChanged(lValue);
+ return FormatValueUtility.isReferenceChanged(this, lValue);
}
catch (ParseException e)
{
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/ObjectOleLayoutController.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/ObjectOleLayoutController.java
index a762ee1667fe..4dbac0fae730 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/ObjectOleLayoutController.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/ObjectOleLayoutController.java
@@ -44,7 +44,7 @@ public class ObjectOleLayoutController extends AbstractReportElementLayoutContro
{
}
- protected boolean isValueChanged()
+ public boolean isValueChanged()
{
final ObjectOleElement element = (ObjectOleElement) getNode();
final List masterfields = element.getMasterfields();
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 bb1af2f6644f..148909876471 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/TableCellLayoutController.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/TableCellLayoutController.java
@@ -27,6 +27,7 @@ import org.jfree.layouting.util.AttributeMap;
import org.jfree.report.DataFlags;
import org.jfree.report.DataSourceException;
import org.jfree.report.expressions.Expression;
+import org.jfree.report.expressions.FormulaExpression;
import org.jfree.report.flow.FlowController;
import org.jfree.report.flow.ReportTarget;
import org.jfree.report.flow.layoutprocessor.LayoutControllerUtil;
@@ -34,6 +35,9 @@ import org.jfree.report.flow.layoutprocessor.SectionLayoutController;
import org.jfree.report.structure.Element;
import org.jfree.report.structure.Node;
import org.jfree.report.structure.Section;
+import org.pentaho.reporting.libraries.formula.Formula;
+import org.pentaho.reporting.libraries.formula.lvalues.LValue;
+import org.pentaho.reporting.libraries.formula.parser.ParseException;
import org.pentaho.reporting.libraries.base.util.ObjectUtilities;
@@ -99,18 +103,36 @@ public class TableCellLayoutController extends SectionLayoutController
{
return null;
}
- final Expression dc = element.getDisplayCondition();
- if (dc != null)
+ if (!FormatValueUtility.shouldPrint(this, element))
{
- final Object o = LayoutControllerUtil.evaluateExpression(getFlowController(), element, dc);
- if (Boolean.FALSE.equals(o))
+ attributeMap.setAttribute(OfficeNamespaces.OFFICE_NS,
+ FormatValueUtility.VALUE_TYPE, "string");
+ return null;
+ }
+ return FormatValueUtility.computeDataFlag(element, getFlowController());
+ }
+
+ public boolean isValueChanged()
+ {
+ try
+ {
+ final Section cell = (Section) getElement();
+ final FormattedTextElement element = findFormattedTextElement(cell);
+ if (element == null)
+ return false;
+ else
{
- attributeMap.setAttribute(OfficeNamespaces.OFFICE_NS,
- FormatValueUtility.VALUE_TYPE, "string");
- return null;
+ final FormulaExpression formulaExpression = element.getValueExpression();
+ final Formula formula = formulaExpression.getCompiledFormula();
+ final LValue lValue = formula.getRootReference();
+ return FormatValueUtility.isReferenceChanged(this, lValue);
}
}
- return FormatValueUtility.computeDataFlag(element, getFlowController());
+ catch (final ParseException e)
+ {
+ //LOGGER.debug("Parse Exception", e);
+ return false;
+ }
}
private FormattedTextElement findFormattedTextElement(final Section section)
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/model/ReportElement.java b/reportbuilder/java/com/sun/star/report/pentaho/model/ReportElement.java
index 74e48229bd84..37e11ffc0637 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/model/ReportElement.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/model/ReportElement.java
@@ -49,15 +49,15 @@ public abstract class ReportElement extends Element
* @return true, if the element should only be printed in the first row of the
* current group, false otherwise.
*/
- public boolean isPrintWhenGroupChanges()
+ public boolean isPrintWhenGroupChange()
{
- return OfficeToken.TRUE.equals(getAttribute(OfficeNamespaces.OOREPORT_NS, "print-when-group-changes"));
+ return OfficeToken.TRUE.equals(getAttribute(OfficeNamespaces.OOREPORT_NS, "print-when-group-change"));
}
- public void setPrintWhenGroupChanges(final boolean printWhenGroupChanges)
+ public void setPrintWhenGroupChange(final boolean printWhenGroupChange)
{
- setAttribute(OfficeNamespaces.OOREPORT_NS, "print-when-group-changes",
- String.valueOf(printWhenGroupChanges));
+ setAttribute(OfficeNamespaces.OOREPORT_NS, "print-when-group-change",
+ String.valueOf(printWhenGroupChange));
}
/**
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt-schema-v1.0-os.xsd b/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt-schema-v1.0-os.xsd
index 0acba65c323d..4c296ac7a75f 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt-schema-v1.0-os.xsd
+++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt-schema-v1.0-os.xsd
@@ -330,7 +330,7 @@
</xs:complexType>
</xs:element>
<xs:attributeGroup name="rpt-report-element-attlist">
- <xs:attribute name="print-when-group-change" default="false" form="qualified">
+ <xs:attribute name="print-when-group-change" default="true" form="qualified">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="true"/>
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/FormattedTextReadHandler.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/FormattedTextReadHandler.java
index 94b8f21d60f3..0ed48ca586d9 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/FormattedTextReadHandler.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/FormattedTextReadHandler.java
@@ -64,7 +64,7 @@ public class FormattedTextReadHandler extends ElementReadHandler
// * Print-Repeated-Values
// * Print-In-First-New-Section
- // * Print-When-Group-Changes
+ // * Print-When-Group-Change
// * Print-When-Section-Overflows
// That property cannot be evaluated yet, as this would require us to
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/ReportElementReadHandler.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/ReportElementReadHandler.java
index 7d0e735f4ae2..d7adf8631d9c 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/ReportElementReadHandler.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/ReportElementReadHandler.java
@@ -60,8 +60,8 @@ public class ReportElementReadHandler extends ElementReadHandler
throws SAXException
{
super.startParsing(attrs);
- final String printWhenGroupChanges = attrs.getValue(OfficeNamespaces.OOREPORT_NS, "print-when-group-changes");
- element.setPrintWhenGroupChanges(OfficeToken.TRUE.equals(printWhenGroupChanges));
+ final String printWhenGroupChange = attrs.getValue(OfficeNamespaces.OOREPORT_NS, "print-when-group-change");
+ element.setPrintWhenGroupChange(OfficeToken.TRUE.equals(printWhenGroupChange));
final String printRepeatingValues = attrs.getValue(OfficeNamespaces.OOREPORT_NS, "print-repeated-values");
element.setPrintRepeatedValues(printRepeatingValues == null || OfficeToken.TRUE.equals(printRepeatingValues));
}
diff --git a/reportdesign/source/core/inc/ReportControlModel.hxx b/reportdesign/source/core/inc/ReportControlModel.hxx
index c327cfc3f754..43a8f73f89ca 100644
--- a/reportdesign/source/core/inc/ReportControlModel.hxx
+++ b/reportdesign/source/core/inc/ReportControlModel.hxx
@@ -100,7 +100,7 @@ namespace reportdesign
,aComponent(_xContext)
,m_pOwner(_pOwner)
,m_rMutex(_rMutex)
- ,bPrintWhenGroupChange(sal_False)
+ ,bPrintWhenGroupChange(sal_True)
{}
// XContainer
diff --git a/reportdesign/source/filter/xml/xmlEnums.hxx b/reportdesign/source/filter/xml/xmlEnums.hxx
index 120c153aa13b..53df992246ea 100644
--- a/reportdesign/source/filter/xml/xmlEnums.hxx
+++ b/reportdesign/source/filter/xml/xmlEnums.hxx
@@ -116,9 +116,9 @@ namespace rptxml
};
enum XMLReportElement
{
- XML_TOK_PRINT_ONLY_WHEN_GROUP_CHANGE
+ XML_TOK_PRINT_WHEN_GROUP_CHANGE
,XML_TOK_REP_CONDITIONAL_PRINT_EXPRESSION
- ,XML_TOK_PRINT_REPEATED_VALUES
+ ,XML_TOK_PRINT_REPEATED_VALUES
,XML_TOK_COMPONENT
,XML_TOK_FORMATCONDITION
};
diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx
index 9df73c0fef50..95d1759c05b3 100644
--- a/reportdesign/source/filter/xml/xmlExport.cxx
+++ b/reportdesign/source/filter/xml/xmlExport.cxx
@@ -472,7 +472,7 @@ void ORptExport::exportReportElement(const Reference<XReportControlModel>& _xRep
{
OSL_ENSURE(_xReportElement.is(),"_xReportElement is NULL -> GPF");
if ( _xReportElement->getPrintWhenGroupChange() )
- AddAttribute(XML_NAMESPACE_REPORT, XML_PRINT_ONLY_WHEN_GROUP_CHANGE, XML_TRUE );
+ AddAttribute(XML_NAMESPACE_REPORT, XML_PRINT_WHEN_GROUP_CHANGE, XML_TRUE );
if ( !_xReportElement->getPrintRepeatedValues() )
AddAttribute(XML_NAMESPACE_REPORT, XML_PRINT_REPEATED_VALUES,XML_FALSE);
diff --git a/reportdesign/source/filter/xml/xmlReportElement.cxx b/reportdesign/source/filter/xml/xmlReportElement.cxx
index c857e8af7a18..2c4d6c893feb 100644
--- a/reportdesign/source/filter/xml/xmlReportElement.cxx
+++ b/reportdesign/source/filter/xml/xmlReportElement.cxx
@@ -55,18 +55,18 @@ OXMLReportElement::OXMLReportElement( ORptFilter& rImport,
{
for(sal_Int16 i = 0; i < nLength; ++i)
{
- ::rtl::OUString sLocalName;
+ ::rtl::OUString sLocalName;
const rtl::OUString sAttrName = _xAttrList->getNameByIndex( i );
const sal_uInt16 nPrefix = rMap.GetKeyByAttrName( sAttrName,&sLocalName );
const rtl::OUString sValue = _xAttrList->getValueByIndex( i );
switch( rTokenMap.Get( nPrefix, sLocalName ) )
{
- case XML_TOK_PRINT_ONLY_WHEN_GROUP_CHANGE:
+ case XML_TOK_PRINT_WHEN_GROUP_CHANGE:
m_xComponent->setPrintWhenGroupChange(s_sTRUE == sValue);
break;
- case XML_TOK_PRINT_REPEATED_VALUES:
- m_xComponent->setPrintRepeatedValues(sValue == s_sTRUE ? sal_True : sal_False);
+ case XML_TOK_PRINT_REPEATED_VALUES:
+ m_xComponent->setPrintRepeatedValues(sValue == s_sTRUE);
break;
default:
break;
diff --git a/reportdesign/source/filter/xml/xmlfilter.cxx b/reportdesign/source/filter/xml/xmlfilter.cxx
index 1279e7386f93..2f324a3c6807 100644
--- a/reportdesign/source/filter/xml/xmlfilter.cxx
+++ b/reportdesign/source/filter/xml/xmlfilter.cxx
@@ -822,7 +822,7 @@ const SvXMLTokenMap& ORptFilter::GetReportElementElemTokenMap() const
static SvXMLTokenMapEntry aElemTokenMap[]=
{
{ XML_NAMESPACE_REPORT, XML_PRINT_REPEATED_VALUES ,XML_TOK_PRINT_REPEATED_VALUES },
- { XML_NAMESPACE_REPORT, XML_PRINT_ONLY_WHEN_GROUP_CHANGE,XML_TOK_PRINT_ONLY_WHEN_GROUP_CHANGE },
+ { XML_NAMESPACE_REPORT, XML_PRINT_WHEN_GROUP_CHANGE ,XML_TOK_PRINT_WHEN_GROUP_CHANGE },
{ XML_NAMESPACE_REPORT, XML_CONDITIONAL_PRINT_EXPRESSION,XML_TOK_REP_CONDITIONAL_PRINT_EXPRESSION },
{ XML_NAMESPACE_REPORT, XML_REPORT_COMPONENT ,XML_TOK_COMPONENT },
{ XML_NAMESPACE_REPORT, XML_FORMAT_CONDITION ,XML_TOK_FORMATCONDITION },
diff --git a/xmloff/inc/xmloff/xmltoken.hxx b/xmloff/inc/xmloff/xmltoken.hxx
index 6559b454728e..f5b89a6acfdc 100644
--- a/xmloff/inc/xmloff/xmltoken.hxx
+++ b/xmloff/inc/xmloff/xmltoken.hxx
@@ -2947,7 +2947,7 @@ namespace xmloff { namespace token {
XML_GROUP_ON,
XML_FORCE_NEW_PAGE,
XML_GROUP_INTERVAL,
- XML_PRINT_ONLY_WHEN_GROUP_CHANGE,
+ XML_PRINT_WHEN_GROUP_CHANGE,
XML_REPORT_ELEMENT,
XML_LIST_SOURCE,
XML_LIST_SOURCE_TYPE,
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index 975349d18a43..5c8014671b18 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -2943,7 +2943,7 @@ namespace xmloff { namespace token {
TOKEN( "group-on", XML_GROUP_ON),
TOKEN( "force-new-page", XML_FORCE_NEW_PAGE),
TOKEN( "group-interval", XML_GROUP_INTERVAL),
- TOKEN( "print-only-when-group-change", XML_PRINT_ONLY_WHEN_GROUP_CHANGE),
+ TOKEN( "print-when-group-change", XML_PRINT_WHEN_GROUP_CHANGE),
TOKEN( "report-element", XML_REPORT_ELEMENT),
TOKEN( "list-source", XML_LIST_SOURCE),
TOKEN( "list-source-type", XML_LIST_SOURCE_TYPE),