diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-03-09 20:15:28 +0000 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2021-05-25 12:12:25 +0200 |
commit | 38c511a368a1b6b1cc3a01d0baa63c6c044734db (patch) | |
tree | e5104b980034a5c8b7b9a1331d72b64fb2e131ea | |
parent | 2fc3b9e6652da307aa712936046a41c43008cda3 (diff) |
rename SfxChildWindowContext::GetFloatingWindow to what it does
Change-Id: I0a8e1be2c64d054e6af1e9826f993d3b219e854b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112245
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | include/sfx2/childwin.hxx | 4 | ||||
-rw-r--r-- | sc/source/ui/navipi/navipi.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/appl/childwin.cxx | 8 | ||||
-rw-r--r-- | sw/source/uibase/utlui/navipi.cxx | 8 |
4 files changed, 12 insertions, 12 deletions
diff --git a/include/sfx2/childwin.hxx b/include/sfx2/childwin.hxx index 3a945b47b1de..59fda46e5c82 100644 --- a/include/sfx2/childwin.hxx +++ b/include/sfx2/childwin.hxx @@ -133,11 +133,11 @@ public: sal_uInt16 GetContextId() const { return nContextId; } - static FloatingWindow* GetFloatingWindow(vcl::Window *pParent); - static void RegisterChildWindowContext(SfxModule*, sal_uInt16, std::unique_ptr<SfxChildWinContextFactory>); }; +extern SFX2_DLLPUBLIC bool ParentIsFloatingWindow(vcl::Window *pParent); + class SFX2_DLLPUBLIC SfxChildWindow { VclPtr<vcl::Window> pParent; // parent window ( Topwindow ) diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx index 16e546b8d1c9..434ac1dffc99 100644 --- a/sc/source/ui/navipi/navipi.cxx +++ b/sc/source/ui/navipi/navipi.cxx @@ -440,7 +440,7 @@ void ScNavigatorDlg::StateChanged(StateChangedType nStateChange) // When the navigator is displayed in the sidebar, or is otherwise // docked, it has the whole deck to fill. Therefore hide the button that // hides all controls below the top two rows of buttons. - m_xTbxCmd1->set_item_visible("contents", SfxChildWindowContext::GetFloatingWindow(GetParent()) != nullptr); + m_xTbxCmd1->set_item_visible("contents", ParentIsFloatingWindow(GetParent())); } } @@ -768,7 +768,7 @@ void ScNavigatorDlg::SetListMode(NavListMode eMode) { if (eMode != eListMode) { - bool bForceParentResize = SfxChildWindowContext::GetFloatingWindow(GetParent()) && + bool bForceParentResize = ParentIsFloatingWindow(GetParent()) && (eMode == NAV_LMODE_NONE || eListMode == NAV_LMODE_NONE); SfxNavigator* pNav = bForceParentResize ? dynamic_cast<SfxNavigator*>(GetParent()) : nullptr; if (pNav && eMode == NAV_LMODE_NONE) //save last normal size on minimizing diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx index 4a70d0c8592f..430593a88ab9 100644 --- a/sfx2/source/appl/childwin.cxx +++ b/sfx2/source/appl/childwin.cxx @@ -529,17 +529,17 @@ SfxChildWindowContext::~SfxChildWindowContext() pWindow.disposeAndClear(); } -FloatingWindow* SfxChildWindowContext::GetFloatingWindow(vcl::Window *pParent) +bool ParentIsFloatingWindow(vcl::Window *pParent) { if (pParent->GetType() == WindowType::DOCKINGWINDOW || pParent->GetType() == WindowType::TOOLBOX) { - return static_cast<DockingWindow*>(pParent)->GetFloatingWindow(); + return true; } if (pParent->GetType() == WindowType::FLOATINGWINDOW) { - return static_cast<FloatingWindow*>(pParent); + return true; } - return nullptr; + return false; } void SfxChildWindow::SetFactory_Impl( SfxChildWinFactory *pF ) diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx index 4961c99deaaa..6686fe732d1e 100644 --- a/sw/source/uibase/utlui/navipi.cxx +++ b/sw/source/uibase/utlui/navipi.cxx @@ -216,7 +216,7 @@ IMPL_LINK(SwNavigationPI, ToolBoxSelectHdl, const OString&, rCommand, void) } else if (rCommand == "listbox") { - if (SfxChildWindowContext::GetFloatingWindow(GetParent())) + if (ParentIsFloatingWindow(GetParent())) { if (IsZoomedIn()) { @@ -588,7 +588,7 @@ SwNavigationPI::SwNavigationPI(vcl::Window* pParent, m_aStatusArr[3] = SwResId(STR_ACTIVE_VIEW); - bool bFloatingNavigator = SfxChildWindowContext::GetFloatingWindow(GetParent()) != nullptr; + bool bFloatingNavigator = ParentIsFloatingWindow(GetParent()); m_xContentTree->set_selection_mode(SelectionMode::Single); m_xContentTree->ShowTree(); @@ -752,9 +752,9 @@ void SwNavigationPI::StateChanged(StateChangedType nStateChange) // the sidebar or is otherwise docked. While the navigator could change // its size, the sidebar can not, and the navigator would just waste // space. Therefore disable this button. - m_xContent6ToolBox->set_item_sensitive("listbox", SfxChildWindowContext::GetFloatingWindow(GetParent()) != nullptr); + m_xContent6ToolBox->set_item_sensitive("listbox", ParentIsFloatingWindow(GetParent())); // show content if docked - if (SfxChildWindowContext::GetFloatingWindow(GetParent()) == nullptr && IsZoomedIn()) + if (!ParentIsFloatingWindow(GetParent()) && IsZoomedIn()) ZoomOut(); } else if (nStateChange == StateChangedType::ControlFocus) |