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

includes: tdf#131576 overlapping windows, move bottom one down a little

Change-Id: I567c5a2519edd5921984a27405cddd6a4904fbba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91370
Tested-by: Jenkins
Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
(cherry picked from commit 8de35cf85a0d595c3b0a0ee71325366084940948)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91400
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Michael Weghorn <m.weghorn@posteo.de>
diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx
index c7f5f01..6356bfc 100644
--- a/dbaccess/source/ui/control/FieldDescControl.cxx
+++ b/dbaccess/source/ui/control/FieldDescControl.cxx
@@ -22,6 +22,7 @@
#include <FieldControls.hxx>
#include <tools/diagnose_ex.h>
#include <TableDesignHelpBar.hxx>
#include <vcl/layout.hxx>
#include <vcl/svapp.hxx>
#include <vector>
#include <FieldDescriptions.hxx>
@@ -76,6 +77,7 @@ namespace
// class OFieldDescControl
OFieldDescControl::OFieldDescControl(weld::Container* pPage, vcl::Window* pParent, OTableDesignHelpBar* pHelpBar)
    :TabPage(pPage ? Application::GetDefDialogParent() : pParent, WB_3DLOOK | WB_DIALOGCONTROL)
    ,m_pPage(pPage)
    ,m_xBuilder(pPage ? Application::CreateBuilder(pPage, "dbaccess/ui/fielddescpage.ui")
                      : Application::CreateInterimBuilder(this, "dbaccess/ui/fielddescpage.ui"))
    ,m_xContainer(m_xBuilder->weld_container("FieldDescPage"))
@@ -90,6 +92,32 @@ OFieldDescControl::OFieldDescControl(weld::Container* pPage, vcl::Window* pParen
    ,m_bAdded(false)
    ,pActFieldDescr(nullptr)
{
    m_aLayoutIdle.SetPriority(TaskPriority::RESIZE);
    m_aLayoutIdle.SetInvokeHandler( LINK( this, OFieldDescControl, ImplHandleLayoutTimerHdl ) );
    m_aLayoutIdle.SetDebugName( "OFieldDescControl m_aLayoutIdle" );
}

void OFieldDescControl::queue_resize(StateChangedType eReason)
{
    TabPage::queue_resize(eReason);
    if (m_pPage)
        return;
    if (m_aLayoutIdle.IsActive())
        return;
    m_aLayoutIdle.Start();
}

void OFieldDescControl::Resize()
{
    TabPage::Resize();
    if (m_pPage)
        return;
    queue_resize();
}

IMPL_LINK_NOARG(OFieldDescControl, ImplHandleLayoutTimerHdl, Timer*, void)
{
    VclContainer::setLayoutAllocation(*GetWindow(GetWindowType::FirstChild), Point(0, 0), GetSizePixel());
}

OFieldDescControl::~OFieldDescControl()
@@ -99,6 +127,8 @@ OFieldDescControl::~OFieldDescControl()

void OFieldDescControl::dispose()
{
    m_aLayoutIdle.Stop();

    if ( m_bAdded )
        ::dbaui::notifySystemWindow(this,this,::comphelper::mem_fun(&TaskPaneList::RemoveWindow));

@@ -488,6 +518,7 @@ void OFieldDescControl::ActivateAggregate( EControlType eType )
                m_xType->append_text(elem.second->aUIName);
        }
        m_xType->set_active(0);
        m_xType->set_size_request(42, -1); // let the other widgets determine the over all width
        InitializeControl(m_xType.get(),HID_TAB_ENT_TYPE, true);
        m_xType->show();
        break;
diff --git a/dbaccess/source/ui/inc/FieldControls.hxx b/dbaccess/source/ui/inc/FieldControls.hxx
index 59600a0..76612cf 100644
--- a/dbaccess/source/ui/inc/FieldControls.hxx
+++ b/dbaccess/source/ui/inc/FieldControls.hxx
@@ -111,6 +111,7 @@ namespace dbaui
        void append_text(const OUString &rText) { m_xComboBox->append_text(rText); }
        void remove_text(const OUString &rText) { m_xComboBox->remove_text(rText); }
        int find_text(const OUString &rText) const { return m_xComboBox->find_text(rText); }
        void set_size_request(int nWidth, int nHeight) { m_xComboBox->set_size_request(nWidth, nHeight); }

        short GetPos() const { return m_nPos; }
        const OUString& GetHelp() const { return m_strHelpText; }
diff --git a/dbaccess/source/ui/inc/FieldDescControl.hxx b/dbaccess/source/ui/inc/FieldDescControl.hxx
index 24cdedc..331dfe3 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/tabpage.hxx>
#include <vcl/weld.hxx>
#include "QEnumTypes.hxx"
@@ -66,6 +67,8 @@ namespace dbaui
    class OFieldDescControl : public TabPage
    {
    private:
        Idle m_aLayoutIdle;
        weld::Container* m_pPage;
        std::unique_ptr<weld::Builder> m_xBuilder;
        std::unique_ptr<weld::Container> m_xContainer;

@@ -120,6 +123,7 @@ namespace dbaui
        // used by ActivatePropertyField
        DECL_LINK( OnControlFocusLost, weld::Widget&, void );
        DECL_LINK( OnControlFocusGot, weld::Widget&, void );
        DECL_LINK(ImplHandleLayoutTimerHdl, Timer*, void);

        void                UpdateFormatSample(OFieldDescription const * pFieldDescr);

@@ -183,6 +187,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 9581246..bc9486b 100644
--- a/dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx
+++ b/dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx
@@ -34,10 +34,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()
@@ -47,7 +43,6 @@ OFieldDescGenWin::~OFieldDescGenWin()

void OFieldDescGenWin::dispose()
{
    maLayoutIdle.Stop();
    m_pFieldControl.disposeAndClear();
    TabPage::dispose();
}
@@ -59,27 +54,10 @@ 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)
{
    if (!m_pFieldControl)
        return;
    m_pFieldControl->SetPosSizePixel(Point(0,0),GetSizePixel());
    m_pFieldControl->Resize();
}

void OFieldDescGenWin::Resize()
{
    queue_resize();
    m_pFieldControl->SetPosSizePixel(Point(0,0),GetSizePixel());
    m_pFieldControl->Resize();
}

void OFieldDescGenWin::SetReadOnly( bool bReadOnly )
diff --git a/dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx b/dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx
index 47874ff..b43f8d1 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();
diff --git a/wizards/com/sun/star/wizards/table/FieldFormatter.java b/wizards/com/sun/star/wizards/table/FieldFormatter.java
index db40110..bb53deb 100644
--- a/wizards/com/sun/star/wizards/table/FieldFormatter.java
+++ b/wizards/com/sun/star/wizards/table/FieldFormatter.java
@@ -209,7 +209,7 @@ public class FieldFormatter implements XItemListener
                    }, // PropertyNames.PROPERTY_HELPURL
                    new Object[]
                    {
                        85, 158, 49, IFieldFormatStep, Short.valueOf(curtabindex++), 166, 50
                        82, 158, 52, IFieldFormatStep, Short.valueOf(curtabindex++), 166, 50
                    });  //, "HID:WIZARDS_HID_DLGTABLE_COLMODIFIER"
            curTableDescriptor = _curTableDescriptor;
            Helper.setUnoPropertyValue(oColumnDescriptorModel, PropertyNames.ACTIVE_CONNECTION, _curTableDescriptor.DBConnection);