sc/qa/unit/data/xml/styles.xml         |    9 ++-----
 sc/qa/unit/subsequent_filters-test.cxx |   40 ++++++++++++++++++++++++++++++++-
 2 files changed, 42 insertions(+), 7 deletions(-)

New commits:
commit aa9134ed087a418813401d41f2bf08a9009ae1cb
Author: Jaskaran Singh <jvsg1...@gmail.com>
Date:   Fri Aug 5 14:36:53 2016 +0530

    Add test for cell protection in orcus interface
    
    Change-Id: I952b5897bf3f728d103c43d93cadeffb92d1c3a9

diff --git a/sc/qa/unit/data/xml/styles.xml b/sc/qa/unit/data/xml/styles.xml
index 85c1e49..19eeff5 100644
--- a/sc/qa/unit/data/xml/styles.xml
+++ b/sc/qa/unit/data/xml/styles.xml
@@ -6,16 +6,13 @@
   <style:style style:name="Name2" style:family="table-cell" 
style:parent-style-name="Text">
     <style:table-cell-properties fo:diagonal-bl-tr="1.74pt dashed #ffccee" 
fo:diagonal-tl-br="0.74pt dash-dot #120000" fo:border-left="none" 
fo:border-right="0.74pt dotted #ff0000"/>
   </style:style>
-  <style:style style:name="Name4" style:family="table-cell" 
style:parent-style-name="Text">
-    <style:table-cell-properties fo:border-top="0.74pt double-border #000000" 
fo:border-bottom="none" fo:border-left="0.74pt solid #000000" 
fo:border-right="0.74pt dotted #000000"/>
-  </style:style>
-  <style:style style:name="Name5" style:family="table-cell" 
style:parent-style-name="Text">
+  <style:style style:name="Name3" style:family="table-cell" 
style:parent-style-name="Text">
     <style:table-cell-properties style:cell-protect="hidden-and-protected" 
style:print-content="true"/>
   </style:style>
-  <style:style style:name="Name6" style:family="table-cell" 
style:parent-style-name="Text">
+  <style:style style:name="Name4" style:family="table-cell" 
style:parent-style-name="Text">
     <style:table-cell-properties style:cell-protect="protected formula-hidden" 
style:print-content="false"/>
   </style:style>
-  <style:style style:name="Name7" style:family="table-cell" 
style:parent-style-name="Text">
+  <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">
diff --git a/sc/qa/unit/subsequent_filters-test.cxx 
b/sc/qa/unit/subsequent_filters-test.cxx
index 7ce70ee..77eff46 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -65,6 +65,7 @@
 #include "externalrefmgr.hxx"
 #include <stlpool.hxx>
 #include <config_orcus.h>
+#include <attrib.hxx>
 
 #if ENABLE_ORCUS
 #include <orcusfiltersimpl.hxx>
@@ -2705,7 +2706,7 @@ void ScFiltersTest::testOrcusODSStyleInterface()
     ASSERT_DOUBLES_EQUAL_MESSAGE("Error with top width", 1, 
pBoxItem->GetTop()->GetWidth());
     ASSERT_DOUBLES_EQUAL_MESSAGE("Error with bottom width", 1, 
pBoxItem->GetBottom()->GetWidth());
 
-    CPPUNIT_ASSERT_MESSAGE("Style Name1 : Has Attribute border, but it 
shouldn't.",
+    CPPUNIT_ASSERT_MESSAGE("Style Name1 : Has Attribute Protection, but it 
shouldn't.",
         !pStyleSheet->GetItemSet().HasItem(ATTR_PROTECTION, &pItem));
     CPPUNIT_ASSERT_MESSAGE("Style Name1 : Has Attribute font, but it 
shouldn't.",
         !pStyleSheet->GetItemSet().HasItem(ATTR_FONT, &pItem));
@@ -2750,6 +2751,43 @@ void ScFiltersTest::testOrcusODSStyleInterface()
         !pStyleSheet->GetItemSet().HasItem(ATTR_FONT, &pItem));
     CPPUNIT_ASSERT_MESSAGE("Style Name2 : Has Attribute number format, but it 
shouldn't.",
         !pStyleSheet->GetItemSet().HasItem(ATTR_VALUE_FORMAT, &pItem));
+
+    /* Test for Style "Name3"
+     * Hidden, protected and content is printed.
+     */
+    pStyleSheet = pStyleSheetPool->FindCaseIns("Name3", SfxStyleFamily::Para);
+    CPPUNIT_ASSERT_MESSAGE("Style Name3 : Doesn't have Attribute Protection, 
but it should have.",
+        pStyleSheet->GetItemSet().HasItem(ATTR_PROTECTION, &pItem));
+
+    CPPUNIT_ASSERT_MESSAGE("Style Name 3 : Error with Protection attribute." 
,ScProtectionAttr(true, false, true, true) == *pItem);
+
+    /* Test for Style "Name4"
+     * Hidden, protected and content is printed.
+     */
+    pStyleSheet = pStyleSheetPool->FindCaseIns("Name4", SfxStyleFamily::Para);
+    CPPUNIT_ASSERT_MESSAGE("Style Name4 : Doesn't have Attribute Protection, 
but it should have.",
+        pStyleSheet->GetItemSet().HasItem(ATTR_PROTECTION, &pItem));
+
+    CPPUNIT_ASSERT_MESSAGE("Style Name 4 : Error with Protection attribute." 
,ScProtectionAttr(true, true, false, false) == *pItem);
+
+    /* Test for Style "Name3"
+     * Hidden, protected and content is printed.
+     */
+    pStyleSheet = pStyleSheetPool->FindCaseIns("Name5", SfxStyleFamily::Para);
+    CPPUNIT_ASSERT_MESSAGE("Style Name5 : Doesn't have Attribute Protection, 
but it should have.",
+        pStyleSheet->GetItemSet().HasItem(ATTR_PROTECTION, &pItem));
+
+    CPPUNIT_ASSERT_MESSAGE("Style Name 5 : Error with Protection attribute." 
,ScProtectionAttr(false, false, false, true) == *pItem);
+
+    CPPUNIT_ASSERT_MESSAGE("Style Name5 : Has Attribute Border, but it 
shouldn't.",
+        !pStyleSheet->GetItemSet().HasItem(ATTR_BORDER, &pItem));
+    CPPUNIT_ASSERT_MESSAGE("Style Name5: Has Attribute background, but it 
shouldn't.",
+        !pStyleSheet->GetItemSet().HasItem(ATTR_BACKGROUND, &pItem));
+    CPPUNIT_ASSERT_MESSAGE("Style Name5 : Has Attribute font, but it 
shouldn't.",
+        !pStyleSheet->GetItemSet().HasItem(ATTR_FONT, &pItem));
+    CPPUNIT_ASSERT_MESSAGE("Style Name5 : Has Attribute number format, but it 
shouldn't.",
+        !pStyleSheet->GetItemSet().HasItem(ATTR_VALUE_FORMAT, &pItem));
+
 }
 #endif
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to