summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei@openoffice.org>2009-07-31 15:36:49 +0000
committerKohei Yoshida <kohei@openoffice.org>2009-07-31 15:36:49 +0000
commitf757b52519a29779e059eb6d58518aa03fdcab5c (patch)
tree81f9a8f6a253339ea7b5aa85200a67e17a205738
parent8a7e8f818cae346d0e4e2f2ccb4a7da73cce31b2 (diff)
We append an extra title row only for xls import, not for ods import.
-rw-r--r--sc/inc/dpoutputgeometry.hxx5
-rw-r--r--sc/source/core/data/dpoutputgeometry.cxx5
-rw-r--r--sc/source/filter/excel/xipivot.cxx2
-rw-r--r--sc/source/filter/xml/xmldpimp.cxx2
4 files changed, 9 insertions, 5 deletions
diff --git a/sc/inc/dpoutputgeometry.hxx b/sc/inc/dpoutputgeometry.hxx
index 4dd6b4134..d423d186a 100644
--- a/sc/inc/dpoutputgeometry.hxx
+++ b/sc/inc/dpoutputgeometry.hxx
@@ -40,8 +40,9 @@ class SC_DLLPUBLIC ScDPOutputGeometry
{
public:
enum FieldType { Column, Row, Page, Data, None };
+ enum ImportType { ODF, XLS };
- ScDPOutputGeometry(const ScRange& rOutRange, bool bShowFilter);
+ ScDPOutputGeometry(const ScRange& rOutRange, bool bShowFilter, ImportType eImportType);
~ScDPOutputGeometry();
/**
@@ -71,6 +72,8 @@ private:
sal_uInt32 mnPageFields;
sal_uInt32 mnDataFields;
+ ImportType meImportType;
+
bool mbShowFilter;
};
diff --git a/sc/source/core/data/dpoutputgeometry.cxx b/sc/source/core/data/dpoutputgeometry.cxx
index 09765690f..999ab2866 100644
--- a/sc/source/core/data/dpoutputgeometry.cxx
+++ b/sc/source/core/data/dpoutputgeometry.cxx
@@ -42,12 +42,13 @@
using ::std::vector;
-ScDPOutputGeometry::ScDPOutputGeometry(const ScRange& rOutRange, bool bShowFilter) :
+ScDPOutputGeometry::ScDPOutputGeometry(const ScRange& rOutRange, bool bShowFilter, ImportType eImportType) :
maOutRange(rOutRange),
mnRowFields(0),
mnColumnFields(0),
mnPageFields(0),
mnDataFields(0),
+ meImportType(eImportType),
mbShowFilter(bShowFilter)
{
}
@@ -172,7 +173,7 @@ ScDPOutputGeometry::FieldType ScDPOutputGeometry::getFieldButtonType(const ScAdd
{
// We will ignore the table position for now.
- bool bExtraTitleRow = (mnColumnFields == 0);
+ bool bExtraTitleRow = (mnColumnFields == 0 && meImportType == ScDPOutputGeometry::XLS);
bool bDataLayout = mnDataFields > 1;
SCROW nCurRow = maOutRange.aStart.Row();
diff --git a/sc/source/filter/excel/xipivot.cxx b/sc/source/filter/excel/xipivot.cxx
index c9e3093f6..40fbe03d7 100644
--- a/sc/source/filter/excel/xipivot.cxx
+++ b/sc/source/filter/excel/xipivot.cxx
@@ -1443,7 +1443,7 @@ void XclImpPivotTable::ApplyMergeFlags(const ScRange& rOutRange, const ScDPSaveD
{
// Apply merge flags for varoius datapilot controls.
- ScDPOutputGeometry aGeometry(rOutRange, false);
+ ScDPOutputGeometry aGeometry(rOutRange, false, ScDPOutputGeometry::XLS);
aGeometry.setColumnFieldCount(maPTInfo.mnColFields);
aGeometry.setPageFieldCount(maPTInfo.mnPageFields);
aGeometry.setDataFieldCount(maPTInfo.mnDataFields);
diff --git a/sc/source/filter/xml/xmldpimp.cxx b/sc/source/filter/xml/xmldpimp.cxx
index c9f290f32..6c261a52d 100644
--- a/sc/source/filter/xml/xmldpimp.cxx
+++ b/sc/source/filter/xml/xmldpimp.cxx
@@ -285,7 +285,7 @@ SvXMLImportContext *ScXMLDataPilotTableContext::CreateChildContext( USHORT nPref
void ScXMLDataPilotTableContext::SetButtons()
{
- ScDPOutputGeometry aGeometry(aTargetRangeAddress, bShowFilter);
+ ScDPOutputGeometry aGeometry(aTargetRangeAddress, bShowFilter, ScDPOutputGeometry::ODF);
aGeometry.setColumnFieldCount(mnColFieldCount);
aGeometry.setRowFieldCount(mnRowFieldCount);
aGeometry.setPageFieldCount(mnPageFieldCount);