summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-01-26 20:04:02 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-01-27 05:26:22 +0000
commitb125635851d3c96b0d27d06d45475774de23e8df (patch)
tree6aceb0626192d6047f518884dfd58218adaf4311
parent3e7369664c35c8d9a06d062aeaaf65178f8044a9 (diff)
add test for tdf#94626
Change-Id: I868e318bc2f8b0f4a7b0abdd93bda27f36f95d26 Reviewed-on: https://gerrit.libreoffice.org/21828 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r--sc/qa/unit/data/xlsx/colorscale_num_with_ref.xlsxbin0 -> 7939 bytes
-rw-r--r--sc/qa/unit/subsequent_filters-test.cxx31
2 files changed, 31 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xlsx/colorscale_num_with_ref.xlsx b/sc/qa/unit/data/xlsx/colorscale_num_with_ref.xlsx
new file mode 100644
index 000000000000..931fe7a3528f
--- /dev/null
+++ b/sc/qa/unit/data/xlsx/colorscale_num_with_ref.xlsx
Binary files differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index cff11cddadd1..917dd25e05ff 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -143,6 +143,7 @@ public:
void testCondFormatThemeColor2XLSX(); // negative bar color and axis color
void testComplexIconSetsXLSX();
void testCondFormatParentXLSX();
+ void testColorScaleNumWithRefXLSX();
void testLiteralInFormulaXLS();
@@ -259,6 +260,7 @@ public:
CPPUNIT_TEST(testCondFormatThemeColor2XLSX);
CPPUNIT_TEST(testComplexIconSetsXLSX);
CPPUNIT_TEST(testCondFormatParentXLSX);
+ CPPUNIT_TEST(testColorScaleNumWithRefXLSX);
CPPUNIT_TEST(testLiteralInFormulaXLS);
CPPUNIT_TEST(testNumberFormatHTML);
@@ -2534,6 +2536,35 @@ void ScFiltersTest::testCondFormatParentXLSX()
CPPUNIT_ASSERT_EQUAL(SVX_VER_JUSTIFY_TOP, static_cast<SvxCellVerJustify>(rVerJustify.GetValue()));
}
+void ScFiltersTest::testColorScaleNumWithRefXLSX()
+{
+ ScDocShellRef xDocSh = ScBootstrapFixture::loadDoc("colorscale_num_with_ref.", FORMAT_XLSX);
+
+ CPPUNIT_ASSERT_MESSAGE("Failed to load colorscale_num_with_ref.xlsx", xDocSh.Is());
+
+ ScDocument& rDoc = xDocSh->GetDocument();
+ ScConditionalFormatList* pList = rDoc.GetCondFormList(0);
+ CPPUNIT_ASSERT(pList);
+
+ CPPUNIT_ASSERT_EQUAL(size_t(1), pList->size());
+
+ ScConditionalFormat* pFormat = pList->begin()->get();
+ CPPUNIT_ASSERT(pFormat);
+
+ CPPUNIT_ASSERT_EQUAL(size_t(1), pFormat->size());
+ const ScFormatEntry* pEntry = pFormat->GetEntry(0);
+ CPPUNIT_ASSERT(pEntry);
+
+ CPPUNIT_ASSERT_EQUAL(condformat::COLORSCALE, pEntry->GetType());
+
+ const ScColorScaleFormat* pColorScale= dynamic_cast<const ScColorScaleFormat*>(pEntry);
+ CPPUNIT_ASSERT(pColorScale);
+
+ const ScColorScaleEntry* pColorScaleEntry = pColorScale->GetEntry(1);
+ CPPUNIT_ASSERT_EQUAL(OUString("=$A$1"),
+ pColorScaleEntry->GetFormula(formula::FormulaGrammar::GRAM_NATIVE));
+}
+
void ScFiltersTest::testLiteralInFormulaXLS()
{
ScDocShellRef xDocSh = loadDoc("shared-string/literal-in-formula.", FORMAT_XLS);