diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-08-30 20:41:38 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-08-31 08:10:47 +0200 |
commit | 1ff8e0a958685fbaf63fbc2d4c766a76869d4879 (patch) | |
tree | 84ec5d17e4618f98841dd1f3fa90e15f4714f310 /sfx2/source/appl/childwin.cxx | |
parent | d87acc9fed5fd42588f593ac5e1bfca8308499dd (diff) |
flatten SfxChildWinFactArr_Imp
it's just a vector with no additional intelligence
Change-Id: I91d014783e79130689b4f6eadb3ef6d8486227e6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121324
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2/source/appl/childwin.cxx')
-rw-r--r-- | sfx2/source/appl/childwin.cxx | 65 |
1 files changed, 24 insertions, 41 deletions
diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx index a608c919638b..404d912d9d3e 100644 --- a/sfx2/source/appl/childwin.cxx +++ b/sfx2/source/appl/childwin.cxx @@ -37,7 +37,6 @@ #include <sfx2/dockwin.hxx> #include <sfx2/dispatch.hxx> #include <workwin.hxx> -#include <childwinimpl.hxx> const sal_uInt16 nVersion = 2; @@ -208,26 +207,20 @@ std::unique_ptr<SfxChildWindow> SfxChildWindow::CreateChildWindow( sal_uInt16 nI // by using ChildWindowContext SfxApplication *pApp = SfxGetpApp(); { - SfxChildWinFactArr_Impl &rFactories = pApp->GetChildWinFactories_Impl(); - for ( size_t nFactory = 0; nFactory < rFactories.size(); ++nFactory ) + pFact = pApp->GetChildWinFactoryById(nId); + if ( pFact ) { - pFact = &rFactories[nFactory]; - if ( pFact->nId == nId ) + SfxChildWinInfo& rFactInfo = pFact->aInfo; + if ( rInfo.bVisible ) { - SfxChildWinInfo& rFactInfo = pFact->aInfo; - if ( rInfo.bVisible ) - { - if ( pBindings ) - pBindings->ENTERREGISTRATIONS(); - SfxChildWinInfo aInfo = rFactInfo; - Application::SetSystemWindowMode( SystemWindowFlags::NOAUTOMODE ); - pChild = pFact->pCtor( pParent, nId, pBindings, &aInfo ); - Application::SetSystemWindowMode( nOldMode ); - if ( pBindings ) - pBindings->LEAVEREGISTRATIONS(); - } - - break; + if ( pBindings ) + pBindings->ENTERREGISTRATIONS(); + SfxChildWinInfo aInfo = rFactInfo; + Application::SetSystemWindowMode( SystemWindowFlags::NOAUTOMODE ); + pChild = pFact->pCtor( pParent, nId, pBindings, &aInfo ); + Application::SetSystemWindowMode( nOldMode ); + if ( pBindings ) + pBindings->LEAVEREGISTRATIONS(); } } } @@ -236,30 +229,20 @@ std::unique_ptr<SfxChildWindow> SfxChildWindow::CreateChildWindow( sal_uInt16 nI SfxModule *pMod = pDisp ? SfxModule::GetActiveModule( pDisp->GetFrame() ) : nullptr; if (!pChild && pMod) { - SfxChildWinFactArr_Impl *pFactories = pMod->GetChildWinFactories_Impl(); - if ( pFactories ) + pFact = pMod->GetChildWinFactoryById(nId); + if ( pFact ) { - SfxChildWinFactArr_Impl &rFactories = *pFactories; - for ( size_t nFactory = 0; nFactory < rFactories.size(); ++nFactory ) + SfxChildWinInfo& rFactInfo = pFact->aInfo; + if ( rInfo.bVisible ) { - pFact = &rFactories[nFactory]; - if ( pFact->nId == nId ) - { - SfxChildWinInfo& rFactInfo = pFact->aInfo; - if ( rInfo.bVisible ) - { - if ( pBindings ) - pBindings->ENTERREGISTRATIONS(); - SfxChildWinInfo aInfo = rFactInfo; - Application::SetSystemWindowMode( SystemWindowFlags::NOAUTOMODE ); - pChild = pFact->pCtor( pParent, nId, pBindings, &aInfo ); - Application::SetSystemWindowMode( nOldMode ); - if ( pBindings ) - pBindings->LEAVEREGISTRATIONS(); - } - - break; - } + if ( pBindings ) + pBindings->ENTERREGISTRATIONS(); + SfxChildWinInfo aInfo = rFactInfo; + Application::SetSystemWindowMode( SystemWindowFlags::NOAUTOMODE ); + pChild = pFact->pCtor( pParent, nId, pBindings, &aInfo ); + Application::SetSystemWindowMode( nOldMode ); + if ( pBindings ) + pBindings->LEAVEREGISTRATIONS(); } } } |