Kaydet (Commit) abdffd2e authored tarafından Daniel Bankston's avatar Daniel Bankston

Add test case for matrix reference cells with blank text result

Change-Id: If00d424ebe0d82284c3281c3362f2a9e52ee384e
üst 218ec3b0
...@@ -3,3 +3,4 @@ Err:502,Err:502,Err:502,,error result ...@@ -3,3 +3,4 @@ Err:502,Err:502,Err:502,,error result
#N/A,#N/A,#N/A,,n/a #N/A,#N/A,#N/A,,n/a
TRUE,TRUE,TRUE,,Display TRUE instead of 1 TRUE,TRUE,TRUE,,Display TRUE instead of 1
FALSE,FALSE,FALSE,,Display FALSE instead of 0 FALSE,FALSE,FALSE,,Display FALSE instead of 0
42,,42,,Display blank cell instead of 0
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#include <editeng/borderline.hxx> #include <editeng/borderline.hxx>
#include <dbdata.hxx> #include <dbdata.hxx>
#include "validat.hxx" #include "validat.hxx"
#include "cell.hxx"
#include <com/sun/star/drawing/XDrawPageSupplier.hpp> #include <com/sun/star/drawing/XDrawPageSupplier.hpp>
#include <com/sun/star/drawing/XControlShape.hpp> #include <com/sun/star/drawing/XControlShape.hpp>
...@@ -423,9 +424,17 @@ void ScFiltersTest::testCachedMatrixFormulaResultsODS() ...@@ -423,9 +424,17 @@ void ScFiltersTest::testCachedMatrixFormulaResultsODS()
rtl::OUString aCSVFileName; rtl::OUString aCSVFileName;
createCSVPath(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("matrix.")), aCSVFileName); createCSVPath(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("matrix.")), aCSVFileName);
testFile(aCSVFileName, pDoc, 0); testFile(aCSVFileName, pDoc, 0);
//test matrix with errors //test matrices with special cases
createCSVPath(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("matrix2.")), aCSVFileName); createCSVPath(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("matrix2.")), aCSVFileName);
testFile(aCSVFileName, pDoc, 1); testFile(aCSVFileName, pDoc, 1);
//The above testFile() does not catch the below case.
//If a matrix formula has a matrix reference cell that is intended to have
//a blank text result, the matrix reference cell is actually saved(export)
//as a float cell with 0 as the value and an empty <text:p/>.
//Import works around this by setting these cells as text cells so that
//the blank text is used for display instead of the number 0.
//If this is working properly, the following cell should NOT have value data.
CPPUNIT_ASSERT(!pDoc->GetCell(ScAddress(3,5,1))->HasValueData());
xDocSh->DoClose(); xDocSh->DoClose();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment