summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/sfx2/childwin.hxx2
-rw-r--r--sc/source/ui/inc/navipi.hxx3
-rw-r--r--sc/source/ui/navipi/navipi.cxx16
-rw-r--r--sc/source/ui/sidebar/ScPanelFactory.cxx2
-rw-r--r--sfx2/source/appl/childwin.cxx16
-rw-r--r--sw/source/uibase/inc/navipi.hxx4
-rw-r--r--sw/source/uibase/sidebar/SwPanelFactory.cxx2
-rw-r--r--sw/source/uibase/utlui/navipi.cxx16
8 files changed, 29 insertions, 32 deletions
diff --git a/include/sfx2/childwin.hxx b/include/sfx2/childwin.hxx
index 3068d001cb52..45d6a9476138 100644
--- a/include/sfx2/childwin.hxx
+++ b/include/sfx2/childwin.hxx
@@ -137,6 +137,8 @@ public:
FloatingWindow* GetFloatingWindow() const;
+ static FloatingWindow* GetFloatingWindow(vcl::Window *pParent);
+
static void RegisterChildWindowContext(SfxModule*, sal_uInt16, SfxChildWinContextFactory*);
};
diff --git a/sc/source/ui/inc/navipi.hxx b/sc/source/ui/inc/navipi.hxx
index ac588dd5f7cd..c0dd4c7fa04e 100644
--- a/sc/source/ui/inc/navipi.hxx
+++ b/sc/source/ui/inc/navipi.hxx
@@ -194,7 +194,6 @@ private:
OUString aStrHidden;
OUString aStrActiveWin;
- bool bInSidebar;
sal_uInt16 nZoomId;
sal_uInt16 nChangeRootId;
sal_uInt16 nDragModeId;
@@ -257,7 +256,7 @@ private:
static void ReleaseFocus();
public:
- ScNavigatorDlg(SfxBindings* pB, bool bSidebar, vcl::Window* pParent);
+ ScNavigatorDlg(SfxBindings* pB, vcl::Window* pParent);
virtual ~ScNavigatorDlg() override;
virtual void dispose() override;
diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx
index 4c5df44d952e..fc963515a1e6 100644
--- a/sc/source/ui/navipi/navipi.cxx
+++ b/sc/source/ui/navipi/navipi.cxx
@@ -423,7 +423,7 @@ ScNavigatorDialogWrapper::ScNavigatorDialogWrapper(vcl::Window* pParent,
SfxChildWinInfo* /* pInfo */)
: SfxChildWindowContext(nId)
{
- pNavigator = VclPtr<ScNavigatorDlg>::Create(pBind, false, pParent);
+ pNavigator = VclPtr<ScNavigatorDlg>::Create(pBind, pParent);
if (SfxNavigator* pNav = dynamic_cast<SfxNavigator*>(pParent))
pNav->SetMinOutputSizePixel(pNavigator->GetOptimalSize());
SetWindow(pNavigator);
@@ -434,13 +434,12 @@ ScNavigatorDialogWrapper::ScNavigatorDialogWrapper(vcl::Window* pParent,
#define REGISTER_SLOT(i,id) \
ppBoundItems[i]=new ScNavigatorControllerItem(id,*this,rBindings);
-ScNavigatorDlg::ScNavigatorDlg(SfxBindings* pB, bool bSidebar, vcl::Window* pParent)
+ScNavigatorDlg::ScNavigatorDlg(SfxBindings* pB, vcl::Window* pParent)
: PanelLayout(pParent, "NavigatorPanel", "modules/scalc/ui/navigatorpanel.ui", nullptr)
, rBindings(*pB)
, aStrDragMode(ScResId(SCSTR_DRAGMODE))
, aStrDisplay(ScResId(SCSTR_DISPLAY))
, aStrActiveWin(ScResId(SCSTR_ACTIVEWIN))
- , bInSidebar(bSidebar)
, pMarkArea(nullptr)
, pViewData(nullptr )
, eListMode(NAV_LMODE_NONE)
@@ -531,11 +530,11 @@ ScNavigatorDlg::ScNavigatorDlg(SfxBindings* pB, bool bSidebar, vcl::Window* pPar
aContentIdle.SetIdleHdl( LINK( this, ScNavigatorDlg, TimeHdl ) );
aContentIdle.SetPriority( SchedulerPriority::LOWEST );
- if (bInSidebar)
+ if (!SfxChildWindowContext::GetFloatingWindow(GetParent()))
{
- // When the navigator is displayed in the sidebar it has the whole deck
- // to fill. Therefore hide the button that hides all controls below
- // the top two rows of buttons.
+ // 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.
aTbxCmd->RemoveItem(aTbxCmd->GetItemPos(nZoomId));
}
aLbEntries->SetNavigatorDlgFlag(true);
@@ -841,7 +840,8 @@ void ScNavigatorDlg::SetListMode(NavListMode eMode)
{
if (eMode != eListMode)
{
- bool bForceParentResize = (eMode == NAV_LMODE_NONE || eListMode == NAV_LMODE_NONE);
+ bool bForceParentResize = SfxChildWindowContext::GetFloatingWindow(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
aExpandedSize = GetSizePixel();
diff --git a/sc/source/ui/sidebar/ScPanelFactory.cxx b/sc/source/ui/sidebar/ScPanelFactory.cxx
index e7054009704f..95740e46731f 100644
--- a/sc/source/ui/sidebar/ScPanelFactory.cxx
+++ b/sc/source/ui/sidebar/ScPanelFactory.cxx
@@ -93,7 +93,7 @@ Reference<ui::XUIElement> SAL_CALL ScPanelFactory::createUIElement (
pPanel = NumberFormatPropertyPanel::Create( pParentWindow, xFrame, pBindings );
else if (rsResourceURL.endsWith("/NavigatorPanel"))
{
- pPanel = VclPtr<ScNavigatorDlg>::Create(pBindings, true, pParentWindow);
+ pPanel = VclPtr<ScNavigatorDlg>::Create(pBindings, pParentWindow);
nMinimumSize = 0;
}
else if (rsResourceURL.endsWith("/FunctionsPanel"))
diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx
index a637818b227a..e08141e7e303 100644
--- a/sfx2/source/appl/childwin.cxx
+++ b/sfx2/source/appl/childwin.cxx
@@ -519,22 +519,22 @@ SfxChildWindowContext::~SfxChildWindowContext()
pWindow.disposeAndClear();
}
-FloatingWindow* SfxChildWindowContext::GetFloatingWindow() const
+FloatingWindow* SfxChildWindowContext::GetFloatingWindow(vcl::Window *pParent)
{
- vcl::Window *pParent = pWindow->GetParent();
if (pParent->GetType() == WINDOW_DOCKINGWINDOW || pParent->GetType() == WINDOW_TOOLBOX)
{
return static_cast<DockingWindow*>(pParent)->GetFloatingWindow();
}
- else if (pParent->GetType() == WINDOW_FLOATINGWINDOW)
+ if (pParent->GetType() == WINDOW_FLOATINGWINDOW)
{
return static_cast<FloatingWindow*>(pParent);
}
- else
- {
- OSL_FAIL("No FloatingWindow-Context!");
- return nullptr;
- }
+ return nullptr;
+}
+
+FloatingWindow* SfxChildWindowContext::GetFloatingWindow() const
+{
+ return SfxChildWindowContext::GetFloatingWindow(pWindow->GetParent());
}
void SfxChildWindow::SetFactory_Impl( SfxChildWinFactory *pF )
diff --git a/sw/source/uibase/inc/navipi.hxx b/sw/source/uibase/inc/navipi.hxx
index 503c1d7da878..c7417dd582e5 100644
--- a/sw/source/uibase/inc/navipi.hxx
+++ b/sw/source/uibase/inc/navipi.hxx
@@ -85,8 +85,6 @@ class SwNavigationPI : public PanelLayout,
VclPtr<SfxPopupWindow> m_pPopupWindow;
VclPtr<SfxPopupWindow> m_pFloatingWindow;
- SfxChildWindowContext* m_pContextWin;
-
SwNavigationConfig *m_pConfig;
SfxBindings &m_rBindings;
@@ -135,7 +133,7 @@ protected:
public:
- SwNavigationPI(SfxBindings*, SfxChildWindowContext*, vcl::Window*);
+ SwNavigationPI(SfxBindings*, vcl::Window*);
virtual ~SwNavigationPI() override;
virtual void dispose() override;
diff --git a/sw/source/uibase/sidebar/SwPanelFactory.cxx b/sw/source/uibase/sidebar/SwPanelFactory.cxx
index d1d85d1d5f22..426b91ee8260 100644
--- a/sw/source/uibase/sidebar/SwPanelFactory.cxx
+++ b/sw/source/uibase/sidebar/SwPanelFactory.cxx
@@ -170,7 +170,7 @@ Reference<ui::XUIElement> SAL_CALL SwPanelFactory::createUIElement (
}
else if (rsResourceURL.endsWith("/NavigatorPanel"))
{
- VclPtrInstance<SwNavigationPI> pPanel(pBindings, nullptr, pParentWindow);
+ VclPtrInstance<SwNavigationPI> pPanel(pBindings, pParentWindow);
xElement = sfx2::sidebar::SidebarPanelBase::Create(
rsResourceURL,
xFrame,
diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx
index 18aaeb73ac72..6204b0e098a9 100644
--- a/sw/source/uibase/utlui/navipi.cxx
+++ b/sw/source/uibase/utlui/navipi.cxx
@@ -245,7 +245,7 @@ IMPL_LINK( SwNavigationPI, ToolBoxSelectHdl, ToolBox *, pBox, void )
}
else if (sCommand == "listbox")
{
- if (m_pContextWin && m_pContextWin->GetFloatingWindow())
+ if (SfxChildWindowContext::GetFloatingWindow(GetParent()))
{
if (IsZoomedIn())
{
@@ -584,7 +584,6 @@ void SwNavigationPI::ZoomIn()
}
SwNavigationPI::SwNavigationPI(SfxBindings* _pBindings,
- SfxChildWindowContext* pCw,
vcl::Window* pParent)
: PanelLayout(pParent, "NavigatorPanel", "modules/swriter/ui/navigatorpanel.ui", nullptr)
, SfxControllerItem(SID_DOCFULLNAME, *_pBindings)
@@ -595,7 +594,6 @@ SwNavigationPI::SwNavigationPI(SfxBindings* _pBindings,
, m_pCreateView(nullptr)
, m_pPopupWindow(nullptr)
, m_pFloatingWindow(nullptr)
- , m_pContextWin(pCw)
, m_pConfig(SW_MOD()->GetNavigationConfig())
, m_rBindings(*_pBindings)
, m_nAutoMarkIdx(1)
@@ -734,12 +732,12 @@ SwNavigationPI::SwNavigationPI(SfxBindings* _pBindings,
m_aGlobalTree->SetAccessibleName(SW_RESSTR(STR_ACCESS_TL_GLOBAL));
m_aDocListBox->SetAccessibleName(m_aStatusArr[3]);
- if (m_pContextWin == nullptr)
+ if (!SfxChildWindowContext::GetFloatingWindow(GetParent()))
{
- // When the context window is missing then the navigator is
- // displayed in the sidebar. While the navigator could change
- // its size, the sidebar can not, and the navigator would just
- // waste space. Therefore hide this button.
+ // if the parent isn't a float, then then the navigator is displayed in
+ // 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 hide this button.
m_aContentToolBox->RemoveItem(m_aContentToolBox->GetItemPos(m_aContentToolBox->GetItemId("listbox")));
}
@@ -1206,7 +1204,7 @@ SwNavigationChild::SwNavigationChild( vcl::Window* pParent,
SfxChildWinInfo* )
: SfxChildWindowContext( nId )
{
- VclPtr<SwNavigationPI> pNavi = VclPtr<SwNavigationPI>::Create( _pBindings, this, pParent );
+ VclPtr<SwNavigationPI> pNavi = VclPtr<SwNavigationPI>::Create(_pBindings, pParent);
_pBindings->Invalidate(SID_NAVIGATOR);
SwNavigationConfig* pNaviConfig = SW_MOD()->GetNavigationConfig();