[Libreoffice-commits] core.git: sc/qa

Markus Mohrhard markus.mohrhard at googlemail.com
Sat Nov 2 18:58:05 CET 2013


 sc/qa/unit/data/xlsx/column-style.xlsx |binary
 sc/qa/unit/subsequent_filters-test.cxx |   24 ++++++++++++++++++++++++
 2 files changed, 24 insertions(+)

New commits:
commit 5c18b9dfe4319bc27aa245c58d4f0dfc6cb689ef
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Nov 2 19:54:12 2013 +0100

    add test case for fdo#70315
    
    Change-Id: Ia442916ae29b8531ba2ef67eb4809267aca775b4

diff --git a/sc/qa/unit/data/xlsx/column-style.xlsx b/sc/qa/unit/data/xlsx/column-style.xlsx
new file mode 100644
index 0000000..57afe3e
Binary files /dev/null and b/sc/qa/unit/data/xlsx/column-style.xlsx differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 853187c..08b57eb 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -44,6 +44,7 @@
 #include "docsh.hxx"
 #include "editutil.hxx"
 #include "cellvalue.hxx"
+#include "attrib.hxx"
 
 #include <com/sun/star/drawing/XDrawPageSupplier.hpp>
 #include <com/sun/star/drawing/XControlShape.hpp>
@@ -144,6 +145,8 @@ public:
     void testPrintRangeODS();
     void testOutlineODS();
 
+    void testColumnStyleXLSX();
+
     CPPUNIT_TEST_SUITE(ScFiltersTest);
     CPPUNIT_TEST(testBasicCellContentODS);
     CPPUNIT_TEST(testRangeNameXLS);
@@ -210,6 +213,7 @@ public:
     CPPUNIT_TEST(testOptimalHeightReset);
     CPPUNIT_TEST(testPrintRangeODS);
     CPPUNIT_TEST(testOutlineODS);
+    CPPUNIT_TEST(testColumnStyleXLSX);
     CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -1991,6 +1995,26 @@ void ScFiltersTest::testOutlineODS()
     }
 }
 
+void ScFiltersTest::testColumnStyleXLSX()
+{
+    ScDocShellRef xDocSh = loadDoc("column-style.", XLSX);
+    CPPUNIT_ASSERT(xDocSh.Is());
+    ScDocument* pDoc = xDocSh->GetDocument();
+    CPPUNIT_ASSERT(pDoc);
+
+    const ScPatternAttr* pPattern = pDoc->GetPattern(0,0,0);
+    CPPUNIT_ASSERT(pPattern);
+
+    const ScProtectionAttr& rAttr = static_cast<const ScProtectionAttr&>(pPattern->GetItem(ATTR_PROTECTION));
+    CPPUNIT_ASSERT(rAttr.GetProtection());
+
+    pPattern = pDoc->GetPattern(0,1,0);
+    CPPUNIT_ASSERT(pPattern);
+
+    const ScProtectionAttr& rAttrNew = static_cast<const ScProtectionAttr&>(pPattern->GetItem(ATTR_PROTECTION));
+    CPPUNIT_ASSERT(!rAttrNew.GetProtection());
+}
+
 ScFiltersTest::ScFiltersTest()
       : ScBootstrapFixture( "/sc/qa/unit/data" )
 {


More information about the Libreoffice-commits mailing list