summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2014-04-08 21:14:21 +0200
committerEike Rathke <erack@redhat.com>2014-04-08 21:15:42 +0200
commitb0a6b164951c692cf5940d0c6e0c102603738f95 (patch)
tree18e1b74be3558a348fd163112b3d7299ed16dfa9 /sc
parent6d658afd403d40071206f7e83cd7bd68d826a65b (diff)
add .xlsx unit test for enhanced protection
Change-Id: I8a6c6295998c6545318f6b490d1f617d6178013b
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/data/xlsx/enhanced-protection.xlsxbin0 -> 8483 bytes
-rw-r--r--sc/qa/unit/filters-test.cxx28
2 files changed, 23 insertions, 5 deletions
diff --git a/sc/qa/unit/data/xlsx/enhanced-protection.xlsx b/sc/qa/unit/data/xlsx/enhanced-protection.xlsx
new file mode 100644
index 000000000000..d9225a262af1
--- /dev/null
+++ b/sc/qa/unit/data/xlsx/enhanced-protection.xlsx
Binary files differ
diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx
index 00724123d596..43692b5e0fdd 100644
--- a/sc/qa/unit/filters-test.cxx
+++ b/sc/qa/unit/filters-test.cxx
@@ -71,6 +71,7 @@ public:
void testSharedFormulaXLSX();
void testLegacyCellAnchoredRotatedShape();
void testEnhancedProtectionXLS();
+ void testEnhancedProtectionXLSX();
CPPUNIT_TEST_SUITE(ScFiltersTest);
CPPUNIT_TEST(testCVEs);
@@ -85,6 +86,7 @@ public:
CPPUNIT_TEST(testSharedFormulaXLSX);
CPPUNIT_TEST(testLegacyCellAnchoredRotatedShape);
CPPUNIT_TEST(testEnhancedProtectionXLS);
+ CPPUNIT_TEST(testEnhancedProtectionXLSX);
CPPUNIT_TEST_SUITE_END();
@@ -499,12 +501,8 @@ void ScFiltersTest::testLegacyCellAnchoredRotatedShape()
}
}
-void ScFiltersTest::testEnhancedProtectionXLS()
+void testEnhancedProtectionImpl( ScDocument* pDoc )
{
- ScDocShellRef xDocSh = loadDoc("enhanced-protection.", XLS);
- CPPUNIT_ASSERT(xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
-
const ScTableProtection* pProt = pDoc->GetTabProtection(0);
CPPUNIT_ASSERT( !pProt->isBlockEditable( ScRange( 0, 0, 0, 0, 0, 0))); // locked
@@ -516,6 +514,26 @@ void ScFiltersTest::testEnhancedProtectionXLS()
CPPUNIT_ASSERT( pProt->isBlockEditable( ScRange( 0, 1, 0, 0, 2, 0))); // union of two different editables
CPPUNIT_ASSERT( !pProt->isBlockEditable( ScRange( 0, 0, 0, 0, 1, 0))); // union of locked and editable
CPPUNIT_ASSERT( !pProt->isBlockEditable( ScRange( 0, 2, 0, 0, 3, 0))); // union of editable and password editable
+}
+
+void ScFiltersTest::testEnhancedProtectionXLS()
+{
+ ScDocShellRef xDocSh = loadDoc("enhanced-protection.", XLS);
+ CPPUNIT_ASSERT(xDocSh.Is());
+ ScDocument* pDoc = xDocSh->GetDocument();
+
+ testEnhancedProtectionImpl( pDoc);
+
+ xDocSh->DoClose();
+}
+
+void ScFiltersTest::testEnhancedProtectionXLSX()
+{
+ ScDocShellRef xDocSh = loadDoc("enhanced-protection.", XLSX);
+ CPPUNIT_ASSERT(xDocSh.Is());
+ ScDocument* pDoc = xDocSh->GetDocument();
+
+ testEnhancedProtectionImpl( pDoc);
xDocSh->DoClose();
}