[Libreoffice-commits] core.git: include/sfx2 sc/source sfx2/source sw/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Thu Mar 11 09:09:39 UTC 2021
include/sfx2/childwin.hxx | 4 ++--
sc/source/ui/navipi/navipi.cxx | 4 ++--
sfx2/source/appl/childwin.cxx | 8 ++++----
sw/source/uibase/utlui/navipi.cxx | 8 ++++----
4 files changed, 12 insertions(+), 12 deletions(-)
New commits:
commit cf234dc05a3a75199890e953d789bd19b02c1725
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Mar 9 20:15:28 2021 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Mar 11 10:08:47 2021 +0100
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 at redhat.com>
diff --git a/include/sfx2/childwin.hxx b/include/sfx2/childwin.hxx
index fd614a06d632..b78f8301c653 100644
--- a/include/sfx2/childwin.hxx
+++ b/include/sfx2/childwin.hxx
@@ -132,11 +132,11 @@ public:
sal_uInt16 GetContextId() const
{ return nContextId; }
- static SystemWindow* 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 5d813e172033..1759bf7cea23 100644
--- a/sc/source/ui/navipi/navipi.cxx
+++ b/sc/source/ui/navipi/navipi.cxx
@@ -447,7 +447,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()));
}
}
@@ -764,7 +764,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 72e469a04403..430593a88ab9 100644
--- a/sfx2/source/appl/childwin.cxx
+++ b/sfx2/source/appl/childwin.cxx
@@ -529,17 +529,17 @@ SfxChildWindowContext::~SfxChildWindowContext()
pWindow.disposeAndClear();
}
-SystemWindow* 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<SystemWindow*>(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 6052eafb1911..08ba46dae8e3 100644
--- a/sw/source/uibase/utlui/navipi.cxx
+++ b/sw/source/uibase/utlui/navipi.cxx
@@ -193,7 +193,7 @@ IMPL_LINK(SwNavigationPI, ToolBoxSelectHdl, const OString&, rCommand, void)
}
else if (rCommand == "listbox")
{
- if (SfxChildWindowContext::GetFloatingWindow(GetParent()))
+ if (ParentIsFloatingWindow(GetParent()))
{
if (IsZoomedIn())
{
@@ -562,7 +562,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();
@@ -726,9 +726,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();
if (m_xContentTree)
{
More information about the Libreoffice-commits
mailing list