diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-02-12 20:18:00 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-02-13 09:49:58 +0100 |
commit | 2921147f01129ac77a0a8cabc27e9c856c4e68b3 (patch) | |
tree | 211d8a1073d719fe1d9cbf156973424ed4ec2a7e | |
parent | 4a3bb10b2f81ad836d6b9d9bd2f0384914a19cb5 (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/+/88569
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx | 24 | ||||
-rw-r--r-- | dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx | 7 |
2 files changed, 30 insertions, 1 deletions
diff --git a/dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx b/dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx index 1a052c19007a..c39a3f6b9581 100644 --- a/dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx +++ b/dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx @@ -33,6 +33,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() @@ -42,6 +46,7 @@ OFieldDescGenWin::~OFieldDescGenWin() void OFieldDescGenWin::dispose() { + maLayoutIdle.Stop(); m_pFieldControl.disposeAndClear(); TabPage::dispose(); } @@ -53,12 +58,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(); |