Kaydet (Commit) 95eb1c9e authored tarafından Markus Mohrhard's avatar Markus Mohrhard

add test case for tdf#96549

Change-Id: I2df85972b92a9caf780ccacec102e6a9cdd652a6
Reviewed-on: https://gerrit.libreoffice.org/23933Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
üst e8322dff
...@@ -31,6 +31,9 @@ ...@@ -31,6 +31,9 @@
#include <editeng/udlnitem.hxx> #include <editeng/udlnitem.hxx>
#include <editeng/editobj.hxx> #include <editeng/editobj.hxx>
#include <editeng/borderline.hxx> #include <editeng/borderline.hxx>
#include <editeng/fhgtitem.hxx>
#include <editeng/brushitem.hxx>
#include <editeng/fontitem.hxx>
#include <editeng/flditem.hxx> #include <editeng/flditem.hxx>
#include <editeng/justifyitem.hxx> #include <editeng/justifyitem.hxx>
#include <dbdata.hxx> #include <dbdata.hxx>
...@@ -208,6 +211,7 @@ public: ...@@ -208,6 +211,7 @@ public:
void testRefStringXLSX(); void testRefStringXLSX();
void testHiddenSheetsXLSX(); void testHiddenSheetsXLSX();
void testRelFormulaValidationXLS(); void testRelFormulaValidationXLS();
void testColumnStyle2XLSX();
void testBnc762542(); void testBnc762542();
...@@ -308,6 +312,7 @@ public: ...@@ -308,6 +312,7 @@ public:
CPPUNIT_TEST(testEditEngStrikeThroughXLSX); CPPUNIT_TEST(testEditEngStrikeThroughXLSX);
CPPUNIT_TEST(testRefStringXLSX); CPPUNIT_TEST(testRefStringXLSX);
CPPUNIT_TEST(testRelFormulaValidationXLS); CPPUNIT_TEST(testRelFormulaValidationXLS);
CPPUNIT_TEST(testColumnStyle2XLSX);
CPPUNIT_TEST(testBnc762542); CPPUNIT_TEST(testBnc762542);
...@@ -3216,6 +3221,45 @@ void ScFiltersTest::testRefStringXLSX() ...@@ -3216,6 +3221,45 @@ void ScFiltersTest::testRefStringXLSX()
xDocSh->DoClose(); xDocSh->DoClose();
} }
void ScFiltersTest::testColumnStyle2XLSX()
{
ScDocShellRef xDocSh = loadDoc("column_style.", FORMAT_XLSX);
CPPUNIT_ASSERT_MESSAGE("Failed to open doc", xDocSh.Is());
ScDocument& rDoc = xDocSh->GetDocument();
const ScPatternAttr* pAttr = rDoc.GetPattern(1, 1, 0);
{
const SfxPoolItem& rItem = pAttr->GetItem(ATTR_BACKGROUND);
const SvxBrushItem& rBackground = static_cast<const SvxBrushItem&>(rItem);
const Color& rColor = rBackground.GetColor();
CPPUNIT_ASSERT_EQUAL(Color(255, 51, 51), rColor);
}
{
const SfxPoolItem& rItem = pAttr->GetItem(ATTR_HOR_JUSTIFY);
const SvxHorJustifyItem& rJustify = static_cast<const SvxHorJustifyItem&>(rItem);
sal_uInt16 nVal = rJustify.GetValue();
CPPUNIT_ASSERT_EQUAL((sal_uInt16)SVX_HOR_JUSTIFY_CENTER, nVal);
}
{
const SfxPoolItem& rItem = pAttr->GetItem(ATTR_FONT_HEIGHT);
const SvxFontHeightItem& rFontHeight = static_cast<const SvxFontHeightItem&>(rItem);
sal_uInt16 nHeight = rFontHeight.GetHeight();
CPPUNIT_ASSERT_EQUAL((sal_uInt16)240, nHeight);
}
{
const SfxPoolItem& rItem = pAttr->GetItem(ATTR_FONT);
const SvxFontItem& rFont = static_cast<const SvxFontItem&>(rItem);
OUString aName = rFont.GetFamilyName();
CPPUNIT_ASSERT_EQUAL(OUString("Linux Biolinum G"), aName);
}
xDocSh->DoClose();
}
void ScFiltersTest::testBnc762542() void ScFiltersTest::testBnc762542()
{ {
ScDocShellRef xDocSh = loadDoc("bnc762542.", FORMAT_XLSX); ScDocShellRef xDocSh = loadDoc("bnc762542.", FORMAT_XLSX);
......
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