summaryrefslogtreecommitdiff
path: root/sc/qa/unit/subsequent_filters_test.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/qa/unit/subsequent_filters_test.cxx')
-rw-r--r--sc/qa/unit/subsequent_filters_test.cxx28
1 files changed, 28 insertions, 0 deletions
diff --git a/sc/qa/unit/subsequent_filters_test.cxx b/sc/qa/unit/subsequent_filters_test.cxx
index 7329482bdf30..c2c3ba68add2 100644
--- a/sc/qa/unit/subsequent_filters_test.cxx
+++ b/sc/qa/unit/subsequent_filters_test.cxx
@@ -72,6 +72,7 @@
#include <cellmergeoption.hxx>
#include <undoblk.hxx>
#include <sortparam.hxx>
+#include <undomanager.hxx>
#include <orcusfilters.hxx>
#include <filter.hxx>
@@ -165,6 +166,7 @@ public:
void testCondFormatImportCellIs();
void testCondFormatThemeColor2XLSX(); // negative bar color and axis color
void testCondFormatThemeColor3XLSX(); // theme index 2 and 3 are switched
+ void testCondFormatCfvoScaleValueXLSX();
void testComplexIconSetsXLSX();
void testTdf101104();
void testTdf64401();
@@ -287,6 +289,7 @@ public:
CPPUNIT_TEST(testCondFormatImportCellIs);
CPPUNIT_TEST(testCondFormatThemeColor2XLSX);
CPPUNIT_TEST(testCondFormatThemeColor3XLSX);
+ CPPUNIT_TEST(testCondFormatCfvoScaleValueXLSX);
CPPUNIT_TEST(testComplexIconSetsXLSX);
CPPUNIT_TEST(testTdf101104);
CPPUNIT_TEST(testTdf64401);
@@ -2571,6 +2574,31 @@ void ScFiltersTest::testCondFormatThemeColor2XLSX()
xDocSh->DoClose();
}
+void ScFiltersTest::testCondFormatCfvoScaleValueXLSX()
+{
+ ScDocShellRef xDocSh = ScBootstrapFixture::loadDoc(u"condformat_databar.", FORMAT_XLSX);
+
+ CPPUNIT_ASSERT_MESSAGE("Failed to load condformat_databar.xlsx", xDocSh.is());
+
+ ScDocument& rDoc = xDocSh->GetDocument();
+ ScConditionalFormat* pFormat = rDoc.GetCondFormat(0, 0, 0);
+ const ScFormatEntry* pEntry = pFormat->GetEntry(0);
+ CPPUNIT_ASSERT(pEntry);
+ CPPUNIT_ASSERT_EQUAL(ScFormatEntry::Type::Databar, pEntry->GetType());
+ const ScDataBarFormat* pDataBar = static_cast<const ScDataBarFormat*>(pEntry);
+ const ScDataBarFormatData* pDataBarFormatData = pDataBar->GetDataBarData();
+ const ScColorScaleEntry* pLower = pDataBarFormatData->mpLowerLimit.get();
+ const ScColorScaleEntry* pUpper = pDataBarFormatData->mpUpperLimit.get();
+
+ CPPUNIT_ASSERT_EQUAL(COLORSCALE_VALUE, pLower->GetType());
+ CPPUNIT_ASSERT_EQUAL(COLORSCALE_VALUE, pUpper->GetType());
+
+ CPPUNIT_ASSERT_EQUAL(double(0.0), pLower->GetValue());
+ CPPUNIT_ASSERT_EQUAL(double(1.0), pUpper->GetValue());
+
+ xDocSh->DoClose();
+}
+
namespace {
void checkDatabarPositiveColor(const ScConditionalFormat* pFormat, const Color& rColor)