cui/source/options/optgdlg.cxx                     |   36 -----
 cui/source/options/optgdlg.hxx                     |    5 
 cui/uiconfig/ui/optviewpage.ui                     |  129 ---------------------
 framework/source/accelerators/acceleratorcache.cxx |   19 ++-
 4 files changed, 18 insertions(+), 171 deletions(-)

New commits:
commit c6dffdf014127af23b0b20b1015a4b6fdf0e1ac9
Author:     Juergen Funk <juergen.funk...@cib.de>
AuthorDate: Wed Feb 15 12:02:31 2023 +0100
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>
CommitDate: Mon Mar 20 11:37:04 2023 +0000

    tdf#153587 If one of the multiple shortcuts is deleted,
    
      the next one is not displayed
    
    This patch solve the part 2 of the bug, the problem was
    that it did not take into account whether a command was assigned
    multiple keys, it simply deleted the whole command
    
    Change-Id: I4e09096d3bc112ed49a4210dd294d1acf7a48159
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147093
    Tested-by: Jenkins
    Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>

diff --git a/framework/source/accelerators/acceleratorcache.cxx 
b/framework/source/accelerators/acceleratorcache.cxx
index 342b9701f99d..0163654d4bf7 100644
--- a/framework/source/accelerators/acceleratorcache.cxx
+++ b/framework/source/accelerators/acceleratorcache.cxx
@@ -90,8 +90,23 @@ void AcceleratorCache::removeKey(const css::awt::KeyEvent& 
aKey)
     // remove key from primary list
     m_lKey2Commands.erase(aKey);
 
-    // remove key from optimized command list
-    m_lCommand2Keys.erase(sCommand);
+    // get keylist for that command
+    TCommand2Keys::iterator pCommand = m_lCommand2Keys.find(sCommand);
+    if (pCommand == m_lCommand2Keys.end())
+        return;
+    TKeyList& lKeys = pCommand->second;
+
+    // one or more keys assign
+    if (lKeys.size() == 1)
+        // remove key from optimized command list
+        m_lCommand2Keys.erase(sCommand);
+    else // only remove this key from the keylist
+    {
+        auto pKeys = ::std::find(lKeys.begin(), lKeys.end(), aKey);
+
+        if (pKeys != lKeys.end())
+            lKeys.erase(pKeys);
+    }
 }
 
 void AcceleratorCache::removeCommand(const OUString& sCommand)
commit 770eea32b68a95e493a86a97eba5003c46ed736b
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Mon Mar 20 09:44:16 2023 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Mon Mar 20 11:37:01 2023 +0000

    tdf#152898 remove "show context menu shortcuts" from options page
    
    Change-Id: I44acae51ca72ece735f264e826f8d254e85be8f1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149148
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 71ac0594cd15..8a30f35535a9 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -530,9 +530,6 @@ OfaViewTabPage::OfaViewTabPage(weld::Container* pPage, 
weld::DialogController* p
     , m_xFontAntiAliasing(m_xBuilder->weld_check_button("aafont"))
     , m_xAAPointLimitLabel(m_xBuilder->weld_label("aafrom"))
     , m_xAAPointLimit(m_xBuilder->weld_metric_spin_button("aanf", 
FieldUnit::PIXEL))
-    , m_xMenuIconBox(m_xBuilder->weld_widget("menuiconsbox"))
-    , m_xMenuIconsLB(m_xBuilder->weld_combo_box("menuicons"))
-    , 
m_xContextMenuShortcutsLB(m_xBuilder->weld_combo_box("contextmenushortcuts"))
     , m_xFontShowCB(m_xBuilder->weld_check_button("showfontpreview"))
     , m_xUseHardwareAccell(m_xBuilder->weld_check_button("useaccel"))
     , m_xUseAntiAliase(m_xBuilder->weld_check_button("useaa"))
@@ -547,9 +544,6 @@ OfaViewTabPage::OfaViewTabPage(weld::Container* pPage, 
weld::DialogController* p
     , m_sAutoStr(m_xIconStyleLB->get_text(0))
 {
     OUString sToolKitName(Application::GetToolkitName());
-    if (sToolKitName.startsWith("gtk"))
-        m_xMenuIconBox->hide();
-
     const bool bHasDarkMode = sToolKitName.startsWith("gtk") || sToolKitName 
== "osx" || sToolKitName == "win";
     if (!bHasDarkMode)
         m_xDarkModeFrame->hide();
@@ -781,33 +775,12 @@ bool OfaViewTabPage::FillItemSet( SfxItemSet* )
         bModified = true;
     }
 
-    if (m_xMenuIconsLB->get_value_changed_from_saved())
-    {
-        
officecfg::Office::Common::View::Menu::IsSystemIconsInMenus::set(m_xMenuIconsLB->get_active()
 == 0, xChanges);
-        
officecfg::Office::Common::View::Menu::ShowIconsInMenues::set(m_xMenuIconsLB->get_active()
 == 2, xChanges);
-        bModified = true;
-        bMenuOptModified = true;
-        bAppearanceChanged = true;
-    }
-
     if (m_xAppearanceStyleLB->get_value_changed_from_saved())
     {
         bDarkModeOptModified = true;
         bModified = true;
     }
 
-    if (m_xContextMenuShortcutsLB->get_value_changed_from_saved())
-    {
-        officecfg::Office::Common::View::Menu::ShortcutsInContextMenus::set(
-            m_xContextMenuShortcutsLB->get_active() == 0 ?
-            TRISTATE_INDET :
-            static_cast<TriState>(m_xContextMenuShortcutsLB->get_active() - 1),
-            xChanges);
-        bModified = true;
-        bMenuOptModified = true;
-        bAppearanceChanged = true;
-    }
-
     // #i95644#  if disabled, do not use value, see in ::Reset()
     if (m_xUseHardwareAccell->get_sensitive())
     {
@@ -958,15 +931,6 @@ void OfaViewTabPage::Reset( const SfxItemSet* )
 
     // WorkingSet
     
m_xFontShowCB->set_active(officecfg::Office::Common::Font::View::ShowFontBoxWYSIWYG::get());
-    bool bSystemMenuIcons = 
officecfg::Office::Common::View::Menu::IsSystemIconsInMenus::get();
-    bool bMenuIcons = 
officecfg::Office::Common::View::Menu::ShowIconsInMenues::get();
-    m_xMenuIconsLB->set_active(bSystemMenuIcons ? 0 : (bMenuIcons ? 2 : 1));
-    m_xMenuIconsLB->save_value();
-
-    TriState eContextMenuShortcuts = 
static_cast<TriState>(officecfg::Office::Common::View::Menu::ShortcutsInContextMenus::get());
-    bool bContextMenuShortcutsNonDefault = eContextMenuShortcuts == 
TRISTATE_FALSE || eContextMenuShortcuts == TRISTATE_TRUE;
-    m_xContextMenuShortcutsLB->set_active(bContextMenuShortcutsNonDefault ? 
eContextMenuShortcuts + 1 : 0);
-    m_xContextMenuShortcutsLB->save_value();
 
     UpdateHardwareAccelStatus();
     m_xUseHardwareAccell->save_state();
diff --git a/cui/source/options/optgdlg.hxx b/cui/source/options/optgdlg.hxx
index 4e9c67e65f3c..620c6ed8659c 100644
--- a/cui/source/options/optgdlg.hxx
+++ b/cui/source/options/optgdlg.hxx
@@ -95,11 +95,6 @@ private:
     std::unique_ptr<weld::Label> m_xAAPointLimitLabel;
     std::unique_ptr<weld::MetricSpinButton> m_xAAPointLimit;
 
-    std::unique_ptr<weld::Widget> m_xMenuIconBox;
-    std::unique_ptr<weld::ComboBox> m_xMenuIconsLB;
-
-    std::unique_ptr<weld::ComboBox> m_xContextMenuShortcutsLB;
-
     std::unique_ptr<weld::CheckButton> m_xFontShowCB;
 
     std::unique_ptr<weld::CheckButton> m_xUseHardwareAccell;
diff --git a/cui/uiconfig/ui/optviewpage.ui b/cui/uiconfig/ui/optviewpage.ui
index 47e493bfe9f9..93160caa6ad5 100644
--- a/cui/uiconfig/ui/optviewpage.ui
+++ b/cui/uiconfig/ui/optviewpage.ui
@@ -23,7 +23,7 @@
     <property name="border-width">6</property>
     <property name="column-spacing">24</property>
     <child>
-      <!-- n-columns=1 n-rows=5 -->
+      <!-- n-columns=1 n-rows=4 -->
       <object class="GtkGrid" id="grid2">
         <property name="visible">True</property>
         <property name="can-focus">False</property>
@@ -129,129 +129,6 @@
               </object>
             </child>
           </object>
-          <packing>
-            <property name="left-attach">0</property>
-            <property name="top-attach">4</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkFrame" id="frame3">
-            <property name="visible">True</property>
-            <property name="can-focus">False</property>
-            <property name="label-xalign">0</property>
-            <property name="shadow-type">none</property>
-            <child>
-              <!-- n-columns=1 n-rows=2 -->
-              <object class="GtkGrid" id="grid8">
-                <property name="visible">True</property>
-                <property name="can-focus">False</property>
-                <property name="margin-start">12</property>
-                <property name="margin-top">6</property>
-                <property name="row-spacing">3</property>
-                <child>
-                  <!-- n-columns=2 n-rows=1 -->
-                  <object class="GtkGrid" id="menuiconsbox">
-                    <property name="visible">True</property>
-                    <property name="can-focus">False</property>
-                    <property name="hexpand">True</property>
-                    <property name="column-spacing">6</property>
-                    <child>
-                      <object class="GtkLabel" id="label13">
-                        <property name="visible">True</property>
-                        <property name="can-focus">False</property>
-                        <property name="label" translatable="yes" 
context="optviewpage|label13">Menu icons:</property>
-                        <property name="use-underline">True</property>
-                        <property name="mnemonic-widget">menuicons</property>
-                        <property name="xalign">0</property>
-                      </object>
-                      <packing>
-                        <property name="left-attach">0</property>
-                        <property name="top-attach">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkComboBoxText" id="menuicons">
-                        <property name="visible">True</property>
-                        <property name="can-focus">False</property>
-                        <property name="hexpand">True</property>
-                        <items>
-                          <item translatable="yes" 
context="optviewpage|menuicons">Automatic</item>
-                          <item translatable="yes" 
context="optviewpage|menuicons">Hide</item>
-                          <item translatable="yes" 
context="optviewpage|menuicons">Show</item>
-                        </items>
-                        <child internal-child="accessible">
-                          <object class="AtkObject" id="menuicons-atkobject">
-                            <property name="AtkObject::accessible-description" 
translatable="yes" context="extended_tip | menuicons">Displays icons next to 
the corresponding menu items. Select from "Automatic", "Hide" and "Show". 
"Automatic" displays icons according to system settings and themes.</property>
-                          </object>
-                        </child>
-                      </object>
-                      <packing>
-                        <property name="left-attach">1</property>
-                        <property name="top-attach">0</property>
-                      </packing>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="left-attach">0</property>
-                    <property name="top-attach">0</property>
-                  </packing>
-                </child>
-                <child>
-                  <!-- n-columns=2 n-rows=1 -->
-                  <object class="GtkGrid" id="menushortcutsbpx">
-                    <property name="visible">True</property>
-                    <property name="can-focus">False</property>
-                    <property name="hexpand">True</property>
-                    <property name="column-spacing">6</property>
-                    <child>
-                      <object class="GtkComboBoxText" 
id="contextmenushortcuts">
-                        <property name="visible">True</property>
-                        <property name="can-focus">False</property>
-                        <property name="hexpand">True</property>
-                        <items>
-                          <item translatable="yes" 
context="optviewpage|contextmenushortcuts">Automatic</item>
-                          <item translatable="yes" 
context="optviewpage|contextmenushortcuts">Hide</item>
-                          <item translatable="yes" 
context="optviewpage|contextmenushortcuts">Show</item>
-                        </items>
-                      </object>
-                      <packing>
-                        <property name="left-attach">1</property>
-                        <property name="top-attach">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="label10">
-                        <property name="visible">True</property>
-                        <property name="can-focus">False</property>
-                        <property name="label" translatable="yes" 
context="optviewpage|label10">Shortcuts:</property>
-                        <property name="use-underline">True</property>
-                        <property 
name="mnemonic-widget">contextmenushortcuts</property>
-                        <property name="xalign">0</property>
-                      </object>
-                      <packing>
-                        <property name="left-attach">0</property>
-                        <property name="top-attach">0</property>
-                      </packing>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="left-attach">0</property>
-                    <property name="top-attach">1</property>
-                  </packing>
-                </child>
-              </object>
-            </child>
-            <child type="label">
-              <object class="GtkLabel" id="label3">
-                <property name="visible">True</property>
-                <property name="can-focus">False</property>
-                <property name="label" translatable="yes" 
context="optviewpage|label3">Visibility</property>
-                <attributes>
-                  <attribute name="weight" value="bold"/>
-                </attributes>
-              </object>
-            </child>
-          </object>
           <packing>
             <property name="left-attach">0</property>
             <property name="top-attach">3</property>
@@ -839,8 +716,6 @@
     <widgets>
       <widget name="label11"/>
       <widget name="label12"/>
-      <widget name="label13"/>
-      <widget name="label10"/>
       <widget name="label8"/>
       <widget name="label9"/>
       <widget name="label14"/>
@@ -852,8 +727,6 @@
     <widgets>
       <widget name="mousepos"/>
       <widget name="mousemiddle"/>
-      <widget name="menuicons"/>
-      <widget name="contextmenushortcuts"/>
       <widget name="notebookbariconsize"/>
       <widget name="sidebariconsize"/>
       <widget name="iconsize"/>

Reply via email to