summaryrefslogtreecommitdiff
path: root/vcl/source/control
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2015-11-11 12:16:30 +0100
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2015-11-12 11:46:14 +0100
commitb34eab5996c52269360d166815ef15a250627c48 (patch)
tree32e24a60fe6503fc8faa1652762278650dfc919f /vcl/source/control
parentca36bcc05d7159fd4cd8e3489fdf4b4551b696d6 (diff)
Vcl: Set PushButtons pressed if the uno slot is active
Change-Id: I89708d13da2b3882aa0b7578b5acf48b6408010b
Diffstat (limited to 'vcl/source/control')
-rw-r--r--vcl/source/control/button.cxx12
-rw-r--r--vcl/source/control/buttonstatuslistener.cxx2
2 files changed, 13 insertions, 1 deletions
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index d3435a57c8f2..153c706c6b76 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -617,6 +617,11 @@ bool Button::set_property(const OString &rKey, const OString &rValue)
return true;
}
+void Button::SetStateUno(const css::frame::FeatureStateEvent& rEvent)
+{
+ Enable(rEvent.IsEnabled);
+}
+
IMPL_STATIC_LINK_TYPED( Button, dispatchCommandHandler, Button*, pButton, void )
{
if (pButton == nullptr)
@@ -1601,6 +1606,13 @@ void PushButton::SetState( TriState eState )
}
}
+void PushButton::SetStateUno(const css::frame::FeatureStateEvent& rEvent)
+{
+ Button::SetStateUno(rEvent);
+ if (rEvent.State.has<bool>())
+ SetPressed(rEvent.State.get<bool>());
+}
+
void PushButton::SetPressed( bool bPressed )
{
if ( mbPressed != bPressed )
diff --git a/vcl/source/control/buttonstatuslistener.cxx b/vcl/source/control/buttonstatuslistener.cxx
index 984842df4d1c..bad5452daacf 100644
--- a/vcl/source/control/buttonstatuslistener.cxx
+++ b/vcl/source/control/buttonstatuslistener.cxx
@@ -45,7 +45,7 @@ ButtonStatusListener::ButtonStatusListener(Button* button, const rtl::OUString&
void ButtonStatusListener::statusChanged(const css::frame::FeatureStateEvent& rEvent)
throw(css::uno::RuntimeException, std::exception)
{
- mButton->Enable(rEvent.IsEnabled);
+ mButton->SetStateUno(rEvent);
}
void ButtonStatusListener::disposing(const css::lang::EventObject& /*Source*/)