[Libreoffice-commits] core.git: toolkit/inc toolkit/source
Michael Weghorn (via logerrit)
logerrit at kemper.freedesktop.org
Fri May 15 18:48:48 UTC 2020
toolkit/inc/controls/controlmodelcontainerbase.hxx | 1 -
toolkit/source/controls/controlmodelcontainerbase.cxx | 13 +++++++++----
2 files changed, 9 insertions(+), 5 deletions(-)
New commits:
commit 25c692c2a94ab83c2c859ac5ab334b62ac8b825e
Author: Michael Weghorn <m.weghorn at posteo.de>
AuthorDate: Fri May 15 15:28:14 2020 +0200
Commit: Michael Weghorn <m.weghorn at posteo.de>
CommitDate: Fri May 15 20:48:12 2020 +0200
ControlModelContainerBase: Use property for enabled status
Use the property BASEPROPERTY_ENABLED for getting and setting
the status instead of handling it in a custom bool member
variable.
This way, property changes are also automatically propagated
and can be handled by the corresponding listeners.
Change-Id: I3a36ac8738a7caae987894ac9dd271d2713c1e09
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94310
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn at posteo.de>
diff --git a/toolkit/inc/controls/controlmodelcontainerbase.hxx b/toolkit/inc/controls/controlmodelcontainerbase.hxx
index 31ff2cdb9e73..c2d715dc3b61 100644
--- a/toolkit/inc/controls/controlmodelcontainerbase.hxx
+++ b/toolkit/inc/controls/controlmodelcontainerbase.hxx
@@ -83,7 +83,6 @@ protected:
AllGroups maGroups;
bool mbGroupsUpToDate;
- bool m_bEnabled;
OUString m_sImageURL;
OUString m_sTooltip;
sal_Int16 m_nTabPageId;
diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx
index bff374628d49..fc5b0e374c1f 100644
--- a/toolkit/source/controls/controlmodelcontainerbase.cxx
+++ b/toolkit/source/controls/controlmodelcontainerbase.cxx
@@ -169,9 +169,9 @@ ControlModelContainerBase::ControlModelContainerBase( const Reference< XComponen
,maContainerListeners( *this )
,maChangeListeners ( GetMutex() )
,mbGroupsUpToDate( false )
- ,m_bEnabled( true )
,m_nTabPageId(0)
{
+ ImplRegisterProperty(BASEPROPERTY_ENABLED);
}
ControlModelContainerBase::ControlModelContainerBase( const ControlModelContainerBase& rModel )
@@ -179,7 +179,6 @@ ControlModelContainerBase::ControlModelContainerBase( const ControlModelContaine
, maContainerListeners( *this )
, maChangeListeners ( GetMutex() )
, mbGroupsUpToDate( false )
- , m_bEnabled( rModel.m_bEnabled )
, m_nTabPageId( rModel.m_nTabPageId )
{
}
@@ -735,11 +734,17 @@ void SAL_CALL ControlModelContainerBase::initialize (const Sequence<Any>& rArgum
}
sal_Bool SAL_CALL ControlModelContainerBase::getEnabled()
{
- return m_bEnabled;
+ SolarMutexGuard aGuard;
+ Reference<XPropertySet> xThis(*this, UNO_QUERY);
+ bool bEnabled;
+ xThis->getPropertyValue(GetPropertyName(BASEPROPERTY_ENABLED)) >>= bEnabled;
+ return bEnabled;
}
void SAL_CALL ControlModelContainerBase::setEnabled( sal_Bool _enabled )
{
- m_bEnabled = _enabled;
+ SolarMutexGuard aGuard;
+ Reference<XPropertySet> xThis(*this, UNO_QUERY);
+ xThis->setPropertyValue(GetPropertyName(BASEPROPERTY_ENABLED), makeAny(_enabled));
}
OUString SAL_CALL ControlModelContainerBase::getTitle()
{
More information about the Libreoffice-commits
mailing list