[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sw/inc sw/qa sw/source
Xisco Fauli (via logerrit)
logerrit at kemper.freedesktop.org
Thu Mar 18 08:54:59 UTC 2021
sw/inc/crsrsh.hxx | 2 -
sw/qa/extras/uiwriter/uiwriter.cxx | 49 +++++++++++++++++++++++++++++++++++++
sw/source/core/crsr/crsrsh.cxx | 10 ++-----
3 files changed, 53 insertions(+), 8 deletions(-)
New commits:
commit 28757ce2246f2598c8ace45f87225eaabbdaf8f0
Author: Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Wed Mar 3 17:10:40 2021 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Mar 18 09:54:20 2021 +0100
tdf#93441: Revert "Fix fdo#38884 Improve Up/Down movement in writer"
This reverts commit d58bea0ffa2a2fe79103ab7aa743aea63e27a0fd
it's really unclear to me what the original commit tries to
fix.
https://bugs.documentfoundation.org/show_bug.cgi?id=38884#c6
gives some information but the behaviour described there
is the same with or without the commit applied.
The discussion in https://gerrit.libreoffice.org/c/core/+/11500
doesn't give much information either.
Change-Id: Iadd8cb6e869fd26654bb0301fbc30ea4f2d39fdf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111932
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
Signed-off-by: Xisco Fauli <xiscofauli at libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112535
Reviewed-by: Jim Raykowski <raykowj at gmail.com>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index 572afdfd4f51..daf77e04c760 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -341,7 +341,7 @@ public:
// start parenthesing, hide SV-Cursor and selected areas
void StartAction();
// end parenthesing, show SV-Cursor and selected areas
- void EndAction( const bool bIdleEnd = false, const bool DoSetPosX = false );
+ void EndAction( const bool bIdleEnd = false );
// basic cursor travelling
tools::Long GetUpDownX() const { return m_nUpDownX; }
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index d7e7519acdda..702dc90636fd 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -213,6 +213,9 @@ public:
void testCreatePortions();
void testBookmarkUndo();
void testFdo85876();
+ void testCaretPositionMovingUp();
+ void testTdf93441();
+ void testTdf81226();
void testTdf79717();
void testTdf137532();
void testFdo87448();
@@ -445,6 +448,9 @@ public:
CPPUNIT_TEST(testCreatePortions);
CPPUNIT_TEST(testBookmarkUndo);
CPPUNIT_TEST(testFdo85876);
+ CPPUNIT_TEST(testCaretPositionMovingUp);
+ CPPUNIT_TEST(testTdf93441);
+ CPPUNIT_TEST(testTdf81226);
CPPUNIT_TEST(testTdf79717);
CPPUNIT_TEST(testTdf137532);
CPPUNIT_TEST(testFdo87448);
@@ -2020,6 +2026,49 @@ void SwUiWriterTest::testFdo85876()
}
}
+void SwUiWriterTest::testCaretPositionMovingUp()
+{
+ SwDoc* const pDoc = createDoc();
+ SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+ pWrtShell->Insert("after");
+ pWrtShell->InsertLineBreak();
+ pWrtShell->Up(false);
+ pWrtShell->Insert("before");
+
+ CPPUNIT_ASSERT_EQUAL(OUString(u"beforeAfter" + OUStringChar(CH_TXTATR_NEWLINE)), getParagraph(1)->getString());
+}
+
+void SwUiWriterTest::testTdf93441()
+{
+ SwDoc* const pDoc = createDoc();
+ SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+ pWrtShell->Insert("Hello");
+ pWrtShell->InsertLineBreak();
+ pWrtShell->Insert("Hello World");
+ pWrtShell->Up(false);
+ pWrtShell->Insert(" World");
+
+ // Without the fix in place, this test would have failed with
+ // - Expected: Hello World\nHello World
+ // - Actual : WorldHello\nHello World
+ CPPUNIT_ASSERT_EQUAL(OUString(u"Hello World" + OUStringChar(CH_TXTATR_NEWLINE) + u"Hello World"), getParagraph(1)->getString());
+}
+
+void SwUiWriterTest::testTdf81226()
+{
+ SwDoc* const pDoc = createDoc();
+ SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+ pWrtShell->Insert("before");
+ pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 4, /*bBasicCall=*/false);
+ pWrtShell->Down(false);
+ pWrtShell->Insert("after");
+
+ // Without the fix in place, this test would have failed with
+ // - Expected: beforeafter
+ // - Actual : beafterfore
+ CPPUNIT_ASSERT_EQUAL(OUString("beforeafter"), getParagraph(1)->getString());
+}
+
void SwUiWriterTest::testTdf79717()
{
SwDoc* const pDoc = createDoc();
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 701e2f16a7e9..861c1f4ea714 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -236,16 +236,11 @@ void SwCursorShell::StartAction()
SwViewShell::StartAction(); // to the SwViewShell
}
-void SwCursorShell::EndAction( const bool bIdleEnd, const bool DoSetPosX )
+void SwCursorShell::EndAction( const bool bIdleEnd )
{
comphelper::FlagRestorationGuard g(mbSelectAll, StartsWithTable() && ExtendedSelectedAll());
bool bVis = m_bSVCursorVis;
- sal_uInt16 eFlags = SwCursorShell::CHKRANGE;
- if ( !DoSetPosX )
- eFlags |= SwCursorShell::UPDOWN;
-
-
// Idle-formatting?
if( bIdleEnd && Imp()->GetRegion() )
{
@@ -273,6 +268,7 @@ void SwCursorShell::EndAction( const bool bIdleEnd, const bool DoSetPosX )
return;
}
+ sal_uInt16 eFlags = SwCursorShell::CHKRANGE;
if ( !bIdleEnd )
eFlags |= SwCursorShell::SCROLLWIN;
@@ -312,7 +308,7 @@ void SwCursorShell::EndCursorMove( const bool bIdleEnd )
#ifdef DBG_UTIL
OSL_ENSURE( m_nCursorMove, "EndCursorMove() without SttCursorMove()." );
#endif
- EndAction( bIdleEnd, true );
+ EndAction( bIdleEnd );
--m_nCursorMove;
#ifdef DBG_UTIL
if( !m_nCursorMove )
More information about the Libreoffice-commits
mailing list