diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2018-10-28 23:51:21 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2018-10-29 05:59:15 +0100 |
commit | 951a65923c088a1e19a4073f3c26a3b564a0a922 (patch) | |
tree | 5e7191cc0783df304e5f7f28616dd31ee950a405 /sfx2 | |
parent | cb7500ddb8de6c41fca84a0009ffe22240bb1845 (diff) |
tdf#120703 PVS: V547 Expression is always true/false
Change-Id: I0516dc68cf7d451eafc044be8e50a66d2bddf15f
Reviewed-on: https://gerrit.libreoffice.org/62484
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/view/viewfrm.cxx | 53 | ||||
-rw-r--r-- | sfx2/source/view/viewfrm2.cxx | 8 |
2 files changed, 29 insertions, 32 deletions
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 9b1d7b1fe507..a5e2cb63a457 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -1727,39 +1727,36 @@ void SfxViewFrame::MakeActive_Impl( bool bGrabFocus ) { if ( IsVisible() ) { - if ( GetViewShell() ) + bool bPreview = false; + if (GetObjectShell()->IsPreview()) { - bool bPreview = false; - if ( GetObjectShell()->IsPreview() ) - { - bPreview = true; - } + bPreview = true; + } - css::uno::Reference< css::frame::XFrame > xFrame = GetFrame().GetFrameInterface(); - if ( !bPreview ) - { - SetViewFrame( this ); - GetBindings().SetActiveFrame( css::uno::Reference< css::frame::XFrame >() ); - uno::Reference< frame::XFramesSupplier > xSupp( xFrame, uno::UNO_QUERY ); - if ( xSupp.is() ) - xSupp->setActiveFrame( uno::Reference < frame::XFrame >() ); - - css::uno::Reference< css::awt::XWindow > xContainerWindow = xFrame->getContainerWindow(); - VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow(xContainerWindow); - if (pWindow && pWindow->HasChildPathFocus() && bGrabFocus) - { - SfxInPlaceClient *pCli = GetViewShell()->GetUIActiveClient(); - if ( !pCli || !pCli->IsObjectUIActive() ) - GetFrame().GrabFocusOnComponent_Impl(); - } - } - else + css::uno::Reference<css::frame::XFrame> xFrame = GetFrame().GetFrameInterface(); + if (!bPreview) + { + SetViewFrame(this); + GetBindings().SetActiveFrame(css::uno::Reference<css::frame::XFrame>()); + uno::Reference<frame::XFramesSupplier> xSupp(xFrame, uno::UNO_QUERY); + if (xSupp.is()) + xSupp->setActiveFrame(uno::Reference<frame::XFrame>()); + + css::uno::Reference< css::awt::XWindow > xContainerWindow = xFrame->getContainerWindow(); + VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow(xContainerWindow); + if (pWindow && pWindow->HasChildPathFocus() && bGrabFocus) { - GetBindings().SetDispatcher( GetDispatcher() ); - GetBindings().SetActiveFrame( css::uno::Reference< css::frame::XFrame > () ); - GetDispatcher()->Update_Impl(); + SfxInPlaceClient *pCli = GetViewShell()->GetUIActiveClient(); + if (!pCli || !pCli->IsObjectUIActive()) + GetFrame().GrabFocusOnComponent_Impl(); } } + else + { + GetBindings().SetDispatcher(GetDispatcher()); + GetBindings().SetActiveFrame(css::uno::Reference<css::frame::XFrame>()); + GetDispatcher()->Update_Impl(); + } } } } diff --git a/sfx2/source/view/viewfrm2.cxx b/sfx2/source/view/viewfrm2.cxx index af3b990234a5..a32995957ab6 100644 --- a/sfx2/source/view/viewfrm2.cxx +++ b/sfx2/source/view/viewfrm2.cxx @@ -164,16 +164,16 @@ void SfxViewFrame::Exec_Impl(SfxRequest &rReq ) if ( bShow ) { // First, make the floats viewable - pWorkWin->MakeChildrenVisible_Impl( bShow ); + pWorkWin->MakeChildrenVisible_Impl(true); GetDispatcher()->Update_Impl( true ); // Then view it - GetBindings().HidePopups( !bShow ); + GetBindings().HidePopups(false); } else { - pWorkWin->HidePopups_Impl( !bShow ); - pWorkWin->MakeChildrenVisible_Impl( bShow ); + pWorkWin->HidePopups_Impl(true); + pWorkWin->MakeChildrenVisible_Impl(false); } Invalidate( rReq.GetSlot() ); |