[Libreoffice-commits] core.git: sc/qa

Markus Mohrhard markus.mohrhard at googlemail.com
Tue Jan 26 21:26:54 PST 2016


 sc/qa/unit/data/xlsx/colorscale_num_with_ref.xlsx |binary
 sc/qa/unit/subsequent_filters-test.cxx            |   31 ++++++++++++++++++++++
 2 files changed, 31 insertions(+)

New commits:
commit b125635851d3c96b0d27d06d45475774de23e8df
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Tue Jan 26 20:04:02 2016 +0100

    add test for tdf#94626
    
    Change-Id: I868e318bc2f8b0f4a7b0abdd93bda27f36f95d26
    Reviewed-on: https://gerrit.libreoffice.org/21828
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

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 0000000..931fe7a
Binary files /dev/null and b/sc/qa/unit/data/xlsx/colorscale_num_with_ref.xlsx differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index cff11cd..917dd25 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);


More information about the Libreoffice-commits mailing list