diff options
author | Eike Rathke <erack@redhat.com> | 2014-04-08 21:14:21 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2014-04-08 21:15:42 +0200 |
commit | b0a6b164951c692cf5940d0c6e0c102603738f95 (patch) | |
tree | 18e1b74be3558a348fd163112b3d7299ed16dfa9 | |
parent | 6d658afd403d40071206f7e83cd7bd68d826a65b (diff) |
add .xlsx unit test for enhanced protection
Change-Id: I8a6c6295998c6545318f6b490d1f617d6178013b
-rw-r--r-- | sc/qa/unit/data/xlsx/enhanced-protection.xlsx | bin | 0 -> 8483 bytes | |||
-rw-r--r-- | sc/qa/unit/filters-test.cxx | 28 |
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 Binary files differnew file mode 100644 index 000000000000..d9225a262af1 --- /dev/null +++ b/sc/qa/unit/data/xlsx/enhanced-protection.xlsx 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(); } |