[Libreoffice-commits] core.git: Branch 'libreoffice-6-4-3' - dbaccess/source wizards/com

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Fri Apr 3 15:52:02 UTC 2020


 dbaccess/source/ui/control/FieldDescControl.cxx        |   31 +++++++++++++++++
 dbaccess/source/ui/inc/FieldControls.hxx               |    1 
 dbaccess/source/ui/inc/FieldDescControl.hxx            |    7 +++
 dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx     |   24 -------------
 dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx     |    7 ---
 wizards/com/sun/star/wizards/table/FieldFormatter.java |    2 -
 6 files changed, 41 insertions(+), 31 deletions(-)

New commits:
commit 9e00a9c487b622f35d6b274cee605798f0d24e6e
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Mar 30 12:59:14 2020 +0100
Commit:     Michael Weghorn <m.weghorn at posteo.de>
CommitDate: Fri Apr 3 17:51:32 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
    
    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 at libreoffice.org>
    (cherry picked from commit 8de35cf85a0d595c3b0a0ee71325366084940948)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91400
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>
    Reviewed-by: Michael Weghorn <m.weghorn at posteo.de>
    Tested-by: Michael Weghorn <m.weghorn at posteo.de>

diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx
index c7f5f0127968..6356bfc21a2c 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 59600a0b91a5..76612cfdd88f 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 24cdedc7da27..331dfe3aa718 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 9581246cf5e0..bc9486b0a52c 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,29 +54,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();
diff --git a/wizards/com/sun/star/wizards/table/FieldFormatter.java b/wizards/com/sun/star/wizards/table/FieldFormatter.java
index db401104a094..bb53debaba25 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);


More information about the Libreoffice-commits mailing list