diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2022-07-22 16:19:02 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-07-22 21:04:34 +0200 |
commit | fe38553aef2121f358fb58e450ec69314aad851e (patch) | |
tree | 6e7c20a7a06444832dba3e11d0ae3d5d70649d27 /vcl | |
parent | c37f62b71fa59917ef85ff98480dff18aa936e41 (diff) |
vcl: allow editing a column other than the first one in SvTabListBox
There are 2 members mvTabList and aTabs in SvTabListBox and
SvTreeListBox, and only aTabs is evaluated to determine which column
should be edited when calling start_editing().
This solution is probably not ideal; it would be better to have a
parameter to select the column because one might want multiple editable
columns with multiple buttons...
Also, the native GTK implementation has the same bug (but there
double-clicking the column works).
Change-Id: I727792e635d3b610a2132ee5f4155e3ee610aaf2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137362
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/treelist/svtabbx.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/vcl/source/treelist/svtabbx.cxx b/vcl/source/treelist/svtabbx.cxx index d4fb5db37c39..f1277eafd41a 100644 --- a/vcl/source/treelist/svtabbx.cxx +++ b/vcl/source/treelist/svtabbx.cxx @@ -153,6 +153,16 @@ void SvTabListBox::SetTabs() } */ + // the 1st column (index 1 or 2 depending on button flags) is always set + // editable by SvTreeListBox::SetTabs(), + // which prevents setting a different column to editable as the first + // one with the flag is picked in SvTreeListBox::ImplEditEntry() + assert(aTabs.back()->nFlags & SvLBoxTabFlags::EDITABLE); + if (!(mvTabList[0].nFlags & SvLBoxTabFlags::EDITABLE)) + { + aTabs.back()->nFlags &= ~SvLBoxTabFlags::EDITABLE; + } + // append all other tabs to the list for( sal_uInt16 nCurTab = 1; nCurTab < sal_uInt16(mvTabList.size()); nCurTab++ ) { |