diff options
Diffstat (limited to 'sc/source/filter/excel/xepivotxml.cxx')
-rw-r--r-- | sc/source/filter/excel/xepivotxml.cxx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sc/source/filter/excel/xepivotxml.cxx b/sc/source/filter/excel/xepivotxml.cxx index 30d4fa7a8424..1a47e2cfeb5b 100644 --- a/sc/source/filter/excel/xepivotxml.cxx +++ b/sc/source/filter/excel/xepivotxml.cxx @@ -426,6 +426,7 @@ void XclExpXmlPivotTableManager::Initialize() { ScDPObject& rDPObj = (*pDPColl)[i]; rDPObj.SyncAllDimensionMembers(); + (void)rDPObj.GetOutputRangeByType(sheet::DataPilotOutputRangeType::TABLE); } // Go through the caches first. @@ -606,6 +607,7 @@ void XclExpXmlPivotTables::SavePivotTableXml( XclExpXmlStream& rStrm, const ScDP std::vector<long> aPageFields; std::vector<DataField> aDataFields; + long nDataDimCount = rSaveData.GetDataDimensionCount(); // Use dimensions in the save data to get their correct ordering. // Dimension order here is significant as they specify the order of // appearance in each axis. @@ -637,6 +639,8 @@ void XclExpXmlPivotTables::SavePivotTableXml( XclExpXmlStream& rStrm, const ScDP switch (eOrient) { case sheet::DataPilotFieldOrientation_COLUMN: + if (nPos == -2 && nDataDimCount <= 1) + break; aColFields.push_back(nPos); break; case sheet::DataPilotFieldOrientation_ROW: @@ -684,15 +688,16 @@ void XclExpXmlPivotTables::SavePivotTableXml( XclExpXmlStream& rStrm, const ScDP sal_Int32 nFirstDataRow = 2; sal_Int32 nFirstDataCol = 1; ScRange aResRange = rDPObj.GetOutputRangeByType(sheet::DataPilotOutputRangeType::RESULT); + + if (!aOutRange.IsValid()) + aOutRange = rDPObj.GetOutRange(); + if (aOutRange.IsValid() && aResRange.IsValid()) { nFirstDataRow = aResRange.aStart.Row() - aOutRange.aStart.Row(); nFirstDataCol = aResRange.aStart.Col() - aOutRange.aStart.Col(); } - if (!aOutRange.IsValid()) - aOutRange = rDPObj.GetOutRange(); - pPivotStrm->write("<")->writeId(XML_location); rStrm.WriteAttributes(XML_ref, XclXmlUtils::ToOString(aOutRange), |