[Libreoffice-commits] core.git: sc/qa
Markus Mohrhard
markus.mohrhard at googlemail.com
Sat Apr 9 09:18:11 UTC 2016
sc/qa/unit/data/xlsx/column_style.xlsx |binary
sc/qa/unit/subsequent_filters-test.cxx | 44 +++++++++++++++++++++++++++++++++
2 files changed, 44 insertions(+)
New commits:
commit 95eb1c9e51e11abcc1f6d8ba7554fbc5c9590b98
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sat Apr 9 10:13:19 2016 +0200
add test case for tdf#96549
Change-Id: I2df85972b92a9caf780ccacec102e6a9cdd652a6
Reviewed-on: https://gerrit.libreoffice.org/23933
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
diff --git a/sc/qa/unit/data/xlsx/column_style.xlsx b/sc/qa/unit/data/xlsx/column_style.xlsx
new file mode 100644
index 0000000..d228443
Binary files /dev/null and b/sc/qa/unit/data/xlsx/column_style.xlsx differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 720cdfe..51ada89 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -31,6 +31,9 @@
#include <editeng/udlnitem.hxx>
#include <editeng/editobj.hxx>
#include <editeng/borderline.hxx>
+#include <editeng/fhgtitem.hxx>
+#include <editeng/brushitem.hxx>
+#include <editeng/fontitem.hxx>
#include <editeng/flditem.hxx>
#include <editeng/justifyitem.hxx>
#include <dbdata.hxx>
@@ -208,6 +211,7 @@ public:
void testRefStringXLSX();
void testHiddenSheetsXLSX();
void testRelFormulaValidationXLS();
+ void testColumnStyle2XLSX();
void testBnc762542();
@@ -308,6 +312,7 @@ public:
CPPUNIT_TEST(testEditEngStrikeThroughXLSX);
CPPUNIT_TEST(testRefStringXLSX);
CPPUNIT_TEST(testRelFormulaValidationXLS);
+ CPPUNIT_TEST(testColumnStyle2XLSX);
CPPUNIT_TEST(testBnc762542);
@@ -3216,6 +3221,45 @@ void ScFiltersTest::testRefStringXLSX()
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()
{
ScDocShellRef xDocSh = loadDoc("bnc762542.", FORMAT_XLSX);
More information about the Libreoffice-commits
mailing list