tdf#141824 init navigator to possibly floating in base ctor
so its in the expected state when the child contents are created
Change-Id: Id5baaca8479334c8fa2ec60ce8b598b7a61a3d7b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114481
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/include/sfx2/navigat.hxx b/include/sfx2/navigat.hxx
index f26321d..febdefa 100644
--- a/include/sfx2/navigat.hxx
+++ b/include/sfx2/navigat.hxx
@@ -26,19 +26,16 @@
class SFX2_DLLPUBLIC SfxNavigatorWrapper : public SfxChildWindow
{
protected:
void Initialize(SfxChildWinInfo* pInfo);
void Initialize();
public:
SfxNavigatorWrapper( vcl::Window* pParent ,
sal_uInt16 nId ,
SfxBindings* pBindings ,
SfxChildWinInfo* pInfo );
SfxNavigatorWrapper(vcl::Window* pParent, sal_uInt16 nId);
};
class SFX2_DLLPUBLIC SfxNavigator : public SfxDockingWindow
{
public:
SfxNavigator(SfxBindings* pBindings, SfxChildWindow* pChildWin,
vcl::Window* pParent);
vcl::Window* pParent, SfxChildWinInfo* pInfo);
};
#endif
diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx
index f36a740..ef8b854 100644
--- a/sc/source/ui/navipi/navipi.cxx
+++ b/sc/source/ui/navipi/navipi.cxx
@@ -314,7 +314,8 @@ class ScNavigatorWin : public SfxNavigator
private:
std::unique_ptr<ScNavigatorDlg> m_xNavigator;
public:
ScNavigatorWin(SfxBindings* _pBindings, SfxChildWindow* pMgr, vcl::Window* pParent);
ScNavigatorWin(SfxBindings* _pBindings, SfxChildWindow* pMgr,
vcl::Window* pParent, SfxChildWinInfo* pInfo);
virtual void StateChanged(StateChangedType nStateChange) override;
virtual void dispose() override
{
@@ -327,8 +328,9 @@ public:
}
};
ScNavigatorWin::ScNavigatorWin(SfxBindings* _pBindings, SfxChildWindow* _pMgr, vcl::Window* _pParent)
: SfxNavigator(_pBindings, _pMgr, _pParent)
ScNavigatorWin::ScNavigatorWin(SfxBindings* _pBindings, SfxChildWindow* _pMgr,
vcl::Window* _pParent, SfxChildWinInfo* pInfo)
: SfxNavigator(_pBindings, _pMgr, _pParent, pInfo)
{
m_xNavigator = std::make_unique<ScNavigatorDlg>(_pBindings, m_xContainer.get(), this);
SetMinOutputSizePixel(GetOptimalSize());
@@ -953,10 +955,10 @@ SFX_IMPL_DOCKINGWINDOW(ScNavigatorWrapper, SID_NAVIGATOR);
ScNavigatorWrapper::ScNavigatorWrapper(vcl::Window *_pParent, sal_uInt16 nId,
SfxBindings* pBindings, SfxChildWinInfo* pInfo)
: SfxNavigatorWrapper(_pParent, nId, pBindings, pInfo)
: SfxNavigatorWrapper(_pParent, nId)
{
SetWindow(VclPtr<ScNavigatorWin>::Create(pBindings, this, _pParent));
Initialize(pInfo);
SetWindow(VclPtr<ScNavigatorWin>::Create(pBindings, this, _pParent, pInfo));
Initialize();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/dlg/NavigatorChildWindow.cxx b/sd/source/ui/dlg/NavigatorChildWindow.cxx
index a6eee97..6055c23 100644
--- a/sd/source/ui/dlg/NavigatorChildWindow.cxx
+++ b/sd/source/ui/dlg/NavigatorChildWindow.cxx
@@ -40,8 +40,9 @@ static void RequestNavigatorUpdate (SfxBindings const * pBindings)
}
}
SdNavigatorFloat::SdNavigatorFloat(SfxBindings* _pBindings, SfxChildWindow* _pMgr, vcl::Window* _pParent)
: SfxNavigator(_pBindings, _pMgr, _pParent)
SdNavigatorFloat::SdNavigatorFloat(SfxBindings* _pBindings, SfxChildWindow* _pMgr,
vcl::Window* _pParent, SfxChildWinInfo* pInfo)
: SfxNavigator(_pBindings, _pMgr, _pParent, pInfo)
, m_xNavWin(std::make_unique<SdNavigatorWin>(m_xContainer.get(), _pBindings, this))
, m_bSetInitialFocusOnActivate(true)
{
@@ -88,10 +89,10 @@ SFX_IMPL_DOCKINGWINDOW(SdNavigatorWrapper, SID_NAVIGATOR);
SdNavigatorWrapper::SdNavigatorWrapper(vcl::Window *_pParent, sal_uInt16 nId,
SfxBindings* pBindings, SfxChildWinInfo* pInfo)
: SfxNavigatorWrapper(_pParent, nId, pBindings, pInfo)
: SfxNavigatorWrapper(_pParent, nId)
{
SetWindow(VclPtr<SdNavigatorFloat>::Create(pBindings, this, _pParent));
Initialize(pInfo);
SetWindow(VclPtr<SdNavigatorFloat>::Create(pBindings, this, _pParent, pInfo));
Initialize();
}
} // end of namespace sd
diff --git a/sd/source/ui/inc/navigatr.hxx b/sd/source/ui/inc/navigatr.hxx
index 218b594..b19748c 100644
--- a/sd/source/ui/inc/navigatr.hxx
+++ b/sd/source/ui/inc/navigatr.hxx
@@ -86,7 +86,8 @@ private:
bool m_bSetInitialFocusOnActivate;
public:
SdNavigatorFloat(SfxBindings* _pBindings, SfxChildWindow* pMgr, vcl::Window* pParent);
SdNavigatorFloat(SfxBindings* _pBindings, SfxChildWindow* pMgr,
vcl::Window* pParent, SfxChildWinInfo* pInfo);
void InitTreeLB(const SdDrawDocument* pDoc);
void FreshTree(const SdDrawDocument* pDoc);
virtual void Activate() override;
diff --git a/sfx2/source/dialog/navigat.cxx b/sfx2/source/dialog/navigat.cxx
index 90116d8..aac78f3 100644
--- a/sfx2/source/dialog/navigat.cxx
+++ b/sfx2/source/dialog/navigat.cxx
@@ -28,32 +28,29 @@
#include <helpids.h>
#include <tools/debug.hxx>
SfxNavigatorWrapper::SfxNavigatorWrapper( vcl::Window* pParentWnd ,
sal_uInt16 nId ,
SfxBindings* /*pBindings*/ ,
SfxChildWinInfo* /*pInfo*/ )
: SfxChildWindow( pParentWnd , nId )
SfxNavigatorWrapper::SfxNavigatorWrapper(vcl::Window* pParentWnd, sal_uInt16 nId)
: SfxChildWindow(pParentWnd , nId)
{
}
void SfxNavigatorWrapper::Initialize(SfxChildWinInfo* pInfo)
void SfxNavigatorWrapper::Initialize()
{
GetWindow()->SetHelpId ( HID_NAVIGATOR_WINDOW );
GetWindow()->SetOutputSizePixel( Size( 270, 240 ) );
static_cast<SfxDockingWindow*>( GetWindow() )->Initialize( pInfo );
SetHideNotDelete( true );
SetHideNotDelete(true);
}
SfxNavigator::SfxNavigator( SfxBindings* pBind ,
SfxChildWindow* pChildWin ,
vcl::Window* pParent )
SfxNavigator::SfxNavigator(SfxBindings* pBind ,
SfxChildWindow* pChildWin ,
vcl::Window* pParent,
SfxChildWinInfo* pInfo)
: SfxDockingWindow(pBind ,
pChildWin ,
pParent ,
"Navigator", "sfx/ui/navigator.ui")
{
SetText(SfxResId(STR_SID_NAVIGATOR));
SetHelpId(HID_NAVIGATOR_WINDOW);
SetOutputSizePixel(Size(270, 240));
Initialize(pInfo);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx
index 47593d6..05bbbe6 100644
--- a/sw/source/uibase/utlui/navipi.cxx
+++ b/sw/source/uibase/utlui/navipi.cxx
@@ -1093,7 +1093,8 @@ class SwNavigatorWin : public SfxNavigator
private:
std::unique_ptr<SwNavigationPI> m_xNavi;
public:
SwNavigatorWin(SfxBindings* _pBindings, SfxChildWindow* _pMgr, vcl::Window* pParent);
SwNavigatorWin(SfxBindings* _pBindings, SfxChildWindow* _pMgr,
vcl::Window* pParent, SfxChildWinInfo* pInfo);
virtual void StateChanged(StateChangedType nStateChange) override;
virtual void dispose() override
{
@@ -1106,8 +1107,9 @@ public:
}
};
SwNavigatorWin::SwNavigatorWin(SfxBindings* _pBindings, SfxChildWindow* _pMgr, vcl::Window* pParent)
: SfxNavigator(_pBindings, _pMgr, pParent)
SwNavigatorWin::SwNavigatorWin(SfxBindings* _pBindings, SfxChildWindow* _pMgr,
vcl::Window* pParent, SfxChildWinInfo* pInfo)
: SfxNavigator(_pBindings, _pMgr, pParent, pInfo)
, m_xNavi(std::make_unique<SwNavigationPI>(m_xContainer.get(), _pBindings->GetActiveFrame(), _pBindings, this))
{
_pBindings->Invalidate(SID_NAVIGATOR);
@@ -1143,10 +1145,10 @@ SFX_IMPL_DOCKINGWINDOW(SwNavigatorWrapper, SID_NAVIGATOR);
SwNavigatorWrapper::SwNavigatorWrapper(vcl::Window *_pParent, sal_uInt16 nId,
SfxBindings* pBindings, SfxChildWinInfo* pInfo)
: SfxNavigatorWrapper(_pParent, nId, pBindings, pInfo)
: SfxNavigatorWrapper(_pParent, nId)
{
SetWindow(VclPtr<SwNavigatorWin>::Create(pBindings, this, _pParent));
Initialize(pInfo);
SetWindow(VclPtr<SwNavigatorWin>::Create(pBindings, this, _pParent, pInfo));
Initialize();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */