sw/source/ui/index/cnttab.cxx                |   45 ++++++++++++++++++++++-----
 sw/uiconfig/swriter/ui/assignstylesdialog.ui |    1 
 vcl/source/treelist/treelist.cxx             |    3 +
 3 files changed, 40 insertions(+), 9 deletions(-)

New commits:
commit 7da269700347ced21a3a6b779366bb6ecc98b4ed
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Thu Jun 16 08:24:42 2022 +0200
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Thu Jun 16 09:31:36 2022 +0200

    This should apparently be a true assert
    
    ...as dereferencing a past-the-end iterator would be fatal, as seen with
    <https://ci.libreoffice.org/job/lo_ubsan/2432/> during 
UITest_sw_fieldDialog at
    
    > warn:legacy.tools:19040:19040:vcl/source/treelist/treelist.cxx:1353: 
Entry not in model or wrong view
    > 
/opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/debug/safe_iterator.h:283:
    >     error:
    >     attempt
    >     to
    >     dereference
    >     a
    >     past-the-end
    >
    >     iterator
    >     .
    >
    > Objects involved in the operation:
    > iterator "this" @ 0x0x7fc0a42e1fe8 {
    > type = Hٷm�␡ (mutable iterator);
    >   state = past-the-end;
    >   references sequence with type 
`NSt7__debug13unordered_mapIP15SvTreeListEntrySt10unique_ptrI15SvViewDataEntrySt14default_deleteIS4_EESt4hashIS2_ESt8equal_toIS2_ESaISt4pairIKS2_S7_EEEE'
 @ 0x0x7fc0a42e1fe8
    > }
    >
    >
    > Fatal exception: Signal 6
    
    Change-Id: Ibd547536849b15d56711e065262197a2e168db3d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135961
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>

diff --git a/vcl/source/treelist/treelist.cxx b/vcl/source/treelist/treelist.cxx
index f118e5e35637..8f51e343fd98 100644
--- a/vcl/source/treelist/treelist.cxx
+++ b/vcl/source/treelist/treelist.cxx
@@ -23,6 +23,7 @@
 #include <tools/debug.hxx>
 #include <osl/diagnose.h>
 
+#include <cassert>
 #include <memory>
 #include <unordered_map>
 
@@ -1350,7 +1351,7 @@ const SvViewDataEntry* SvListView::GetViewData( const 
SvTreeListEntry* pEntry )
 SvViewDataEntry* SvListView::GetViewData( SvTreeListEntry* pEntry )
 {
     SvDataTable::iterator itr = m_pImpl->m_DataTable.find( pEntry );
-    DBG_ASSERT(itr != m_pImpl->m_DataTable.end(),"Entry not in model or wrong 
view");
+    assert(itr != m_pImpl->m_DataTable.end() && "Entry not in model or wrong 
view");
     return itr->second.get();
 }
 
commit 4e41879586fb24e925fb59dd06c43235f298e66d
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Wed Jun 15 20:37:18 2022 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Thu Jun 16 09:31:24 2022 +0200

    Related: tdf#123846 don't auto toggle radiobuttons with left/right
    
    just do the default cursor move, toggle can be triggered with
    space/return or directly with 0-9 (+ a for 10)
    
    Change-Id: I654ca64e49b3a9d4672668553095e971a5c9d1e8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135921
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 1aac737639b9..759dccc46721 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -480,6 +480,8 @@ class SwAddStylesDlg_Impl : public SfxDialogController
     std::unique_ptr<weld::Button> m_xRightPB;
     std::unique_ptr<weld::TreeView> m_xHeaderTree;
 
+    void ToggleOn(int nEntry, int nToggleColumn);
+
     DECL_LINK(OkHdl, weld::Button&, void);
     DECL_LINK(LeftRightHdl, weld::Button&, void);
     DECL_LINK(KeyInput, const KeyEvent&, bool);
@@ -614,15 +616,37 @@ IMPL_LINK(SwAddStylesDlg_Impl, KeyInput, const KeyEvent&, 
rKEvt, bool)
     vcl::KeyCode aCode = rKEvt.GetKeyCode();
     bool bHandled = false;
 
-    if (aCode.GetCode() == KEY_ADD || aCode.GetCode() == KEY_RIGHT)
-    {
-        LeftRightHdl(*m_xRightPB);
-        bHandled = true;
-    }
-    else if (aCode.GetCode() == KEY_SUBTRACT || aCode.GetCode() == KEY_LEFT)
+    sal_uInt16 nCode = aCode.GetCode();
+    switch (nCode)
     {
-        LeftRightHdl(*m_xLeftPB);
-        bHandled = true;
+        case KEY_ADD:
+            LeftRightHdl(*m_xRightPB);
+            bHandled = true;
+            break;
+        case KEY_SUBTRACT:
+            LeftRightHdl(*m_xLeftPB);
+            bHandled = true;
+            break;
+        case KEY_0:
+        case KEY_1:
+        case KEY_2:
+        case KEY_3:
+        case KEY_4:
+        case KEY_5:
+        case KEY_6:
+        case KEY_7:
+        case KEY_8:
+        case KEY_9:
+        case KEY_A:
+        {
+            int nEntry = m_xHeaderTree->get_selected_index();
+            if (nEntry != -1)
+            {
+                ToggleOn(nEntry, nCode != KEY_A ? nCode - KEY_0 : 10);
+                bHandled = true;
+            }
+            break;
+        }
     }
 
     return bHandled;
@@ -686,6 +710,11 @@ IMPL_LINK(SwAddStylesDlg_Impl, LeftRightHdl, 
weld::Button&, rBtn, void)
             ++nToggleColumn;
     }
 
+    ToggleOn(nEntry, nToggleColumn);
+}
+
+void SwAddStylesDlg_Impl::ToggleOn(int nEntry, int nToggleColumn)
+{
     for (sal_uInt16 j = 0; j <= MAXLEVEL; ++j)
     {
         m_xHeaderTree->set_toggle(nEntry, j == nToggleColumn ? TRISTATE_TRUE : 
TRISTATE_FALSE, j + 1);
diff --git a/sw/uiconfig/swriter/ui/assignstylesdialog.ui 
b/sw/uiconfig/swriter/ui/assignstylesdialog.ui
index f3d53261511b..c87d3f40c9a5 100644
--- a/sw/uiconfig/swriter/ui/assignstylesdialog.ui
+++ b/sw/uiconfig/swriter/ui/assignstylesdialog.ui
@@ -259,6 +259,7 @@
                         <property name="hexpand">True</property>
                         <property name="vexpand">True</property>
                         <property name="model">liststore1</property>
+                        <property name="enable-search">False</property>
                         <property name="search-column">0</property>
                         <property name="show-expanders">False</property>
                         <child internal-child="selection">

Reply via email to