diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-11-29 17:17:32 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-11-29 17:17:32 +0100 |
commit | 8b30c5228b9d2031e5bbd2511a3bbe5f760ce836 (patch) | |
tree | 26672a40cebfdaf1f2c880b40b4b94d19ec575c8 /vcl/source/window/debugevent.cxx | |
parent | 7661bbbaef31adfdb298b1447301b24a70f85834 (diff) |
Rewrite some (trivial) assignments inside if/while conditions: vcl
Change-Id: I26fd9bf9838b0d9d6cf35dc62195216a0c1333ee
Diffstat (limited to 'vcl/source/window/debugevent.cxx')
-rw-r--r-- | vcl/source/window/debugevent.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/vcl/source/window/debugevent.cxx b/vcl/source/window/debugevent.cxx index 4bdc65a6545e..4810fc5ca759 100644 --- a/vcl/source/window/debugevent.cxx +++ b/vcl/source/window/debugevent.cxx @@ -35,18 +35,19 @@ static double getRandom() vcl::Window *DebugEventInjector::ChooseWindow() { - vcl::Window *pWindow, *pParent; + vcl::Window *pParent; - if (getRandom() < 0.80 && - (pWindow = Application::GetFocusWindow())) - return pWindow; + if (getRandom() < 0.80) + if (vcl::Window * pWindow = Application::GetFocusWindow()) + return pWindow; if (getRandom() > 0.50 || !(pParent = Application::GetActiveTopWindow())) { // select a top window at random long nIdx = Application::GetTopWindowCount() * getRandom(); - if (!(pParent = Application::GetTopWindow( nIdx ))) + pParent = Application::GetTopWindow( nIdx ); + if (!pParent) pParent = static_cast<vcl::Window *>(Application::GetAppWindow()); } assert (pParent != nullptr); |