From 92289c5f121499959b6f5edf859e5f34b5b96a78 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Mon, 18 May 2020 10:51:14 +0200 Subject: tdf#133142 UnoControlTabPageContainer: Handle tab property changes In the model, changing a tab page's title or enabled/disabled status is done via methods 'XTabPageModel.setTitle' and 'XTabPageModel.setEnabled'. Changes to the title and enabled/disabled status are propagated to the tab page container containing the tab page (s.a. 25c692c2a94ab83c2c859ac5ab334b62ac8b825e ("ControlModelContainerBase: Use property for enabled status", 2020-05-15)). Make 'VCLXTabPageContainer' derive from 'XPropertiesChangeListener' and implement the 'propertiesChange' method defined in that interface to handle property changes for the tab pages and have 'UnoControlTabPageContainer' forward 'PropertyChangeEvent's to its peer so they can be handled there. This way, changes for those tab page properties via UNO are now properly updated in the UI as well. Change-Id: I6fa1fadf781575c4ad1d066aed9c3a651b10869d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94402 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- toolkit/inc/awt/vclxtabpagecontainer.hxx | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'toolkit/inc/awt') diff --git a/toolkit/inc/awt/vclxtabpagecontainer.hxx b/toolkit/inc/awt/vclxtabpagecontainer.hxx index fee096cc04ba..54fe0e0503aa 100644 --- a/toolkit/inc/awt/vclxtabpagecontainer.hxx +++ b/toolkit/inc/awt/vclxtabpagecontainer.hxx @@ -20,6 +20,7 @@ #pragma once #include +#include #include #include #include @@ -28,6 +29,7 @@ typedef cppu::ImplInheritanceHelper< VCLXContainer, css::awt::tab::XTabPageContainer, + css::beans::XPropertiesChangeListener, css::container::XContainerListener > VCLXTabPageContainer_Base; class VCLXTabPageContainer final : public VCLXTabPageContainer_Base @@ -56,6 +58,9 @@ public: virtual void SAL_CALL elementRemoved( const css::container::ContainerEvent& Event ) override; virtual void SAL_CALL elementReplaced( const css::container::ContainerEvent& Event ) override; + // css::beans::XPropertiesChangeListener + virtual void SAL_CALL propertiesChange( const ::css::uno::Sequence< ::css::beans::PropertyChangeEvent >& aEvent ) override; + // css::awt::XVclWindowPeer void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override; private: -- cgit