summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNiklas Nebel <nn@openoffice.org>2010-08-30 18:45:51 +0200
committerNiklas Nebel <nn@openoffice.org>2010-08-30 18:45:51 +0200
commit7efea44937b783ef1663006410e9d8c7f549f3be (patch)
treedaf06cb9c3dca9fddb42361f69929977a2da154d /sc
parent8c8d2a8a8f0721ebf8767ab2f0a058730d16996f (diff)
calc59: #i114202# save table:show-empty attribute only if valid in ScDPSaveDimension
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/dpsave.hxx1
-rw-r--r--sc/source/core/data/dpsave.cxx5
-rw-r--r--sc/source/filter/xml/XMLExportDataPilot.cxx10
3 files changed, 13 insertions, 3 deletions
diff --git a/sc/inc/dpsave.hxx b/sc/inc/dpsave.hxx
index bfff0b97a168..8272b850b27e 100644
--- a/sc/inc/dpsave.hxx
+++ b/sc/inc/dpsave.hxx
@@ -140,6 +140,7 @@ public:
void SetSubTotals(long nCount, const USHORT* pFuncs);
long GetSubTotalsCount() const { return nSubTotalCount; }
USHORT GetSubTotalFunc(long nIndex) const { return pSubTotalFuncs[nIndex]; }
+ bool HasShowEmpty() const;
void SetShowEmpty(BOOL bSet);
BOOL GetShowEmpty() const { return BOOL(nShowEmptyMode); }
void SetFunction(USHORT nNew); // enum GeneralFunction
diff --git a/sc/source/core/data/dpsave.cxx b/sc/source/core/data/dpsave.cxx
index dd493bb0df6c..bad05968bf72 100644
--- a/sc/source/core/data/dpsave.cxx
+++ b/sc/source/core/data/dpsave.cxx
@@ -410,6 +410,11 @@ void ScDPSaveDimension::SetSubTotals(long nCount, const USHORT* pFuncs)
bSubTotalDefault = FALSE;
}
+bool ScDPSaveDimension::HasShowEmpty() const
+{
+ return nShowEmptyMode != SC_DPSAVEMODE_DONTKNOW;
+}
+
void ScDPSaveDimension::SetShowEmpty(BOOL bSet)
{
nShowEmptyMode = bSet;
diff --git a/sc/source/filter/xml/XMLExportDataPilot.cxx b/sc/source/filter/xml/XMLExportDataPilot.cxx
index e43ff21a114d..f8cba5ecf6c3 100644
--- a/sc/source/filter/xml/XMLExportDataPilot.cxx
+++ b/sc/source/filter/xml/XMLExportDataPilot.cxx
@@ -503,9 +503,13 @@ void ScXMLExportDataPilot::WriteMembers(ScDPSaveDimension* pDim)
void ScXMLExportDataPilot::WriteLevels(ScDPSaveDimension* pDim)
{
- rtl::OUStringBuffer sBuffer;
- SvXMLUnitConverter::convertBool(sBuffer, pDim->GetShowEmpty());
- rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_SHOW_EMPTY, sBuffer.makeStringAndClear());
+ // #i114202# GetShowEmpty is only valid if HasShowEmpty is true.
+ if (pDim->HasShowEmpty())
+ {
+ rtl::OUStringBuffer sBuffer;
+ SvXMLUnitConverter::convertBool(sBuffer, pDim->GetShowEmpty());
+ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_SHOW_EMPTY, sBuffer.makeStringAndClear());
+ }
SvXMLElementExport aElemDPL(rExport, XML_NAMESPACE_TABLE, XML_DATA_PILOT_LEVEL, sal_True, sal_True);
WriteSubTotals(pDim);