diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2019-02-27 21:31:06 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-02-28 09:17:49 +0100 |
commit | 8ae5a98852c2f3d87d6efff598f0c7d54df835d3 (patch) | |
tree | bf5105ab44f1a3f2df7cdfb21c5cda24b43cd890 /sw/qa | |
parent | 8701bed5e8cf344dfc2c10051bbf42291b6cb8d9 (diff) |
sw btlr writing mode shell: left/right cursor travelling, fix dest para
Fix aVerticalLeftToRightBottomToTop:
- fnXDiff takes "logically larger, logically smaller" arguments, so it's
first - second for top to bottom text (existing directions) but it's
second - first for btlr
- fnXInc was effectively unused before, but it probably meant to provide
logical left + width, so set that to physical left - width for btlr
And then port 3 places in lcl_UpDown() to use aRectFnSet, so we get
correct behavior for both ttb and btt directions.
With this, pressing the left/right arrow jumps to the previous / next
paragraph correctly.
Change-Id: I1323e95e2ce0ab2d66a3ea6e02bd50df2cebf232
Reviewed-on: https://gerrit.libreoffice.org/68462
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/layout/layout.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index a1f805d42bd9..6b54065d9e88 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -2841,6 +2841,7 @@ void SwLayoutWriter::testBtlrCell() CPPUNIT_ASSERT_LESS(nFirstParaBottom, rCharRect.Top()); // Test that pressing "up" at the start of the cell goes to the next character position. + sal_uLong nNodeIndex = pWrtShell->GetCursor()->Start()->nNode.GetIndex(); sal_Int32 nIndex = pWrtShell->GetCursor()->Start()->nContent.GetIndex(); KeyEvent aKeyEvent(0, KEY_UP); SwEditWin& rEditWin = pShell->GetView()->GetEditWin(); @@ -2849,6 +2850,14 @@ void SwLayoutWriter::testBtlrCell() // Without the accompanying fix in place, this test would have failed: "up" was interpreted as // logical "left", which does nothing if you're at the start of the text anyway. CPPUNIT_ASSERT_EQUAL(nIndex + 1, pWrtShell->GetCursor()->Start()->nContent.GetIndex()); + + // Test that pressing "right" goes to the next paragraph (logical "down"). + aKeyEvent = KeyEvent(0, KEY_RIGHT); + rEditWin.KeyInput(aKeyEvent); + Scheduler::ProcessEventsToIdle(); + // Without the accompanying fix in place, this test would have failed: the cursor went to the + // paragraph after the table. + CPPUNIT_ASSERT_EQUAL(nNodeIndex + 1, pWrtShell->GetCursor()->Start()->nNode.GetIndex()); #endif } |