diff options
author | ekuiitr <jhaekansh80@gmail.com> | 2018-02-06 22:49:11 +0530 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-03-06 21:57:28 +0100 |
commit | c8a2a3d1dab4530bbb935e283ef671ef092d9c48 (patch) | |
tree | d216ac6873eb800af5860081991010cf1577bf1e | |
parent | 14f47eeec05842a3882c91db60cbbe57a27c3de3 (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>
Reviewed-on: https://gerrit.libreoffice.org/50266
Reviewed-by: Heiko Tietze <tietze.heiko@gmail.com>
(cherry picked from commit d631bc8370fca37a33c51b5a29aca6815760f258)
-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 e2d3fc066889..152276ba6868 100644 --- a/sw/source/ui/envelp/label1.cxx +++ b/sw/source/ui/envelp/label1.cxx @@ -266,7 +266,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 )); @@ -343,7 +347,14 @@ IMPL_LINK( SwLabPage, DatabaseHdl, ListBox&, rListBox, void ) if (&rListBox == m_pDatabaseLB) GetDBManager()->GetTableNames(m_pTableLB, sActDBName); - GetDBManager()->GetColumnNames(m_pDBFieldLB, sActDBName, m_pTableLB->GetSelectEntry()); + if (&rListBox == m_pDatabaseLB || &rListBox == m_pTableLB) + GetDBManager()->GetColumnNames(m_pDBFieldLB, sActDBName, m_pTableLB->GetSelectEntry()); + + if (!m_pDatabaseLB->GetSelectEntry().isEmpty() && !m_pTableLB->GetSelectEntry().isEmpty() + && !m_pDBFieldLB->GetSelectEntry().isEmpty()) + m_pInsertBT->Enable(true); + else + m_pInsertBT->Enable(false); } IMPL_LINK_NOARG(SwLabPage, FieldHdl, Button*, void) |