summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorJuergen Funk <juergen.funk_ml@cib.de>2023-02-08 12:15:44 +0100
committerSamuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>2023-02-09 15:26:48 +0000
commit7a851c5b2da723ca618061c12a14f11479748dfd (patch)
treed241eb3012f566712174a37ddc899f3546924a67 /framework
parent8d8d01140c299e49afd188a9b7e1ac2860099e8c (diff)
tdf#95936: Tooltip not updated in Toolbars after change Shortcut
The update of all toobars after change the shortcut was missing, this patch update the toolbars now Change-Id: Ibc896dc48c9143307b028a3c271476482111c2c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146678 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
Diffstat (limited to 'framework')
-rw-r--r--framework/inc/properties.h2
-rw-r--r--framework/source/layoutmanager/layoutmanager.cxx9
-rw-r--r--framework/source/layoutmanager/toolbarlayoutmanager.cxx14
-rw-r--r--framework/source/layoutmanager/toolbarlayoutmanager.hxx2
4 files changed, 26 insertions, 1 deletions
diff --git a/framework/inc/properties.h b/framework/inc/properties.h
index fead8e3e1fad..b11a5b2e9d71 100644
--- a/framework/inc/properties.h
+++ b/framework/inc/properties.h
@@ -49,6 +49,7 @@ inline constexpr OUStringLiteral LAYOUTMANAGER_PROPNAME_ASCII_REFRESHVISIBILITY
inline constexpr OUStringLiteral LAYOUTMANAGER_PROPNAME_ASCII_HIDECURRENTUI = u"HideCurrentUI";
inline constexpr OUStringLiteral LAYOUTMANAGER_PROPNAME_ASCII_LOCKCOUNT = u"LockCount";
inline constexpr OUStringLiteral LAYOUTMANAGER_PROPNAME_ASCII_PRESERVE_CONTENT_SIZE = u"PreserveContentSize";
+inline constexpr OUStringLiteral LAYOUTMANAGER_PROPNAME_ASCII_REFRESHTOOLTIP = u"RefreshContextToolbarToolTip";
#define LAYOUTMANAGER_PROPNAME_MENUBARCLOSER LAYOUTMANAGER_PROPNAME_ASCII_MENUBARCLOSER
@@ -58,6 +59,7 @@ inline constexpr OUStringLiteral LAYOUTMANAGER_PROPNAME_ASCII_PRESERVE_CONTENT_S
#define LAYOUTMANAGER_PROPHANDLE_HIDECURRENTUI 3
#define LAYOUTMANAGER_PROPHANDLE_LOCKCOUNT 4
#define LAYOUTMANAGER_PROPHANDLE_PRESERVE_CONTENT_SIZE 5
+#define LAYOUTMANAGER_PROPHANDLE_REFRESHTOOLTIP 6
/** properties for "UICommandDescription" class */
inline constexpr OUStringLiteral UICOMMANDDESCRIPTION_NAMEACCESS_COMMANDIMAGELIST = u"private:resource/image/commandimagelist";
diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx
index ec6ed5572d94..652521fdf6aa 100644
--- a/framework/source/layoutmanager/layoutmanager.cxx
+++ b/framework/source/layoutmanager/layoutmanager.cxx
@@ -130,6 +130,7 @@ LayoutManager::LayoutManager( const Reference< XComponentContext >& xContext ) :
registerProperty( LAYOUTMANAGER_PROPNAME_MENUBARCLOSER, LAYOUTMANAGER_PROPHANDLE_MENUBARCLOSER, beans::PropertyAttribute::TRANSIENT, &m_bMenuBarCloseButton, cppu::UnoType<decltype(m_bMenuBarCloseButton)>::get() );
registerPropertyNoMember( LAYOUTMANAGER_PROPNAME_ASCII_REFRESHVISIBILITY, LAYOUTMANAGER_PROPHANDLE_REFRESHVISIBILITY, beans::PropertyAttribute::TRANSIENT, cppu::UnoType<bool>::get(), css::uno::Any(false) );
registerProperty( LAYOUTMANAGER_PROPNAME_ASCII_PRESERVE_CONTENT_SIZE, LAYOUTMANAGER_PROPHANDLE_PRESERVE_CONTENT_SIZE, beans::PropertyAttribute::TRANSIENT, &m_bPreserveContentSize, cppu::UnoType<decltype(m_bPreserveContentSize)>::get() );
+ registerPropertyNoMember( LAYOUTMANAGER_PROPNAME_ASCII_REFRESHTOOLTIP, LAYOUTMANAGER_PROPHANDLE_REFRESHTOOLTIP, beans::PropertyAttribute::TRANSIENT, cppu::UnoType<bool>::get(), css::uno::Any(false) );
}
LayoutManager::~LayoutManager()
@@ -3001,7 +3002,7 @@ void SAL_CALL LayoutManager::elementReplaced( const ui::ConfigurationEvent& Even
void SAL_CALL LayoutManager::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle,
const uno::Any& aValue )
{
- if ( nHandle != LAYOUTMANAGER_PROPHANDLE_REFRESHVISIBILITY )
+ if ( (nHandle != LAYOUTMANAGER_PROPHANDLE_REFRESHVISIBILITY) && (nHandle != LAYOUTMANAGER_PROPHANDLE_REFRESHTOOLTIP) )
LayoutManager_PBase::setFastPropertyValue_NoBroadcast( nHandle, aValue );
switch( nHandle )
@@ -3029,6 +3030,12 @@ void SAL_CALL LayoutManager::setFastPropertyValue_NoBroadcast( sal_Int32 n
case LAYOUTMANAGER_PROPHANDLE_HIDECURRENTUI:
implts_setCurrentUIVisibility( !m_bHideCurrentUI );
break;
+
+ case LAYOUTMANAGER_PROPHANDLE_REFRESHTOOLTIP:
+ if (m_xToolbarManager.is())
+ m_xToolbarManager->updateToolbarsTips();
+ break;
+
default: break;
}
}
diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
index cf444b5ab31d..7b1f78f64c1e 100644
--- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx
+++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
@@ -3904,6 +3904,20 @@ void SAL_CALL ToolbarLayoutManager::elementReplaced( const ui::ConfigurationEven
pParentLayouter->requestLayout();
}
+void ToolbarLayoutManager::updateToolbarsTips()
+{
+ SolarMutexGuard g;
+
+ for (auto& elem : m_aUIElements)
+ {
+ uno::Reference< ui::XUIElementSettings > xElementSettings(elem.m_xUIElement, uno::UNO_QUERY);
+ if (!xElementSettings.is())
+ continue;
+ xElementSettings->updateSettings();
+ }
+}
+
+
uno::Reference< ui::XUIElement > ToolbarLayoutManager::getToolbar( std::u16string_view aName )
{
return implts_findToolbar( aName ).m_xUIElement;
diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.hxx b/framework/source/layoutmanager/toolbarlayoutmanager.hxx
index 3e7b631c653d..2a490f618a0b 100644
--- a/framework/source/layoutmanager/toolbarlayoutmanager.hxx
+++ b/framework/source/layoutmanager/toolbarlayoutmanager.hxx
@@ -115,6 +115,8 @@ class ToolbarLayoutManager : public ::cppu::WeakImplHelper< css::awt::XDockableW
css::uno::Reference< css::ui::XUIElement > getToolbar( std::u16string_view aName );
css::uno::Sequence< css::uno::Reference< css::ui::XUIElement > > getToolbars();
+ void updateToolbarsTips();
+
// child window notifications
void childWindowEvent( VclSimpleEvent const * pEvent );