summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2022-03-07 18:52:33 +0100
committerLuboš Luňák <l.lunak@collabora.com>2022-03-23 09:09:08 +0100
commit448e3fa53eba8301e89ed51ea4a4ba39d9d55d85 (patch)
treec9753333d9ec0c2ea7703c0dc155db208f261178 /sc/qa
parent5b490f6e43cb8111157dfddf60fe2e0d053f497c (diff)
revert/fix the incorrect fix for tdf#126904
The default cell style has protection turned off. That means that any cells that do not have a style that turns the protection on are actually not protected. So the original code was correct, it went beyond the cells explicitly saved in the file and the first "default" cell was not protected, so it was ok to jump there. Re-saving this document to xlsx and opening it in Excel has the same result. So revert the change. Keep the test, but edit the test file to actually protect cells in the default cell style too, as that way it's actually useful as a test of protected cells. And since the test for tdf#126904 is a subset of basically the same test for the same "bug" tdf#131455, keep only the larger test. Change-Id: I36f21c33aaf5a31e95aa29d616c6abdec17fcf42 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131126 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'sc/qa')
-rw-r--r--sc/qa/unit/uicalc/data/tdf126904.odsbin23144 -> 0 bytes
-rw-r--r--sc/qa/unit/uicalc/data/tdf131455-fixed.odsbin0 -> 34900 bytes
-rw-r--r--sc/qa/unit/uicalc/data/tdf131455.odsbin33222 -> 0 bytes
-rw-r--r--sc/qa/unit/uicalc/uicalc.cxx35
4 files changed, 3 insertions, 32 deletions
diff --git a/sc/qa/unit/uicalc/data/tdf126904.ods b/sc/qa/unit/uicalc/data/tdf126904.ods
deleted file mode 100644
index 0f2cf05132c4..000000000000
--- a/sc/qa/unit/uicalc/data/tdf126904.ods
+++ /dev/null
Binary files differ
diff --git a/sc/qa/unit/uicalc/data/tdf131455-fixed.ods b/sc/qa/unit/uicalc/data/tdf131455-fixed.ods
new file mode 100644
index 000000000000..08e02804bf1b
--- /dev/null
+++ b/sc/qa/unit/uicalc/data/tdf131455-fixed.ods
Binary files differ
diff --git a/sc/qa/unit/uicalc/data/tdf131455.ods b/sc/qa/unit/uicalc/data/tdf131455.ods
deleted file mode 100644
index f4d8bca66375..000000000000
--- a/sc/qa/unit/uicalc/data/tdf131455.ods
+++ /dev/null
Binary files differ
diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx
index 7a92f711cb13..bcecaf99d67e 100644
--- a/sc/qa/unit/uicalc/uicalc.cxx
+++ b/sc/qa/unit/uicalc/uicalc.cxx
@@ -1112,7 +1112,9 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf119793)
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf131455)
{
- ScModelObj* pModelObj = createDoc("tdf131455.ods");
+ // Note that tdf#131455 and tdf#126904 were actually incorrect,
+ // but keep the test with a fixed version of the document.
+ ScModelObj* pModelObj = createDoc("tdf131455-fixed.ods");
ScDocument* pDoc = pModelObj->GetDocument();
CPPUNIT_ASSERT(pDoc);
@@ -1160,37 +1162,6 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf131455)
CPPUNIT_ASSERT_EQUAL(sal_Int16(0), ScDocShell::GetViewData()->GetTabNo());
lcl_AssertCurrentCursorPosition(13, 4);
- // Cursor can't move forward to the right
- // Without the fix in place, this test would have failed with
- // - Expected: 13
- // - Actual : 64
- for (size_t i = 0; i < 5; ++i)
- {
- dispatchCommand(mxComponent, ".uno:GoRight", {});
- lcl_AssertCurrentCursorPosition(13, 4);
- }
-}
-
-CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf126904)
-{
- ScModelObj* pModelObj = createDoc("tdf126904.ods");
- ScDocument* pDoc = pModelObj->GetDocument();
- CPPUNIT_ASSERT(pDoc);
-
- lcl_AssertCurrentCursorPosition(0, 4);
- dispatchCommand(mxComponent, ".uno:GoRight", {});
- lcl_AssertCurrentCursorPosition(1, 4);
- dispatchCommand(mxComponent, ".uno:GoRight", {});
- lcl_AssertCurrentCursorPosition(4, 4);
- dispatchCommand(mxComponent, ".uno:GoRight", {});
- lcl_AssertCurrentCursorPosition(5, 4);
- dispatchCommand(mxComponent, ".uno:GoRight", {});
- lcl_AssertCurrentCursorPosition(8, 4);
- dispatchCommand(mxComponent, ".uno:GoRight", {});
- lcl_AssertCurrentCursorPosition(9, 4);
- dispatchCommand(mxComponent, ".uno:GoRight", {});
- lcl_AssertCurrentCursorPosition(12, 4);
-
//Cursor can't move forward to the right
for (size_t i = 0; i < 5; ++i)
{