Kaydet (Commit) b0a6b164 authored tarafından Eike Rathke's avatar Eike Rathke

add .xlsx unit test for enhanced protection

Change-Id: I8a6c6295998c6545318f6b490d1f617d6178013b
üst 6d658afd
......@@ -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();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment