tdf#105131 Remove Restore Defaut from sidebar custom menu

Refer to tdf#105131 comment #13

Change-Id: Ia3b33ed4ab971b6f6dd3c751c5f6e3dc6f30f5da
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171906
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
This commit is contained in:
Olivier Hallot 2024-08-15 10:16:55 -03:00
parent 1ff0a84e4a
commit dcf23ba463
4 changed files with 1 additions and 37 deletions

View file

@ -66,7 +66,6 @@ public:
void RemoveDeckHighlight ();
OUString const & GetDeckIdForIndex (const sal_Int32 nIndex) const;
void ToggleHideFlag (const sal_Int32 nIndex);
void RestoreHideFlags();
void UpdateFocusManager (FocusManager& rFocusManager);

View file

@ -1171,10 +1171,6 @@ IMPL_LINK(SidebarController, OnMenuItemSelected, const OUString&, rCurItemId, vo
IMPL_LINK(SidebarController, OnSubMenuItemSelected, const OUString&, rCurItemId, void)
{
if (rCurItemId == "restoredefault")
mpTabBar->RestoreHideFlags();
else
{
try
{
std::u16string_view sNumber;
@ -1200,7 +1196,6 @@ IMPL_LINK(SidebarController, OnSubMenuItemSelected, const OUString&, rCurItemId,
catch (RuntimeException&)
{
}
}
}

View file

@ -307,22 +307,6 @@ void TabBar::ToggleHideFlag (const sal_Int32 nIndex)
UpdateMenus();
}
void TabBar::RestoreHideFlags()
{
for (auto & item : maItems)
{
if (item->mbIsHidden != item->mbIsHiddenByDefault)
{
item->mbIsHidden = item->mbIsHiddenByDefault;
std::shared_ptr<DeckDescriptor> xDeckDescriptor = mrParentSidebarController.GetResourceManager()->GetDeckDescriptor(item->msDeckId);
if (xDeckDescriptor)
xDeckDescriptor->mbIsEnabled = !item->mbIsHidden;
}
}
UpdateMenus();
}
void TabBar::UpdateFocusManager(FocusManager& rFocusManager)
{
std::vector<weld::Widget*> aButtons;

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.38.2 -->
<!-- Generated with glade 3.40.0 -->
<interface domain="sfx">
<requires lib="gtk+" version="3.20"/>
<object class="GtkImage" id="image6">
@ -53,20 +53,6 @@
<object class="GtkMenu" id="submenu">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkSeparatorMenuItem" id="separator2">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="restoredefault">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes" context="tabbar|restoredefault">Restore Default</property>
<property name="use-underline">True</property>
</object>
</child>
</object>
</child>
</object>