tdf#123923: make COUNTIF propagate errors in its first parameter
In a specific case, Err:504 was emitted by COUNTIF when its 1st parameter was #REF!. This value was written into pivot cache definition when exporting to XLSX. Clearly Excel only expected propagated #REF! there, emitted error to user, and dropped the pivot table. This problem made XLSX pivot table cache generated by Calc unusable by Excel, despite ECMA-376 Part 1, 18.10.1.27 tells that the error value is application-dependent. The change makes COUNTIF to propagate errors received in its 1st parameter, instead of owerwriting them with own Err:504. This will likely need to be extended to other functions, if similar problems would arise. Change-Id: I459fa163a0e3e5f2c658631d66e096f4d46b1ace Reviewed-on: https://gerrit.libreoffice.org/68868 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This commit is contained in:
parent
a06f4c9c6a
commit
1f970c20a2
BIN
sc/qa/unit/data/ods/pivot-table-err-in-cache.ods
Normal file
BIN
sc/qa/unit/data/ods/pivot-table-err-in-cache.ods
Normal file
Binary file not shown.
@ -81,6 +81,7 @@ public:
|
|||||||
void testPivotTableDuplicatedMemberFilterXLSX();
|
void testPivotTableDuplicatedMemberFilterXLSX();
|
||||||
void testPivotTableTabularModeXLSX();
|
void testPivotTableTabularModeXLSX();
|
||||||
void testTdf112106();
|
void testTdf112106();
|
||||||
|
void testTdf123923();
|
||||||
|
|
||||||
CPPUNIT_TEST_SUITE(ScPivotTableFiltersTest);
|
CPPUNIT_TEST_SUITE(ScPivotTableFiltersTest);
|
||||||
|
|
||||||
@ -119,6 +120,7 @@ public:
|
|||||||
CPPUNIT_TEST(testPivotTableDuplicatedMemberFilterXLSX);
|
CPPUNIT_TEST(testPivotTableDuplicatedMemberFilterXLSX);
|
||||||
CPPUNIT_TEST(testPivotTableTabularModeXLSX);
|
CPPUNIT_TEST(testPivotTableTabularModeXLSX);
|
||||||
CPPUNIT_TEST(testTdf112106);
|
CPPUNIT_TEST(testTdf112106);
|
||||||
|
CPPUNIT_TEST(testTdf123923);
|
||||||
|
|
||||||
CPPUNIT_TEST_SUITE_END();
|
CPPUNIT_TEST_SUITE_END();
|
||||||
|
|
||||||
@ -2326,6 +2328,23 @@ void ScPivotTableFiltersTest::testTdf112106()
|
|||||||
xDocSh->DoClose();
|
xDocSh->DoClose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScPivotTableFiltersTest::testTdf123923()
|
||||||
|
{
|
||||||
|
// tdf#123923: Excel fails when it finds "Err:504" instead of "#REF!" in pivot table cache
|
||||||
|
|
||||||
|
ScDocShellRef xShell = loadDoc("pivot-table-err-in-cache.", FORMAT_ODS);
|
||||||
|
CPPUNIT_ASSERT(xShell.is());
|
||||||
|
|
||||||
|
std::shared_ptr<utl::TempFile> pXPathFile
|
||||||
|
= ScBootstrapFixture::exportTo(&(*xShell), FORMAT_XLSX);
|
||||||
|
xmlDocPtr pTable = XPathHelper::parseExport(pXPathFile, m_xSFactory,
|
||||||
|
"xl/pivotCache/pivotCacheDefinition1.xml");
|
||||||
|
CPPUNIT_ASSERT(pTable);
|
||||||
|
|
||||||
|
assertXPath(pTable, "/x:pivotCacheDefinition/x:cacheFields/x:cacheField[1]/x:sharedItems/x:e",
|
||||||
|
"v", "#REF!");
|
||||||
|
}
|
||||||
|
|
||||||
CPPUNIT_TEST_SUITE_REGISTRATION(ScPivotTableFiltersTest);
|
CPPUNIT_TEST_SUITE_REGISTRATION(ScPivotTableFiltersTest);
|
||||||
|
|
||||||
CPPUNIT_PLUGIN_IMPLEMENT();
|
CPPUNIT_PLUGIN_IMPLEMENT();
|
||||||
|
@ -5738,6 +5738,7 @@ void ScInterpreter::ScCountIf()
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
PopError(); // Propagate it further
|
||||||
PushIllegalParameter();
|
PushIllegalParameter();
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user