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 8de35cf85a0d595c3b0a0ee71325366084940948 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Mon Mar 30 12:59:14 2020 +0100 Commit: Xisco Faulí <xiscofa...@libreoffice.org> CommitDate: Tue Mar 31 18:03:22 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í <xiscofa...@libreoffice.org> 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 c3c38e7e2dae..75a1ade73a51 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); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits