Kaydet (Commit) 462907d4 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

add simple test for ods color scale import

Change-Id: I539c6bfec17febbdd97c724fbde55b75da7700f6
üst b2e6a571
......@@ -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"))
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment