summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-02-12 20:18:00 +0000
committerMichael Stahl <michael.stahl@cib.de>2020-02-13 11:25:28 +0100
commit96018929add55cff71a036be3a67df385b023471 (patch)
tree6da8483c37f14a805a3dae6226b25aef4413711b
parentd6188f8c3803490f75fbd1931a0bd6f821c4d700 (diff)
tdf#130623 owner of FieldControl needs to set its allocation
which works fine automatically when its in a dialog (copy table) but not automatically when hosted inside the design view this will make the gen case work in master, and the gen and gtk case work in 6-4 Change-Id: I530cfa0a7e1f5b62c6812ffde255c1edf478930d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88499 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
-rw-r--r--dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx24
-rw-r--r--dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx7
2 files changed, 30 insertions, 1 deletions
diff --git a/dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx b/dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx
index bc9486b0a52c..9581246cf5e0 100644
--- a/dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx
+++ b/dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx
@@ -34,6 +34,10 @@ OFieldDescGenWin::OFieldDescGenWin( vcl::Window* pParent, OTableDesignHelpBar* p
m_pFieldControl = VclPtr<OTableFieldControl>::Create(this,pHelp);
m_pFieldControl->SetHelpId(HID_TAB_DESIGN_FIELDCONTROL);
m_pFieldControl->Show();
+
+ maLayoutIdle.SetPriority(TaskPriority::RESIZE);
+ maLayoutIdle.SetInvokeHandler( LINK( this, OFieldDescGenWin, ImplHandleLayoutTimerHdl ) );
+ maLayoutIdle.SetDebugName( "OFieldDescGenWin maLayoutIdle" );
}
OFieldDescGenWin::~OFieldDescGenWin()
@@ -43,6 +47,7 @@ OFieldDescGenWin::~OFieldDescGenWin()
void OFieldDescGenWin::dispose()
{
+ maLayoutIdle.Stop();
m_pFieldControl.disposeAndClear();
TabPage::dispose();
}
@@ -54,12 +59,29 @@ void OFieldDescGenWin::Init()
m_pFieldControl->Init();
}
-void OFieldDescGenWin::Resize()
+void OFieldDescGenWin::queue_resize(StateChangedType eReason)
+{
+ TabPage::queue_resize(eReason);
+ if (!m_pFieldControl)
+ return;
+ if (maLayoutIdle.IsActive())
+ return;
+ maLayoutIdle.Start();
+}
+
+IMPL_LINK_NOARG(OFieldDescGenWin, ImplHandleLayoutTimerHdl, Timer*, void)
{
+ if (!m_pFieldControl)
+ return;
m_pFieldControl->SetPosSizePixel(Point(0,0),GetSizePixel());
m_pFieldControl->Resize();
}
+void OFieldDescGenWin::Resize()
+{
+ queue_resize();
+}
+
void OFieldDescGenWin::SetReadOnly( bool bReadOnly )
{
diff --git a/dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx b/dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx
index b43f8d1fa841..47874ff5bcc2 100644
--- a/dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx
+++ b/dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx
@@ -19,6 +19,7 @@
#ifndef INCLUDED_DBACCESS_SOURCE_UI_TABLEDESIGN_FIELDDESCGENWIN_HXX
#define INCLUDED_DBACCESS_SOURCE_UI_TABLEDESIGN_FIELDDESCGENWIN_HXX
+#include <vcl/idle.hxx>
#include <vcl/tabpage.hxx>
#include <IClipBoardTest.hxx>
@@ -33,6 +34,10 @@ namespace dbaui
{
VclPtr<OTableFieldControl> m_pFieldControl;
+ Idle maLayoutIdle;
+
+ DECL_LINK(ImplHandleLayoutTimerHdl, Timer*, void);
+
protected:
virtual void Resize() override;
@@ -41,6 +46,8 @@ namespace dbaui
virtual ~OFieldDescGenWin() override;
virtual void dispose() override;
+ virtual void queue_resize(StateChangedType eReason = StateChangedType::Layout) override;
+
virtual void GetFocus() override;
virtual void LoseFocus() override;
void Init();