summaryrefslogtreecommitdiff
path: root/sfx2/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-02-22 11:33:52 +0000
committerCaolán McNamara <caolanm@redhat.com>2021-02-22 15:14:04 +0100
commit20997b4598f559d3274916dc1c343c69e8feeceb (patch)
tree583b1aa9cba9380306d531fdb53400e3edf1dd28 /sfx2/source
parent40f81f1f9eb4266a897c6c5185544908d91c714e (diff)
factor out as a ResizableDockingWindow
Change-Id: I557ccf866cc879b3cc22fcdbca882f4413cb57d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111334 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2/source')
-rw-r--r--sfx2/source/appl/newhelp.cxx12
-rw-r--r--sfx2/source/appl/newhelp.hxx3
-rw-r--r--sfx2/source/dialog/dockwin.cxx33
3 files changed, 19 insertions, 29 deletions
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index 8d936e0dc28b..935b49c05374 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -77,7 +77,6 @@
#include <vcl/commandevent.hxx>
#include <vcl/event.hxx>
#include <vcl/i18nhelp.hxx>
-#include <vcl/layout.hxx>
#include <vcl/settings.hxx>
#include <vcl/svapp.hxx>
#include <vcl/unohelp.hxx>
@@ -2219,7 +2218,7 @@ void SfxHelpWindow_Impl::GetFocus()
if (pTextWin)
pTextWin->GrabFocus();
else
- DockingWindow::GetFocus();
+ ResizableDockingWindow::GetFocus();
}
void SfxHelpWindow_Impl::MakeLayout()
@@ -2422,7 +2421,7 @@ SfxHelpWindow_Impl::SfxHelpWindow_Impl(
const css::uno::Reference < css::frame::XFrame2 >& rFrame,
vcl::Window* pParent ) :
- DockingWindow(pParent, "DockingWindow", "vcl/ui/dockingwindow.ui"),
+ ResizableDockingWindow(pParent),
xFrame ( rFrame ),
pTextWin ( nullptr ),
@@ -2441,9 +2440,7 @@ SfxHelpWindow_Impl::SfxHelpWindow_Impl(
SetHelpId( HID_HELP_WINDOW );
- m_xVclContentArea = VclPtr<VclVBox>::Create(this);
- m_xVclContentArea->Show();
- m_xBuilder.reset(Application::CreateInterimBuilder(m_xVclContentArea, "sfx/ui/helpwindow.ui", false));
+ m_xBuilder.reset(Application::CreateInterimBuilder(m_xBox.get(), "sfx/ui/helpwindow.ui", false));
m_xContainer = m_xBuilder->weld_paned("HelpWindow");
m_xContainer->connect_size_allocate(LINK(this, SfxHelpWindow_Impl, ResizeHdl));
m_xHelpPaneWindow = m_xBuilder->weld_container("helppanewindow");
@@ -2483,9 +2480,8 @@ void SfxHelpWindow_Impl::dispose()
m_xHelpPaneWindow.reset();
m_xContainer.reset();
m_xBuilder.reset();
- m_xVclContentArea.disposeAndClear();
- DockingWindow::dispose();
+ ResizableDockingWindow::dispose();
}
bool SfxHelpWindow_Impl::PreNotify( NotifyEvent& rNEvt )
diff --git a/sfx2/source/appl/newhelp.hxx b/sfx2/source/appl/newhelp.hxx
index c7458b248e3c..5bf2c9c8aa63 100644
--- a/sfx2/source/appl/newhelp.hxx
+++ b/sfx2/source/appl/newhelp.hxx
@@ -410,13 +410,12 @@ public:
class HelpInterceptor_Impl;
class HelpListener_Impl;
-class SfxHelpWindow_Impl : public DockingWindow
+class SfxHelpWindow_Impl : public ResizableDockingWindow
{
private:
friend class SfxHelpIndexWindow_Impl;
std::unique_ptr<weld::Builder> m_xBuilder;
- VclPtr<vcl::Window> m_xVclContentArea;
std::unique_ptr<weld::Paned> m_xContainer;
std::unique_ptr<weld::Container> m_xHelpPaneWindow;
std::unique_ptr<weld::Container> m_xHelpTextWindow;
diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx
index 00d83db274d1..c7596a43bc75 100644
--- a/sfx2/source/dialog/dockwin.cxx
+++ b/sfx2/source/dialog/dockwin.cxx
@@ -20,7 +20,6 @@
#include <svl/eitem.hxx>
#include <svl/solar.hrc>
#include <vcl/event.hxx>
-#include <vcl/layout.hxx>
#include <vcl/settings.hxx>
#include <vcl/svapp.hxx>
@@ -435,7 +434,7 @@ SfxDockingWindow_Impl::SfxDockingWindow_Impl(SfxDockingWindow* pBase)
*/
void SfxDockingWindow::Resize()
{
- DockingWindow::Resize();
+ ResizableDockingWindow::Resize();
Invalidate();
if ( !pImpl || !pImpl->bConstructed || !pMgr )
return;
@@ -730,7 +729,7 @@ void SfxDockingWindow::EndDocking( const tools::Rectangle& rRect, bool bFloatMod
}
else
{
- DockingWindow::EndDocking(rRect, bFloatMode);
+ ResizableDockingWindow::EndDocking(rRect, bFloatMode);
}
SetAlignment( IsFloatingMode() ? SfxChildAlignment::NOALIGNMENT : pImpl->GetDockAlignment() );
@@ -754,10 +753,10 @@ void SfxDockingWindow::Resizing( Size& /*rSize*/ )
required because the docking is implemented in Sfx through SfxChildWindows.
*/
SfxDockingWindow::SfxDockingWindow( SfxBindings *pBindinx, SfxChildWindow *pCW,
- vcl::Window* pParent, WinBits nWinBits) :
- DockingWindow (pParent, nWinBits),
- pBindings(pBindinx),
- pMgr(pCW)
+ vcl::Window* pParent, WinBits nWinBits)
+ : ResizableDockingWindow(pParent, nWinBits)
+ , pBindings(pBindinx)
+ , pMgr(pCW)
{
pImpl.reset(new SfxDockingWindow_Impl(this));
}
@@ -767,13 +766,11 @@ SfxDockingWindow::SfxDockingWindow( SfxBindings *pBindinx, SfxChildWindow *pCW,
*/
SfxDockingWindow::SfxDockingWindow( SfxBindings *pBindinx, SfxChildWindow *pCW,
vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription)
- : DockingWindow(pParent, "DockingWindow", "vcl/ui/dockingwindow.ui")
+ : ResizableDockingWindow(pParent)
, pBindings(pBindinx)
, pMgr(pCW)
{
- m_xVclContentArea = VclPtr<VclVBox>::Create(this);
- m_xVclContentArea->Show();
- m_xBuilder.reset(Application::CreateInterimBuilder(m_xVclContentArea, rUIXMLDescription, true));
+ m_xBuilder.reset(Application::CreateInterimBuilder(m_xBox, rUIXMLDescription, true));
m_xContainer = m_xBuilder->weld_container(rID);
pImpl.reset(new SfxDockingWindow_Impl(this));
@@ -1043,8 +1040,7 @@ void SfxDockingWindow::dispose()
pImpl.reset();
m_xContainer.reset();
m_xBuilder.reset();
- m_xVclContentArea.disposeAndClear();
- DockingWindow::dispose();
+ ResizableDockingWindow::dispose();
}
void SfxDockingWindow::ReleaseChildWindow_Impl()
@@ -1437,7 +1433,7 @@ void SfxDockingWindow::Paint(vcl::RenderContext&, const tools::Rectangle& /*rRec
void SfxDockingWindow::SetMinOutputSizePixel( const Size& rSize )
{
pImpl->aMinSize = rSize;
- DockingWindow::SetMinOutputSizePixel( rSize );
+ ResizableDockingWindow::SetMinOutputSizePixel( rSize );
}
/** Set the minimum size which is returned.*/
@@ -1449,7 +1445,7 @@ const Size& SfxDockingWindow::GetMinOutputSizePixel() const
bool SfxDockingWindow::EventNotify( NotifyEvent& rEvt )
{
if ( !pImpl )
- return DockingWindow::EventNotify( rEvt );
+ return ResizableDockingWindow::EventNotify( rEvt );
if ( rEvt.GetType() == MouseNotifyEvent::GETFOCUS )
{
@@ -1464,7 +1460,7 @@ bool SfxDockingWindow::EventNotify( NotifyEvent& rEvt )
// In VCL EventNotify goes first to the window itself, also call the
// base class, otherwise the parent learns nothing
// if ( rEvt.GetWindow() == this ) PB: #i74693# not necessary any longer
- DockingWindow::EventNotify( rEvt );
+ ResizableDockingWindow::EventNotify( rEvt );
return true;
}
else if( rEvt.GetType() == MouseNotifyEvent::KEYINPUT )
@@ -1482,10 +1478,9 @@ bool SfxDockingWindow::EventNotify( NotifyEvent& rEvt )
pBindings->SetActiveFrame( nullptr );
}
- return DockingWindow::EventNotify( rEvt );
+ return ResizableDockingWindow::EventNotify( rEvt );
}
-
void SfxDockingWindow::SetItemSize_Impl( const Size& rSize )
{
pImpl->aSplitSize = rSize;
@@ -1529,7 +1524,7 @@ void SfxDockingWindow::StateChanged( StateChangedType nStateChange )
if ( nStateChange == StateChangedType::InitShow )
Initialize_Impl();
- DockingWindow::StateChanged( nStateChange );
+ ResizableDockingWindow::StateChanged( nStateChange );
}
void SfxDockingWindow::Move()