summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
Diffstat (limited to 'sc/qa')
-rw-r--r--sc/qa/unit/data/xlsx/condformat_databar.xlsxbin0 -> 8052 bytes
-rw-r--r--sc/qa/unit/subsequent_filters_test.cxx27
2 files changed, 27 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xlsx/condformat_databar.xlsx b/sc/qa/unit/data/xlsx/condformat_databar.xlsx
new file mode 100644
index 000000000000..2d2d727322b7
--- /dev/null
+++ b/sc/qa/unit/data/xlsx/condformat_databar.xlsx
Binary files differ
diff --git a/sc/qa/unit/subsequent_filters_test.cxx b/sc/qa/unit/subsequent_filters_test.cxx
index 0f4923716490..c2c3ba68add2 100644
--- a/sc/qa/unit/subsequent_filters_test.cxx
+++ b/sc/qa/unit/subsequent_filters_test.cxx
@@ -166,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();
@@ -288,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);
@@ -2572,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)