summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-08-13 00:49:14 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-08-13 12:34:24 +0200
commit462907d48f18c8dab4f705203c840dee3253d268 (patch)
tree0ddd881915448ca1b37923dad11df05196d9f593 /sc
parentb2e6a5717db9cbe6d9fa59ceaf860697b925ba76 (diff)
add simple test for ods color scale import
Change-Id: I539c6bfec17febbdd97c724fbde55b75da7700f6
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/data/ods/colorScale.odsbin0 -> 9254 bytes
-rw-r--r--sc/qa/unit/subsequent_filters-test.cxx47
2 files changed, 47 insertions, 0 deletions
diff --git a/sc/qa/unit/data/ods/colorScale.ods b/sc/qa/unit/data/ods/colorScale.ods
new file mode 100644
index 000000000000..1c3fe6e9602a
--- /dev/null
+++ b/sc/qa/unit/data/ods/colorScale.ods
Binary files differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 23b298f63fc2..5667348d78d3 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -130,6 +130,10 @@ public:
void testRepeatedColumnsODS();
void testDataValidityODS();
+ void testColorScale();
+ void testDataBar();
+ void testCondFormat();
+
//change this test file only in excel and not in calc
void testSharedFormulaXLSX();
void testCellValueXLSX();
@@ -170,6 +174,10 @@ public:
CPPUNIT_TEST(testCellValueXLSX);
CPPUNIT_TEST(testControlImport);
+ CPPUNIT_TEST(testColorScale);
+ CPPUNIT_TEST(testDataBar);
+ CPPUNIT_TEST(testCondFormat);
+
//disable testPassword on MacOSX due to problems with libsqlite3
//also crashes on DragonFly due to problems with nss/nspr headers
#if !defined(MACOSX) && !defined(DRAGONFLY) && !defined(WNT)
@@ -1172,6 +1180,45 @@ void ScFiltersTest::testControlImport()
xDocSh->DoClose();
}
+void ScFiltersTest::testColorScale()
+{
+ const rtl::OUString aFileNameBase(RTL_CONSTASCII_USTRINGPARAM("colorScale."));
+ rtl::OUString aFileExtension(aFileFormats[ODS].pName, strlen(aFileFormats[ODS].pName), RTL_TEXTENCODING_UTF8 );
+ rtl::OUString aFilterName(aFileFormats[ODS].pFilterName, strlen(aFileFormats[ODS].pFilterName), RTL_TEXTENCODING_UTF8) ;
+ rtl::OUString aFileName;
+ createFileURL(aFileNameBase, aFileExtension, aFileName);
+ rtl::OUString aFilterType(aFileFormats[ODS].pTypeName, strlen(aFileFormats[ODS].pTypeName), RTL_TEXTENCODING_UTF8);
+ std::cout << aFileFormats[ODS].pName << " Test" << std::endl;
+ ScDocShellRef xDocSh = load (aFilterName, aFileName, rtl::OUString(), aFilterType, aFileFormats[ODS].nFormatType);
+
+ CPPUNIT_ASSERT_MESSAGE("Failed to load colorScale.ods", xDocSh.Is());
+
+ ScDocument* pDoc = xDocSh->GetDocument();
+
+ const ScPatternAttr* pPattern = pDoc->GetPattern(1,1,0);
+ sal_uLong nIndex = static_cast<const SfxUInt32Item&>(pPattern->GetItem(ATTR_CONDITIONAL)).GetValue();
+ CPPUNIT_ASSERT(nIndex);
+ ScConditionalFormatList* pCondFormatList = pDoc->GetCondFormList(0);
+ const ScConditionalFormat* pFormat = pCondFormatList->GetFormat(nIndex);
+ CPPUNIT_ASSERT(pFormat);
+
+ pPattern = pDoc->GetPattern(1,5,0);
+ nIndex = static_cast<const SfxUInt32Item&>(pPattern->GetItem(ATTR_CONDITIONAL)).GetValue();
+ CPPUNIT_ASSERT(nIndex);
+ pFormat = pCondFormatList->GetFormat(nIndex);
+ CPPUNIT_ASSERT(pFormat);
+}
+
+void ScFiltersTest::testDataBar()
+{
+
+}
+
+void ScFiltersTest::testCondFormat()
+{
+
+}
+
ScFiltersTest::ScFiltersTest()
: m_aBaseString(RTL_CONSTASCII_USTRINGPARAM("/sc/qa/unit/data"))
{