Kaydet (Commit) 0e633c51 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

add test for fdo#82128

Change-Id: I3dd0005f00c4a861103ffd1a0422b9fc9397f6fb
üst 2cc0109c
......@@ -116,6 +116,7 @@ public:
#endif
void testRelativePaths();
void testSheetProtection();
CPPUNIT_TEST_SUITE(ScExportTest);
CPPUNIT_TEST(test);
......@@ -152,6 +153,7 @@ public:
#if !defined(WNT)
CPPUNIT_TEST(testRelativePaths);
#endif
CPPUNIT_TEST(testSheetProtection);
/* TODO: export to ODS currently (2014-04-28) makes the validator stumble,
* probably due to a loext:fill-character attribute in a
......@@ -1932,6 +1934,37 @@ void ScExportTest::testRelativePaths()
CPPUNIT_ASSERT(aURL.startsWith(".."));
}
namespace {
void testSheetProtection_Impl(ScDocument& rDoc)
{
CPPUNIT_ASSERT(rDoc.IsTabProtected(0));
ScTableProtection* pTabProtection = rDoc.GetTabProtection(0);
CPPUNIT_ASSERT(pTabProtection->isOptionEnabled(ScTableProtection::SELECT_UNLOCKED_CELLS));
CPPUNIT_ASSERT(!pTabProtection->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS));
}
}
void ScExportTest::testSheetProtection()
{
ScDocShellRef xDocSh = loadDoc("sheet-protection.", ODS);
CPPUNIT_ASSERT(xDocSh.Is());
{
ScDocument& rDoc = xDocSh->GetDocument();
testSheetProtection_Impl(rDoc);
}
ScDocShellRef xDocSh2 = saveAndReload(xDocSh, ODS);
{
ScDocument& rDoc = xDocSh2->GetDocument();
testSheetProtection_Impl(rDoc);
}
xDocSh2->DoClose();
}
#if 0
void ScExportTest::testFunctionsExcel2010ODS()
{
......
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