diff options
author | ekuiitr <jhaekansh80@gmail.com> | 2018-02-06 22:49:11 +0530 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2018-02-09 09:51:00 +0100 |
commit | 9cb54f6973406faec7fa46038cd9332c6d76db70 (patch) | |
tree | 37b3285d44975aea93048353e7b6cfdc18042dad | |
parent | 8ef47e605372aba103d19f6b8ee8a00dab40fdab (diff) |
tdf#88802 disable arrow if database or table or field not selected
Change-Id: I5a29b58f6e8981ee3de73ccaa83ed04e4ee71dc6
Reviewed-on: https://gerrit.libreoffice.org/49314
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
-rw-r--r-- | sw/source/ui/envelp/label1.cxx | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sw/source/ui/envelp/label1.cxx b/sw/source/ui/envelp/label1.cxx index f4fa9edfdc72..3f8daf71e599 100644 --- a/sw/source/ui/envelp/label1.cxx +++ b/sw/source/ui/envelp/label1.cxx @@ -265,7 +265,11 @@ SwLabPage::SwLabPage(vcl::Window* pParent, const SfxItemSet& rSet) m_pAddrBox->SetClickHdl (LINK(this, SwLabPage, AddrHdl )); m_pDatabaseLB->SetSelectHdl(LINK(this, SwLabPage, DatabaseHdl )); m_pTableLB->SetSelectHdl(LINK(this, SwLabPage, DatabaseHdl )); + m_pDBFieldLB->SetSelectHdl(LINK(this, SwLabPage, DatabaseHdl )); m_pInsertBT->SetClickHdl (LINK(this, SwLabPage, FieldHdl )); + // Disable insert button first, + // it'll be enabled if m_pDatabaseLB, m_pTableLB and m_pInsertBT are filled + m_pInsertBT->Disable(); m_pContButton->SetClickHdl (LINK(this, SwLabPage, PageHdl )); m_pSheetButton->SetClickHdl (LINK(this, SwLabPage, PageHdl )); m_pMakeBox->SetSelectHdl(LINK(this, SwLabPage, MakeHdl )); @@ -342,7 +346,14 @@ IMPL_LINK( SwLabPage, DatabaseHdl, ListBox&, rListBox, void ) if (&rListBox == m_pDatabaseLB) GetDBManager()->GetTableNames(m_pTableLB, sActDBName); - GetDBManager()->GetColumnNames(m_pDBFieldLB, sActDBName, m_pTableLB->GetSelectedEntry()); + if (&rListBox == m_pDatabaseLB || &rListBox == m_pTableLB) + GetDBManager()->GetColumnNames(m_pDBFieldLB, sActDBName, m_pTableLB->GetSelectedEntry()); + + if (!m_pDatabaseLB->GetSelectedEntry().isEmpty() && !m_pTableLB->GetSelectedEntry().isEmpty() + && !m_pDBFieldLB->GetSelectedEntry().isEmpty()) + m_pInsertBT->Enable(true); + else + m_pInsertBT->Enable(false); } IMPL_LINK_NOARG(SwLabPage, FieldHdl, Button*, void) |