[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sc/qa sc/source
Tamás Zolnai
tamas.zolnai at collabora.com
Wed Nov 1 06:53:18 UTC 2017
sc/qa/unit/data/ods/pivottable_no_columns_layout.ods |binary
sc/qa/unit/subsequent_filters-test.cxx | 30 +++++++++++++++++++
sc/source/core/data/dpoutputgeometry.cxx | 2 -
sc/source/filter/xml/xmldpimp.cxx | 1
4 files changed, 32 insertions(+), 1 deletion(-)
New commits:
commit d5c7c8d8bde74e89db18212ccd48f972f1b49e3b
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
Date: Sat Oct 28 08:02:10 2017 +0200
tdf#113268: Pivot table: Missing popup button after opening a ODS
Wrong row number was calculated here. This ++nCurRow is usefull
only when headerlayout flag is set. It's a MSO compatibility flag
so it's not there by default in LO created tables.
Reviewed-on: https://gerrit.libreoffice.org/43552
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
(cherry picked from commit 291874c09c4bcde61f2c6808f2df6079f38d74e0)
Change-Id: Id7989d898f2647f1ba45ed95e0aa615e3b4fa311
Reviewed-on: https://gerrit.libreoffice.org/43974
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
diff --git a/sc/qa/unit/data/ods/pivottable_no_columns_layout.ods b/sc/qa/unit/data/ods/pivottable_no_columns_layout.ods
new file mode 100755
index 000000000000..e6ddca7299fc
Binary files /dev/null and b/sc/qa/unit/data/ods/pivottable_no_columns_layout.ods differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 2a1819b35c08..90fc2de69629 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -243,6 +243,7 @@ public:
void testTdf97598XLSX();
void testTdf111974XLSM();
void testTdf112501();
+ void testPivotTableNoColumnsLayout();
CPPUNIT_TEST_SUITE(ScFiltersTest);
CPPUNIT_TEST(testBooleanFormatXLSX);
@@ -363,6 +364,7 @@ public:
CPPUNIT_TEST(testTdf97598XLSX);
CPPUNIT_TEST(testTdf111974XLSM);
CPPUNIT_TEST(testTdf112501);
+ CPPUNIT_TEST(testPivotTableNoColumnsLayout);
CPPUNIT_TEST_SUITE_END();
@@ -3959,6 +3961,34 @@ void ScFiltersTest::testTdf112501()
}
}
+void ScFiltersTest::testPivotTableNoColumnsLayout()
+{
+ // tdf#113268 - Pivot table: Missing popup button after opening a pivot table from ODS
+ ScDocShellRef xDocSh = loadDoc("pivottable_no_columns_layout.", FORMAT_ODS);
+ CPPUNIT_ASSERT_MESSAGE("Failed to load file", xDocSh.Is());
+ ScDocument& rDoc = xDocSh->GetDocument();
+
+ // There should be exactly 2 pivot tables
+ ScDPCollection* pDPs = rDoc.GetDPCollection();
+ CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), pDPs->GetCount());
+
+ // Check first pivot table's popup button (headerlayout flag)
+ {
+ const ScPatternAttr* pPattern = rDoc.GetPattern(0, 1, 1);
+ const SfxPoolItem& rPoolItem = pPattern->GetItem(ATTR_MERGE_FLAG);
+ const ScMergeFlagAttr& rMergeFlag = static_cast<const ScMergeFlagAttr&>(rPoolItem);
+ CPPUNIT_ASSERT(rMergeFlag.GetValue() & ScMF::ButtonPopup);
+ }
+
+ // Check second pivot table's popup button
+ {
+ const ScPatternAttr* pPattern = rDoc.GetPattern(3, 0, 1);
+ const SfxPoolItem& rPoolItem = pPattern->GetItem(ATTR_MERGE_FLAG);
+ const ScMergeFlagAttr& rMergeFlag = static_cast<const ScMergeFlagAttr&>(rPoolItem);
+ CPPUNIT_ASSERT(rMergeFlag.GetValue() & ScMF::ButtonPopup);
+ }
+}
+
ScFiltersTest::ScFiltersTest()
: ScBootstrapFixture( "sc/qa/unit/data" )
diff --git a/sc/source/core/data/dpoutputgeometry.cxx b/sc/source/core/data/dpoutputgeometry.cxx
index 61d0633eafcd..34a4c7370416 100644
--- a/sc/source/core/data/dpoutputgeometry.cxx
+++ b/sc/source/core/data/dpoutputgeometry.cxx
@@ -239,7 +239,7 @@ ScDPOutputGeometry::getFieldButtonType(const ScAddress& rPos) const
nCurRow += static_cast<SCROW>(nColumnFields);
}
- else
+ else if (mbHeaderLayout)
++nCurRow;
if (nRowFields)
diff --git a/sc/source/filter/xml/xmldpimp.cxx b/sc/source/filter/xml/xmldpimp.cxx
index cc39b95ce0aa..12f4f78cb842 100644
--- a/sc/source/filter/xml/xmldpimp.cxx
+++ b/sc/source/filter/xml/xmldpimp.cxx
@@ -345,6 +345,7 @@ void ScXMLDataPilotTableContext::SetButtons()
aGeometry.setPageFieldCount(mnPageFieldCount);
aGeometry.setDataFieldCount(mnDataFieldCount);
aGeometry.setDataLayoutType(toFieldType(mnDataLayoutType));
+ aGeometry.setHeaderLayout(bHeaderGridLayout);
std::vector<const ScDPSaveDimension*> aRowDims, aColDims, aPageDims;
pDPSave->GetAllDimensionsByOrientation(sheet::DataPilotFieldOrientation_ROW, aRowDims);
More information about the Libreoffice-commits
mailing list