diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-01-25 20:04:13 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-01-25 22:44:57 +0100 |
commit | eeb2d19e77d6dc47c68e8ba0920a02cf64a1247b (patch) | |
tree | 48b058b83abd59d61047d91afe43c6a190412acf /svtools/source/uno/popupwindowcontroller.cxx | |
parent | 9ce254a7797405b3b655ba4e5be2190cddad2902 (diff) |
Resolves: tdf#130159 hide writedirection unless CTL is enabled
rework as ToolboxControllers registered in Controller.xcu
Change-Id: I3e7fea09fe83d1ed6400218c41384f82b38b07a2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87419
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svtools/source/uno/popupwindowcontroller.cxx')
-rw-r--r-- | svtools/source/uno/popupwindowcontroller.cxx | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/svtools/source/uno/popupwindowcontroller.cxx b/svtools/source/uno/popupwindowcontroller.cxx index fcddc6c872c0..66986be60430 100644 --- a/svtools/source/uno/popupwindowcontroller.cxx +++ b/svtools/source/uno/popupwindowcontroller.cxx @@ -185,16 +185,16 @@ void SAL_CALL PopupWindowController::dispose() // XStatusListener void SAL_CALL PopupWindowController::statusChanged( const frame::FeatureStateEvent& rEvent ) { + SolarMutexGuard aSolarLock; + bool bValue = false; rEvent.State >>= bValue; - if (weld::TransportAsXWindow* pTunnel = dynamic_cast<weld::TransportAsXWindow*>(getParent().get())) + if (m_pToolbar) { - auto pToolbar = dynamic_cast<weld::Toolbar*>(pTunnel->getWidget()); - assert(pToolbar && "must be a toolbar"); OString sId = m_aCommandURL.toUtf8(); - pToolbar->set_item_active(sId, bValue); - pToolbar->set_item_sensitive(sId, rEvent.IsEnabled); + m_pToolbar->set_item_active(sId, bValue); + m_pToolbar->set_item_sensitive(sId, rEvent.IsEnabled); return; } @@ -202,7 +202,6 @@ void SAL_CALL PopupWindowController::statusChanged( const frame::FeatureStateEve sal_uInt16 nItemId = 0; if ( getToolboxId( nItemId, &pToolBox ) ) { - SolarMutexGuard aSolarLock; pToolBox->CheckItem( nItemId, bValue ); pToolBox->EnableItem( nItemId, rEvent.IsEnabled ); } |