summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-05-08 12:06:08 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-05-08 16:21:11 +0200
commitccbb507002b2bf20689def23066521506a1e9c2b (patch)
treef5bcb3b8057052e95604c1c062e11ddfb3054fe3 /vcl
parent02c9756f52565e9c13507a9a4d60d33bc18609c4 (diff)
Related: tdf#117470 docking windows are toplevels
but are not system windows according to vcl Change-Id: I7f404acc82ca51520b4fabd4d8a06769dc0f0fee Reviewed-on: https://gerrit.libreoffice.org/53971 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/app/salvtables.cxx24
1 files changed, 17 insertions, 7 deletions
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index a2dfb0f45e41..713e5acada9c 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -470,7 +470,7 @@ weld::Container* SalInstanceWidget::weld_parent() const
class SalInstanceWindow : public SalInstanceContainer, public virtual weld::Window
{
private:
- VclPtr<SystemWindow> m_xWindow;
+ VclPtr<vcl::Window> m_xWindow;
DECL_LINK(HelpHdl, vcl::Window&, bool);
@@ -489,7 +489,7 @@ private:
}
public:
- SalInstanceWindow(SystemWindow* pWindow, bool bTakeOwnership)
+ SalInstanceWindow(vcl::Window* pWindow, bool bTakeOwnership)
: SalInstanceContainer(pWindow, bTakeOwnership)
, m_xWindow(pWindow)
{
@@ -545,7 +545,17 @@ public:
virtual void resize_to_request() override
{
- m_xWindow->setOptimalLayoutSize();
+ if (SystemWindow* pSysWin = dynamic_cast<SystemWindow*>(m_xWindow.get()))
+ {
+ pSysWin->setOptimalLayoutSize();
+ return;
+ }
+ if (DockingWindow* pDockWin = dynamic_cast<DockingWindow*>(m_xWindow.get()))
+ {
+ pDockWin->setOptimalLayoutSize();
+ return;
+ }
+ assert(false && "must be system or docking window");
}
virtual void window_move(int x, int y) override
@@ -553,7 +563,7 @@ public:
m_xWindow->SetPosPixel(Point(x, y));
}
- SystemWindow* getWindow()
+ vcl::Window* getWindow()
{
return m_xWindow.get();
}
@@ -2237,9 +2247,9 @@ weld::Window* SalFrame::GetFrameWeld() const
{
vcl::Window* pWindow = GetWindow();
pWindow = pWindow ? pWindow->ImplGetWindow() : nullptr;
- SystemWindow* pSystemWindow = pWindow ? pWindow->GetSystemWindow() : nullptr;
- if (pSystemWindow)
- m_xFrameWeld.reset(new SalInstanceWindow(pSystemWindow, false));
+ assert(!pWindow || (pWindow->IsSystemWindow() || pWindow->IsDockingWindow()));
+ if (pWindow)
+ m_xFrameWeld.reset(new SalInstanceWindow(pWindow, false));
}
return m_xFrameWeld.get();
}