summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaskaran Singh <jvsg1303@gmail.com>2016-08-05 23:24:24 +0530
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-09-17 19:00:01 +0200
commit947dcb4bcc9ca2cbe09e169d2d316fa055536448 (patch)
tree4459f98d0d8125887dcd1e43eb6459f5d2d13715
parentAdd test for cell protection in orcus interface (diff)
downloadcore-947dcb4bcc9ca2cbe09e169d2d316fa055536448.tar.gz
core-947dcb4bcc9ca2cbe09e169d2d316fa055536448.zip
Add test for font in orcus interface
Change-Id: Ibe2b5ef344a8f1ca27d3b59be9ac53e2c6f5b3b0
-rw-r--r--sc/qa/unit/data/xml/styles.xml7
-rw-r--r--sc/qa/unit/subsequent_filters-test.cxx43
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