diff options
-rw-r--r-- | sw/inc/crsrsh.hxx | 2 | ||||
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter.cxx | 18 | ||||
-rw-r--r-- | sw/source/core/crsr/crsrsh.cxx | 10 |
3 files changed, 22 insertions, 8 deletions
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx index 2fbb94509c6e..5b7e71a23634 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 fa5209497862..9c2719f99638 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -217,6 +217,7 @@ public: void testBookmarkUndo(); void testFdo85876(); void testCaretPositionMovingUp(); + void testTdf93441(); void testTdf81226(); void testTdf79717(); void testTdf137532(); @@ -451,6 +452,7 @@ public: CPPUNIT_TEST(testBookmarkUndo); CPPUNIT_TEST(testFdo85876); CPPUNIT_TEST(testCaretPositionMovingUp); + CPPUNIT_TEST(testTdf93441); CPPUNIT_TEST(testTdf81226); CPPUNIT_TEST(testTdf79717); CPPUNIT_TEST(testTdf137532); @@ -2043,6 +2045,22 @@ void SwUiWriterTest::testCaretPositionMovingUp() 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(); diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index e02b02b9c187..bb62e4b535f1 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -240,16 +240,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() ) { @@ -277,6 +272,7 @@ void SwCursorShell::EndAction( const bool bIdleEnd, const bool DoSetPosX ) return; } + sal_uInt16 eFlags = SwCursorShell::CHKRANGE; if ( !bIdleEnd ) eFlags |= SwCursorShell::SCROLLWIN; @@ -316,7 +312,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 ) |