dbaccess/source/ui/control/FieldDescControl.cxx    |   29 +++++++++++++++++++++
 dbaccess/source/ui/inc/FieldDescControl.hxx        |    6 ++++
 dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx |   24 -----------------
 dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx |    7 -----
 4 files changed, 36 insertions(+), 30 deletions(-)

New commits:
commit e6573fa894a7ef1e83f9d7785a61fdcabfe24939
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Mon Mar 30 13:13:48 2020 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Mon Mar 30 16:31:21 2020 +0200

    tdf#131576 Fields not displayed as expected in Base's Table Wizard
    
    this is similar to the problem of tdf#130623 "Base: Empty Field Properties"
    so take that solution and move it down the the shared component
    
    Change-Id: I15e26ca1c781b3a90ece2073112953cc40083d15
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91362
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx 
b/dbaccess/source/ui/control/FieldDescControl.cxx
index 7324ff8fa98a..315b2998739a 100644
--- a/dbaccess/source/ui/control/FieldDescControl.cxx
+++ b/dbaccess/source/ui/control/FieldDescControl.cxx
@@ -94,11 +94,38 @@ OFieldDescControl::OFieldDescControl(weld::Container* 
pPage, vcl::Window* pParen
         m_xVclContentArea = VclPtr<VclVBox>::Create(this);
         m_xVclContentArea->Show();
         m_xBuilder.reset(Application::CreateInterimBuilder(m_xVclContentArea, 
"dbaccess/ui/fielddescpage.ui"));
+
+        m_aLayoutIdle.SetPriority(TaskPriority::RESIZE);
+        m_aLayoutIdle.SetInvokeHandler( LINK( this, OFieldDescControl, 
ImplHandleLayoutTimerHdl ) );
+        m_aLayoutIdle.SetDebugName( "OFieldDescControl m_aLayoutIdle" );
     }
 
     m_xContainer = m_xBuilder->weld_container("FieldDescPage");
 }
 
+void OFieldDescControl::queue_resize(StateChangedType eReason)
+{
+    TabPage::queue_resize(eReason);
+    if (!m_xVclContentArea)
+        return;
+    if (m_aLayoutIdle.IsActive())
+        return;
+    m_aLayoutIdle.Start();
+}
+
+void OFieldDescControl::Resize()
+{
+    TabPage::Resize();
+    if (!m_xVclContentArea)
+        return;
+    queue_resize();
+}
+
+IMPL_LINK_NOARG(OFieldDescControl, ImplHandleLayoutTimerHdl, Timer*, void)
+{
+    m_xVclContentArea->SetPosSizePixel(Point(0,0), GetSizePixel());
+}
+
 OFieldDescControl::~OFieldDescControl()
 {
     disposeOnce();
@@ -106,6 +133,8 @@ OFieldDescControl::~OFieldDescControl()
 
 void OFieldDescControl::dispose()
 {
+    m_aLayoutIdle.Stop();
+
     if ( m_bAdded )
         
::dbaui::notifySystemWindow(this,this,::comphelper::mem_fun(&TaskPaneList::RemoveWindow));
 
diff --git a/dbaccess/source/ui/inc/FieldDescControl.hxx 
b/dbaccess/source/ui/inc/FieldDescControl.hxx
index e57bc60b4c5b..0de625a646a3 100644
--- a/dbaccess/source/ui/inc/FieldDescControl.hxx
+++ b/dbaccess/source/ui/inc/FieldDescControl.hxx
@@ -19,6 +19,7 @@
 #ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_FIELDDESCCONTROL_HXX
 #define INCLUDED_DBACCESS_SOURCE_UI_INC_FIELDDESCCONTROL_HXX
 
+#include <vcl/idle.hxx>
 #include <vcl/layout.hxx>
 #include <vcl/tabpage.hxx>
 #include <vcl/weld.hxx>
@@ -67,6 +68,7 @@ namespace dbaui
     class OFieldDescControl : public TabPage
     {
     private:
+        Idle m_aLayoutIdle;
         VclPtr<VclVBox> m_xVclContentArea;
         std::unique_ptr<weld::Builder> m_xBuilder;
         std::unique_ptr<weld::Container> m_xContainer;
@@ -116,6 +118,7 @@ namespace dbaui
 
         DECL_LINK(FormatClickHdl, weld::Button&, void);
         DECL_LINK(ChangeHdl, weld::ComboBox&, void);
+        DECL_LINK(ImplHandleLayoutTimerHdl, Timer*, void);
 
         // used by ActivatePropertyField
         DECL_LINK( OnControlFocusLost, weld::Widget&, void );
@@ -183,6 +186,9 @@ namespace dbaui
         void                Init();
         virtual void        GetFocus() override;
         virtual void        LoseFocus() override;
+        virtual void        Resize() override;
+
+        virtual void queue_resize(StateChangedType eReason = 
StateChangedType::Layout) override;
 
         virtual css::uno::Reference< css::sdbc::XDatabaseMetaData> 
getMetaData() = 0;
         virtual css::uno::Reference< css::sdbc::XConnection> getConnection() = 
0;
diff --git a/dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx 
b/dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx
index c39a3f6b9581..1a052c19007a 100644
--- a/dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx
+++ b/dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx
@@ -33,10 +33,6 @@ 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()
@@ -46,7 +42,6 @@ OFieldDescGenWin::~OFieldDescGenWin()
 
 void OFieldDescGenWin::dispose()
 {
-    maLayoutIdle.Stop();
     m_pFieldControl.disposeAndClear();
     TabPage::dispose();
 }
@@ -58,29 +53,12 @@ void OFieldDescGenWin::Init()
     m_pFieldControl->Init();
 }
 
-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)
+void OFieldDescGenWin::Resize()
 {
-    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 47874ff5bcc2..b43f8d1fa841 100644
--- a/dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx
+++ b/dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx
@@ -19,7 +19,6 @@
 #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>
 
@@ -34,10 +33,6 @@ namespace dbaui
     {
 
         VclPtr<OTableFieldControl>  m_pFieldControl;
-        Idle  maLayoutIdle;
-
-        DECL_LINK(ImplHandleLayoutTimerHdl, Timer*, void);
-
     protected:
         virtual void Resize() override;
 
@@ -46,8 +41,6 @@ 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