Kaydet (Commit) cf03533f authored tarafından Jaskaran Singh's avatar Jaskaran Singh Kaydeden (comit) Markus Mohrhard

Add test for font in orcus interface

Change-Id: Ibe2b5ef344a8f1ca27d3b59be9ac53e2c6f5b3b0
üst 301e0dd1
......@@ -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"/>
......
......@@ -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
......
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