sw/source/uibase/docvw/PageBreakWin.cxx |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

New commits:
commit ca08171eb6dc6dda373c9f7c3f6abeba8c1db28f
Author:     Justin Luth <jl...@mail.com>
AuthorDate: Thu Sep 11 14:30:54 2025 -0400
Commit:     Justin Luth <jl...@mail.com>
CommitDate: Thu Sep 11 22:55:39 2025 +0200

    tdf#46623 sw PageBreakWin: always move cursor to FindFirstBodyContent
    
    When activating the blue-line page break
    decorator menu (edit or delete),
    the page break would be disabled if the cursor
    was not in FrameTypeFlags::BODY (or in a table).
    
    Well, the cursor position doesn't matter
    when the mouse activates this SwBreakDashedLine,
    so just always do what the table had to do anyway
    and that is to move the cursor
    so that a call to rSh.GetFrameType can return BODY.
    
    This allows SwBreakDashedLine to work
    when the cursor is in the header/footer/footnotes/flies etc.
    
    Change-Id: I64b49bed13821b46c3db2b132edeeb798dd2c3ca
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190828
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <jl...@mail.com>

diff --git a/sw/source/uibase/docvw/PageBreakWin.cxx 
b/sw/source/uibase/docvw/PageBreakWin.cxx
index 4ef4d86a60c1..8fc7615444d1 100644
--- a/sw/source/uibase/docvw/PageBreakWin.cxx
+++ b/sw/source/uibase/docvw/PageBreakWin.cxx
@@ -305,20 +305,17 @@ void SwBreakDashedLine::execute(std::u16string_view 
rIdent)
             ? *static_cast<SwTextFrame*>(pCnt)->GetTextNodeFirst()
             : *static_cast<SwNoTextFrame*>(pCnt)->GetNode();
 
+        rSh.Push();
+        rSh.ClearMark();
+        rSh.SetSelection(SwPaM(rNd));
+
         if ( pCnt->IsInTab() )
         {
-            rSh.Push( );
-            rSh.ClearMark();
-
-            rSh.SetSelection( SwPaM(rNd) );
-
             SfxStringItem 
aItem(m_pEditWin->GetView().GetPool().GetWhichIDFromSlotID(FN_FORMAT_TABLE_DLG),
 u"textflow"_ustr);
             m_pEditWin->GetView().GetViewFrame().GetDispatcher()->ExecuteList(
                     FN_FORMAT_TABLE_DLG,
                     SfxCallMode::SYNCHRON | SfxCallMode::RECORD,
                     { &aItem });
-
-            rSh.Pop(SwCursorShell::PopMode::DeleteCurrent);
         }
         else
         {
@@ -330,6 +327,9 @@ void SwBreakDashedLine::execute(std::u16string_view rIdent)
                     SfxCallMode::SYNCHRON | SfxCallMode::RECORD,
                     { &aItem, &aPaMItem });
         }
+
+        rSh.Pop(SwCursorShell::PopMode::DeleteCurrent);
+
         rSh.LockView( bOldLock );
         m_pEditWin->GrabFocus( );
     }

Reply via email to