sw/source/uibase/docvw/edtwin.cxx |   34 ++++++++++++++++++----------------
 1 file changed, 18 insertions(+), 16 deletions(-)

New commits:
commit 5fae86d3f4468cac9af32e44873d57a195a48ff4
Author:     Jim Raykowski <[email protected]>
AuthorDate: Wed Nov 17 20:20:25 2021 -0900
Commit:     Xisco Fauli <[email protected]>
CommitDate: Mon Nov 22 13:35:39 2021 +0100

    tdf#145207 Check for drawing object before Table to handle Tab key
    
    to fix crash that can occur if done the other way
    
    Change-Id: I378aa8444906d56647ab4fdde26d4ff1c9f511f5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125435
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <[email protected]>
    (cherry picked from commit 437d5a446733aca0a485218f29d8d7dcea4d3999)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125463
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/sw/source/uibase/docvw/edtwin.cxx 
b/sw/source/uibase/docvw/edtwin.cxx
index 6bca7e62ee4c..5fea06590626 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -2055,6 +2055,15 @@ KEYINPUT_CHECKTABLE_INSDEL:
                             }
                         }
                     }
+                    else if (rSh.GetSelectionType() &
+                             (SelectionType::Graphic |
+                              SelectionType::Frame |
+                              SelectionType::Ole |
+                              SelectionType::DrawObject |
+                              SelectionType::DbForm))
+                    {
+                        eKeyState = SwKeyState::NextObject;
+                    }
                     else if ( rSh.GetTableFormat() )
                     {
                         if( rSh.HasSelection() || rSh.HasReadonlySel() )
@@ -2065,14 +2074,6 @@ KEYINPUT_CHECKTABLE_INSDEL:
                             eNextKeyState = SwKeyState::NextCell;
                         }
                     }
-                    else if ( rSh.GetSelectionType() &
-                                (SelectionType::Graphic |
-                                    SelectionType::Frame |
-                                    SelectionType::Ole |
-                                    SelectionType::DrawObject |
-                                    SelectionType::DbForm))
-
-                            eKeyState = SwKeyState::NextObject;
                     else
                     {
                         eKeyState = SwKeyState::InsTab;
@@ -2110,6 +2111,15 @@ KEYINPUT_CHECKTABLE_INSDEL:
                         else
                             eKeyState = SwKeyState::NumUp;
                     }
+                    else if (rSh.GetSelectionType() &
+                             (SelectionType::Graphic |
+                              SelectionType::Frame |
+                              SelectionType::Ole |
+                              SelectionType::DrawObject |
+                              SelectionType::DbForm))
+                    {
+                        eKeyState = SwKeyState::PrevObject;
+                    }
                     else if ( rSh.GetTableFormat() )
                     {
                         if( rSh.HasSelection() || rSh.HasReadonlySel() )
@@ -2120,14 +2130,6 @@ KEYINPUT_CHECKTABLE_INSDEL:
                             eNextKeyState = SwKeyState::PrevCell;
                         }
                     }
-                    else if ( rSh.GetSelectionType() &
-                                (SelectionType::Graphic |
-                                    SelectionType::Frame |
-                                    SelectionType::Ole |
-                                    SelectionType::DrawObject |
-                                    SelectionType::DbForm))
-
-                            eKeyState = SwKeyState::PrevObject;
                     else
                     {
                         eKeyState = SwKeyState::End;

Reply via email to