diff options
author | Jaskaran Singh <jvsg1303@gmail.com> | 2016-08-05 23:24:24 +0530 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-09-18 00:15:20 +0200 |
commit | cf03533f572a7aa542587bbc837dc124ffde66d3 (patch) | |
tree | 3d9ce22e7ad4b2ac4f0c33ba2f9a6dece7e9c43f /sc/qa | |
parent | 301e0dd1d223cea43390bc886c3ae39d6cadb5e5 (diff) |
Add test for font in orcus interface
Change-Id: Ibe2b5ef344a8f1ca27d3b59be9ac53e2c6f5b3b0
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/unit/data/xml/styles.xml | 7 | ||||
-rw-r--r-- | sc/qa/unit/subsequent_filters-test.cxx | 43 |
2 files changed, 45 insertions, 5 deletions
diff --git a/sc/qa/unit/data/xml/styles.xml b/sc/qa/unit/data/xml/styles.xml index 19eeff5169ff..118561f73038 100644 --- a/sc/qa/unit/data/xml/styles.xml +++ b/sc/qa/unit/data/xml/styles.xml @@ -15,11 +15,8 @@ <style:style style:name="Name5" style:family="table-cell" style:parent-style-name="Text"> <style:table-cell-properties style:cell-protect="none" style:print-content="true"/> </style:style> - <style:style style:name="Name8" style:family="table-cell" style:parent-style-name="Text"> - <style:text-properties style:font-name="Liberation Sans" style:text-underline-style="solid" fo:font-size="24pt" fo:color="#808080" fo:font-style="italic" style:text-underline-color="font-color" fo:font-weight="bold" style:text-underline-width="thick"/> - </style:style> - <style:style style:name="Name9" style:family="table-cell" style:parent-style-name="Text"> - <style:text-properties style:font-name="Tahoma" style:text-underline-style="dash" fo:font-size="00pt" style:text-underline-color="#1856ff" fo:font-weight="bold" style:text-underline-width="bold"/> + <style:style style:name="Name6" style:family="table-cell" style:parent-style-name="Text"> + <style:text-properties style:font-name="Liberation Sans" style:text-underline-style="solid" fo:font-size="24pt" fo:color="#808080" fo:font-style="italic" style:text-underline-color="font-color" fo:font-weight="bold"/> </style:style> <style:style style:name="Name20" style:family="table-cell" style:parent-style-name="Default"> <style:text-properties style:text-line-through-style="solid" style:text-line-through-type="single"/> diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index d57cd6b9371a..24fdfa36b113 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -38,6 +38,7 @@ #include <editeng/flditem.hxx> #include <editeng/justifyitem.hxx> #include <editeng/lineitem.hxx> +#include <editeng/colritem.hxx> #include <dbdata.hxx> #include "validat.hxx" #include "formulacell.hxx" @@ -2792,6 +2793,48 @@ void ScFiltersTest::testOrcusODSStyleInterface() CPPUNIT_ASSERT_MESSAGE("Style Name5 : Has Attribute number format, but it shouldn't.", !pStyleSheet->GetItemSet().HasItem(ATTR_VALUE_FORMAT, &pItem)); + /* Test for Style "Name6" + * Has Font name, posture, weight, color, height + */ + pStyleSheet = pStyleSheetPool->FindCaseIns("Name6", SfxStyleFamily::Para); + CPPUNIT_ASSERT_MESSAGE("Style Name6 : Doesn't have Attribute Font, but it should have.", + pStyleSheet->GetItemSet().HasItem(ATTR_FONT, &pItem)); + + const SvxFontItem* pFontItem= static_cast<const SvxFontItem*>(pItem); + CPPUNIT_ASSERT_MESSAGE("Style Name6 :Error with Font name", pFontItem->GetStyleName() == "Liberation Sans"); + + CPPUNIT_ASSERT_MESSAGE("Style Name6 : Doesn't have Attribute Font Height, but it should have.", + pStyleSheet->GetItemSet().HasItem(ATTR_FONT_HEIGHT, &pItem)); + + const SvxFontHeightItem* pFontHeightItem= static_cast<const SvxFontHeightItem*>(pItem); + CPPUNIT_ASSERT_MESSAGE("Style Name6 :Error with Font Height", pFontHeightItem->GetHeight() == 480); + + CPPUNIT_ASSERT_MESSAGE("Style Name6 : Doesn't have Attribute Font Posture, but it should have.", + pStyleSheet->GetItemSet().HasItem(ATTR_FONT_POSTURE, &pItem)); + + const SvxPostureItem* pFontPostureItem= static_cast<const SvxPostureItem*>(pItem); + CPPUNIT_ASSERT_MESSAGE("Style Name6 :Error with Font Posture", pFontPostureItem->GetPosture() == ITALIC_NORMAL); + + CPPUNIT_ASSERT_MESSAGE("Style Name6 : Doesn't have Attribute Font Weight, but it should have.", + pStyleSheet->GetItemSet().HasItem(ATTR_FONT_WEIGHT, &pItem)); + + const SvxWeightItem* pFontWeightItem= static_cast<const SvxWeightItem*>(pItem); + CPPUNIT_ASSERT_MESSAGE("Style Name6 :Error with Font Weight", pFontWeightItem->GetWeight() == WEIGHT_BOLD); + + CPPUNIT_ASSERT_MESSAGE("Style Name6 : Doesn't have Attribute Font Color, but it should have.", + pStyleSheet->GetItemSet().HasItem(ATTR_FONT_COLOR, &pItem)); + + const SvxColorItem* pFontColorItem= static_cast<const SvxColorItem*>(pItem); + CPPUNIT_ASSERT_MESSAGE("Style Name6 :Error with Font Color", pFontColorItem->GetValue() == Color(128, 128, 128)); + + CPPUNIT_ASSERT_MESSAGE("Style Name6 : Doesn't have Attribute Underline, but it should have.", + pStyleSheet->GetItemSet().HasItem(ATTR_FONT_UNDERLINE, &pItem)); + + const SvxUnderlineItem* pUnderlineItem= static_cast<const SvxUnderlineItem*>(pItem); + CPPUNIT_ASSERT_MESSAGE("Style Name6 :Error with Font Underline Style", pUnderlineItem->GetLineStyle() == LINESTYLE_SINGLE); + CPPUNIT_ASSERT_MESSAGE("Style Name6 :Error with Font Underline Color", pUnderlineItem->GetColor() == Color(128, 128, 128)); + + } #endif |