diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-06-05 16:11:39 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-06-08 20:21:35 +0200 |
commit | cd384e2d31f74223948ea70d8aa3c318d3ceeb50 (patch) | |
tree | 49ae5191c2bd4b13c3cd547951933fbc37cda0fa /basctl | |
parent | c3669c8bd62ecf5eaa6b5e95289825bc11b2688a (diff) |
rework treeview initial toggle button col to be like expander col
cause this assumption is baked into the vcl one making it hard
to adapt remaining cases
Change-Id: I75dd5264c65b1ffbf4d26c9a86f6d4d08b400d90
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95622
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'basctl')
-rw-r--r-- | basctl/source/basicide/moduldl2.cxx | 8 | ||||
-rw-r--r-- | basctl/source/basicide/moduldlg.cxx | 1 | ||||
-rw-r--r-- | basctl/source/dlged/managelang.cxx | 10 |
3 files changed, 9 insertions, 10 deletions
diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx index 3c9d64a01854..c94cfe753c96 100644 --- a/basctl/source/basicide/moduldl2.cxx +++ b/basctl/source/basicide/moduldl2.cxx @@ -648,8 +648,8 @@ void LibPage::InsertLib() weld::TreeView& rView = xLibDlg->GetLibBox(); rView.append(); const int nRow = rView.n_children() - 1; - rView.set_toggle(nRow, TRISTATE_TRUE, 0); - rView.set_text(nRow, aLibName, 1); + rView.set_toggle(nRow, TRISTATE_TRUE); + rView.set_text(nRow, aLibName, 0); rView.set_cursor(rView.find_text(aLibName)); } } @@ -682,9 +682,9 @@ void LibPage::InsertLib() weld::TreeView& rView = xLibDlg->GetLibBox(); for (int nLib = 0, nChildren = rView.n_children(); nLib < nChildren; ++nLib) { - if (rView.get_toggle(nLib, 0) == TRISTATE_TRUE) + if (rView.get_toggle(nLib) == TRISTATE_TRUE) { - OUString aLibName(rView.get_text(nLib, 1)); + OUString aLibName(rView.get_text(nLib)); Reference< script::XLibraryContainer2 > xModLibContainer( m_aCurDocument.getLibraryContainer( E_SCRIPTS ), UNO_QUERY ); Reference< script::XLibraryContainer2 > xDlgLibContainer( m_aCurDocument.getLibraryContainer( E_DIALOGS ), UNO_QUERY ); diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx index 3b650078fa4d..7aeae822a7bb 100644 --- a/basctl/source/basicide/moduldlg.cxx +++ b/basctl/source/basicide/moduldlg.cxx @@ -897,6 +897,7 @@ LibDialog::LibDialog(weld::Window* pParent) { m_xLibBox->set_size_request(m_xLibBox->get_approximate_digit_width() * 28, m_xLibBox->get_height_rows(8)); + m_xLibBox->enable_toggle_buttons(weld::ColumnToggleType::Check); // tdf#93476 The libraries should be listed alphabetically m_xLibBox->make_sorted(); } diff --git a/basctl/source/dlged/managelang.cxx b/basctl/source/dlged/managelang.cxx index 77a40f031c80..d36c23803e7a 100644 --- a/basctl/source/dlged/managelang.cxx +++ b/basctl/source/dlged/managelang.cxx @@ -226,9 +226,7 @@ SetDefaultLanguageDialog::SetDefaultLanguageDialog(weld::Window* pParent, std::s { m_xLanguageLB->set_size_request(-1, m_xLanguageLB->get_height_rows(10)); m_xCheckLangLB->set_size_request(-1, m_xCheckLangLB->get_height_rows(10)); - std::vector<int> aWidths; - aWidths.push_back(m_xCheckLangLB->get_checkbox_column_width()); - m_xCheckLangLB->set_column_fixed_widths(aWidths); + m_xCheckLangLB->enable_toggle_buttons(weld::ColumnToggleType::Check); if (m_xLocalizationMgr->isLibraryLocalized()) { @@ -270,8 +268,8 @@ void SetDefaultLanguageDialog::FillLanguageBox() LanguageType eLang = m_xLanguageCB->get_id(j); m_xCheckLangLB->append(); const int nRow = m_xCheckLangLB->n_children() - 1; - m_xCheckLangLB->set_toggle(nRow, TRISTATE_FALSE, 0); - m_xCheckLangLB->set_text(nRow, m_xLanguageCB->get_text(j), 1); + m_xCheckLangLB->set_toggle(nRow, TRISTATE_FALSE); + m_xCheckLangLB->set_text(nRow, m_xLanguageCB->get_text(j), 0); m_xCheckLangLB->set_id(nRow, OUString::number(eLang.get())); } m_xLanguageCB.reset(); @@ -304,7 +302,7 @@ Sequence< Locale > SetDefaultLanguageDialog::GetLocales() const const sal_Int32 nCount = m_xCheckLangLB->n_children(); for (sal_Int32 i = 0; i < nCount; ++i) { - if (m_xCheckLangLB->get_toggle(i, 0) == TRISTATE_TRUE) + if (m_xCheckLangLB->get_toggle(i) == TRISTATE_TRUE) { LanguageType eType(m_xCheckLangLB->get_id(i).toUInt32()); aLocaleSeq.push_back(LanguageTag::convertToLocale(eType)); |