[Libreoffice-commits] core.git: Branch 'feature/orcus-odf' - 4 commits - sc/qa sc/source
Jaskaran Singh
jvsg1303 at gmail.com
Sat Aug 6 08:47:15 UTC 2016
sc/qa/unit/data/xml/styles.xml | 15 ++---
sc/qa/unit/subsequent_filters-test.cxx | 90 +++++++++++++++++++++++++++++++++
sc/source/filter/orcus/interface.cxx | 4 -
3 files changed, 98 insertions(+), 11 deletions(-)
New commits:
commit c2e220ff995cd4976c65bab1c34172dd4b303d1a
Author: Jaskaran Singh <jvsg1303 at gmail.com>
Date: Sat Aug 6 13:33:42 2016 +0530
Add test for cell align in orcus interface(currently disabled)
Change-Id: Icbb139cc520e4afd84986d245fab5f157431fc4e
diff --git a/sc/qa/unit/data/xml/styles.xml b/sc/qa/unit/data/xml/styles.xml
index ef9c337..b481219 100644
--- a/sc/qa/unit/data/xml/styles.xml
+++ b/sc/qa/unit/data/xml/styles.xml
@@ -27,7 +27,7 @@
<style:style style:name="Name9" style:family="table-cell" style:parent-style-name="Default">
<style:text-properties style:text-line-through-style="solid" style:text-line-through-type="single" style:text-line-through-text="/"/>
</style:style>
- <style:style style:name="Name23" style:family="table-cell" style:parent-style-name="Text">
+ <style:style style:name="Name10" style:family="table-cell" style:parent-style-name="Text">
<style:table-cell-properties style:vertical-align="middle"/>
<style:paragraph-properties fo:text-align="start"/>
</style:style>
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 2bdf722..6562b4a 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -2860,6 +2860,24 @@ void ScFiltersTest::testOrcusODSStyleInterface()
pCrossedOutItem = static_cast<const SvxCrossedOutItem*>(pItem);
CPPUNIT_ASSERT_MESSAGE("Style Name9 :Error with Strikeout", pCrossedOutItem->GetStrikeout() == STRIKEOUT_SLASH);
+ /* Test for Style Name "10"
+ * Has ver align, and hor align
+ */
+ /*
+ pStyleSheet = pStyleSheetPool->FindCaseIns("Name10", SfxStyleFamily::Para);
+ CPPUNIT_ASSERT_MESSAGE("Style Name10 : Doesn't have Attribute hor justify, but it should have.",
+ pStyleSheet->GetItemSet().HasItem(ATTR_HOR_JUSTIFY, &pItem));
+
+ const SvxHorJustifyItem* pHorJustify = static_cast<const SvxHorJustifyItem*>(pItem);
+ CPPUNIT_ASSERT_MESSAGE("Style Name10 :Error with hor justify", pHorJustify->GetValue() == SVX_HOR_JUSTIFY_RIGHT);
+
+ pStyleSheet = pStyleSheetPool->FindCaseIns("Name10", SfxStyleFamily::Para);
+ CPPUNIT_ASSERT_MESSAGE("Style Name10 : Doesn't have Attribute ver justify, but it should have.",
+ pStyleSheet->GetItemSet().HasItem(ATTR_VER_JUSTIFY, &pItem));
+
+ const SvxVerJustifyItem* pVerJustify = static_cast<const SvxVerJustifyItem*>(pItem);
+ CPPUNIT_ASSERT_MESSAGE("Style Name10 :Error with ver justify", pVerJustify->GetValue() == SVX_VER_JUSTIFY_CENTER);
+ */
}
#endif
commit d76bd4688ffaed219557be53d41883ec089eda55
Author: Jaskaran Singh <jvsg1303 at gmail.com>
Date: Sat Aug 6 13:32:26 2016 +0530
Correct initial values for cell align in orcus interface
Change-Id: I54b7def1d1d1a5b518abc6774495dd371a928ef3
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx
index 342a59f..1245bd1 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -941,8 +941,8 @@ ScOrcusStyles::xf::xf():
mnNumberFormatId(0),
mnStyleXf(0),
mbAlignment(false),
- meHor_alignment(SVX_HOR_JUSTIFY_LEFT),
- meVer_alignment(SVX_VER_JUSTIFY_CENTER)
+ meHor_alignment(SVX_HOR_JUSTIFY_RIGHT),
+ meVer_alignment(SVX_VER_JUSTIFY_BOTTOM)
{
}
commit 62a882c2e605a2ef8bcc8268e4faab98291998d8
Author: Jaskaran Singh <jvsg1303 at gmail.com>
Date: Sat Aug 6 00:03:50 2016 +0530
Add test for strikeout in orcus interface
Change-Id: I72e917934919ddf5cc2cdd188a692c3fba94433e
diff --git a/sc/qa/unit/data/xml/styles.xml b/sc/qa/unit/data/xml/styles.xml
index 118561f..ef9c337 100644
--- a/sc/qa/unit/data/xml/styles.xml
+++ b/sc/qa/unit/data/xml/styles.xml
@@ -18,13 +18,13 @@
<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:style style:name="Name7" style:family="table-cell" style:parent-style-name="Default">
<style:text-properties style:text-line-through-style="solid" style:text-line-through-type="single"/>
</style:style>
- <style:style style:name="Name21" style:family="table-cell" style:parent-style-name="Default">
+ <style:style style:name="Name8" style:family="table-cell" style:parent-style-name="Default">
<style:text-properties style:text-line-through-style="solid" style:text-line-through-type="single" style:text-line-through-width="bold"/>
</style:style>
- <style:style style:name="Name22" style:family="table-cell" style:parent-style-name="Default">
+ <style:style style:name="Name9" style:family="table-cell" style:parent-style-name="Default">
<style:text-properties style:text-line-through-style="solid" style:text-line-through-type="single" style:text-line-through-text="/"/>
</style:style>
<style:style style:name="Name23" style:family="table-cell" style:parent-style-name="Text">
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index e34f5ac..2bdf722 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -2830,6 +2830,35 @@ void ScFiltersTest::testOrcusODSStyleInterface()
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));
+ /* Test for Style Name "7"
+ * Has strikethrough single
+ */
+ pStyleSheet = pStyleSheetPool->FindCaseIns("Name7", SfxStyleFamily::Para);
+ CPPUNIT_ASSERT_MESSAGE("Style Name7 : Doesn't have Attribute Strikeout, but it should have.",
+ pStyleSheet->GetItemSet().HasItem(ATTR_FONT_CROSSEDOUT, &pItem));
+
+ const SvxCrossedOutItem* pCrossedOutItem = static_cast<const SvxCrossedOutItem*>(pItem);
+ CPPUNIT_ASSERT_MESSAGE("Style Name7 :Error with Strikeout", pCrossedOutItem->GetStrikeout() == STRIKEOUT_SINGLE);
+
+ /* Test for Style Name "8"
+ * Has strikethrough bold
+ */
+ pStyleSheet = pStyleSheetPool->FindCaseIns("Name8", SfxStyleFamily::Para);
+ CPPUNIT_ASSERT_MESSAGE("Style Name8 : Doesn't have Attribute Strikeout, but it should have.",
+ pStyleSheet->GetItemSet().HasItem(ATTR_FONT_CROSSEDOUT, &pItem));
+
+ pCrossedOutItem = static_cast<const SvxCrossedOutItem*>(pItem);
+ CPPUNIT_ASSERT_MESSAGE("Style Name7 :Error with Strikeout", pCrossedOutItem->GetStrikeout() == STRIKEOUT_BOLD);
+
+ /* Test for Style Name "9"
+ * Has strikethrough slash
+ */
+ pStyleSheet = pStyleSheetPool->FindCaseIns("Name9", SfxStyleFamily::Para);
+ CPPUNIT_ASSERT_MESSAGE("Style Name9 : Doesn't have Attribute Strikeout, but it should have.",
+ pStyleSheet->GetItemSet().HasItem(ATTR_FONT_CROSSEDOUT, &pItem));
+
+ pCrossedOutItem = static_cast<const SvxCrossedOutItem*>(pItem);
+ CPPUNIT_ASSERT_MESSAGE("Style Name9 :Error with Strikeout", pCrossedOutItem->GetStrikeout() == STRIKEOUT_SLASH);
}
#endif
commit 2e4477181ee09837fa5fe2acf74e7bb33cce00d8
Author: Jaskaran Singh <jvsg1303 at gmail.com>
Date: Fri Aug 5 23:24:24 2016 +0530
Add test for font in orcus interface
Change-Id: Ibe2b5ef344a8f1ca27d3b59be9ac53e2c6f5b3b0
diff --git a/sc/qa/unit/data/xml/styles.xml b/sc/qa/unit/data/xml/styles.xml
index 19eeff5..118561f 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 77eff46..e34f5ac 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"
@@ -2788,6 +2789,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
More information about the Libreoffice-commits
mailing list