[Libreoffice-commits] core.git: sfx2/source
Caolán McNamara
caolanm at redhat.com
Sat Jan 30 02:46:38 PST 2016
sfx2/source/appl/childwin.cxx | 26 ++------------------------
sfx2/source/appl/workwin.cxx | 36 +++---------------------------------
2 files changed, 5 insertions(+), 57 deletions(-)
New commits:
commit 5b86b716214a8279bc15852084ca59d6c833e144
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jan 29 21:23:27 2016 +0000
strange bit of oddity here, these all call the same thing
no need for the switch at all
Change-Id: I8fc52a1533697f5e9271aa76a17ceb58835ae1da
diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx
index 1df74ec..b8c7d0d 100644
--- a/sfx2/source/appl/childwin.cxx
+++ b/sfx2/source/appl/childwin.cxx
@@ -660,34 +660,12 @@ void SfxChildWindow::SetVisible_Impl( bool bVis )
void SfxChildWindow::Hide()
{
- switch ( pWindow->GetType() )
- {
- case RSC_DOCKINGWINDOW :
- static_cast<DockingWindow*>(pWindow.get())->Hide();
- break;
- case RSC_TOOLBOX :
- static_cast<ToolBox*>(pWindow.get())->Hide();
- break;
- default:
- pWindow->Hide();
- break;
- }
+ pWindow->Hide();
}
void SfxChildWindow::Show( ShowFlags nFlags )
{
- switch ( pWindow->GetType() )
- {
- case RSC_DOCKINGWINDOW :
- static_cast<DockingWindow*>(pWindow.get())->Show( true, nFlags );
- break;
- case RSC_TOOLBOX :
- static_cast<ToolBox*>(pWindow.get())->Show( true, nFlags );
- break;
- default:
- pWindow->Show( true, nFlags );
- break;
- }
+ pWindow->Show(true, nFlags);
}
vcl::Window* SfxChildWindow::GetContextWindow( SfxModule *pModule ) const
diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx
index 04cf860..17ecd21 100644
--- a/sfx2/source/appl/workwin.cxx
+++ b/sfx2/source/appl/workwin.cxx
@@ -1003,32 +1003,12 @@ void SfxWorkWindow::ShowChildren_Impl()
if ( SfxChildVisibility::VISIBLE == (pCli->nVisible & SfxChildVisibility::VISIBLE) && bVisible )
{
ShowFlags nFlags = pCli->bSetFocus ? ShowFlags::NONE : ShowFlags::NoFocusChange | ShowFlags::NoActivate;
- switch ( pCli->pWin->GetType() )
- {
- case RSC_DOCKINGWINDOW :
- static_cast<DockingWindow*>(pCli->pWin.get())->Show( true, nFlags );
- break;
- case RSC_SPLITWINDOW :
- static_cast<SplitWindow*>(pCli->pWin.get())->Show( true, nFlags );
- break;
- default:
- pCli->pWin->Show( true, nFlags );
- break;
- }
-
+ pCli->pWin->Show(true, nFlags);
pCli->bSetFocus = false;
}
else
{
- switch ( pCli->pWin->GetType() )
- {
- case RSC_DOCKINGWINDOW :
- static_cast<DockingWindow*>(pCli->pWin.get())->Hide();
- break;
- default:
- pCli->pWin->Hide();
- break;
- }
+ pCli->pWin->Hide();
}
}
}
@@ -1042,17 +1022,7 @@ void SfxWorkWindow::HideChildren_Impl()
{
SfxChild_Impl *pChild = aChildren[nPos-1];
if (pChild && pChild->pWin)
- {
- switch ( pChild->pWin->GetType() )
- {
- case RSC_DOCKINGWINDOW :
- static_cast<DockingWindow*>(pChild->pWin.get())->Hide();
- break;
- default:
- pChild->pWin->Hide();
- break;
- }
- }
+ pChild->pWin->Hide();
}
}
More information about the Libreoffice-commits
mailing list