summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2020-11-12 13:44:16 +0300
committerMiklos Vajna <vmiklos@collabora.com>2020-11-23 11:13:18 +0100
commit3c4b09a250605c9d73e48df83a6ee36a8bc2fb8b (patch)
treef0fe4720860fddec6818bc7152b94f70cb853c7d /sw/qa
parente5bcdb2fce688c4ca00c2b74dad568ed48d370a2 (diff)
tdf#120290 sw: comment no longer needs any width
Way back in 2001 with commit dca044e9572144c1ba9ce423b10f7a5456837cda, Fix #93831#: Larger range for tip help on notes, comments were called Notes, and looked similar to Calc's comments - just a tooltip kind of note that you hover over. Adding some fake space to the comment anchor probably helped to get access to that note. But now that comments are always visible in a side panel, there doesn't seem to be any need to pretend that the comment anchor takes up any space, which fixes a few corner cases where that fake width exceeded the real width of small portions that followed. Change-Id: I4e9dac12dce0545e0ac79e46597f6e441dc066a1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105747 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/layout/layout2.cxx13
1 files changed, 8 insertions, 5 deletions
diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx
index fad78d5bb7ea..f5b42ee947ed 100644
--- a/sw/qa/extras/layout/layout2.cxx
+++ b/sw/qa/extras/layout/layout2.cxx
@@ -1910,11 +1910,14 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testCommentCursorPosition)
pTextFrame->GetModelPositionForViewPoint(&aPosition, aPoint);
// Without the accompanying fix in place, this test would have failed with:
- // - Expected: 4 (six would be even better...)
- // - Actual : 3
- // i.e. the cursor got positioned before the first comment,
- // so typing extended the comment instead of adding content after the comment.
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4), aPosition.nContent.GetIndex());
+ // - Expected: 6
+ // - Actual : 3 or 4
+ // i.e. the cursor got positioned before the comments,
+ // so typing extended the first comment instead of adding content after the comments.
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(6), aPosition.nContent.GetIndex());
+ // The second line is also important, but can't be auto-tested
+ // since the failing situation depends on GetViewWidth which is zero in the headless tests.
+ // bb<comment>| - the cursor should move behind the |, not before it.
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf64222)