tdf#49994 Fix text selection over pages for multi column tables

with repeated headings

Change-Id: I6cddeb132ff4f8ff27ea03701067d7a3d4c4cf82
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/79113
Tested-by: Jenkins
Reviewed-by: Jim Raykowski <raykowj@gmail.com>
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 04c904f..3e9ca93 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -1994,22 +1994,27 @@ void SwCursorShell::UpdateCursor( sal_uInt16 eFlags, bool bIdleEnd )
            {
                pTableFrame = nullptr;

                SwMoveFnCollection const & fnPosSect = *pPos <  *pITmpCursor->GetMark()
                                            ? fnSectionStart
                                            : fnSectionEnd;

                // then only select inside the Box
                if( m_pTableCursor )
                {
                    SwMoveFnCollection const & fnPosSect = *pPos <  *pITmpCursor->GetMark()
                                                ? fnSectionStart
                                                : fnSectionEnd;

                    m_pCurrentCursor->SetMark();
                    *m_pCurrentCursor->GetMark() = *m_pTableCursor->GetMark();
                    m_pCurrentCursor->GetMkPos() = m_pTableCursor->GetMkPos();
                    m_pTableCursor->DeleteMark();
                    m_pTableCursor->SwSelPaintRects::Hide();
                }

                *m_pCurrentCursor->GetPoint() = *m_pCurrentCursor->GetMark();
                GoCurrSection( *m_pCurrentCursor, fnPosSect );
                    *m_pCurrentCursor->GetPoint() = *m_pCurrentCursor->GetMark();
                    GoCurrSection( *m_pCurrentCursor, fnPosSect );
                }
                else
                {
                    eFlags &= SwCursorShell::UPDOWN;
                    *m_pCurrentCursor->GetPoint() = *m_pCurrentCursor->GetMark();
                }
            }
        }