dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx |   24 ++++++++++++++++++++-
 dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx |    7 ++++++
 2 files changed, 30 insertions(+), 1 deletion(-)

New commits:
commit 4d59f79bd3993c59cd04707db8f95787554b3a63
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Wed Feb 12 20:18:00 2020 +0000
Commit:     Michael Stahl <michael.st...@cib.de>
CommitDate: Mon Feb 17 14:14:50 2020 +0100

    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.st...@cib.de>
    (cherry picked from commit 96018929add55cff71a036be3a67df385b023471)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88694
    Reviewed-by: Xisco Faulí <xiscofa...@libreoffice.org>
    Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de>
    Tested-by: Michael Stahl <michael.st...@cib.de>

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();
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to