diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-03-26 15:24:24 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-03-27 12:02:12 +0100 |
commit | 1a7489039e8acbd9499276fdb6e747e11d3ecffe (patch) | |
tree | 224cbaab534789ecd994452f39f32b0eae9028f3 /vcl/source/app | |
parent | fdb1dc8062f969f4dde038d116b631479ec796b6 (diff) |
add text alignment support to treeview entries
Change-Id: I3ebbaf7b722ad9b6f2b8fadb443053ea816d1643
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91147
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source/app')
-rw-r--r-- | vcl/source/app/salvtables.cxx | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index cf83fa8a0cd9..9d6e20c9a1f5 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -3936,6 +3936,30 @@ public: return ::get_text_emphasis(pEntry, col); } + void set_text_align(SvTreeListEntry* pEntry, double fAlign, int col) + { + ++col; //skip dummy/expander column + + assert(col >= 0 && o3tl::make_unsigned(col) < pEntry->ItemCount()); + SvLBoxItem& rItem = pEntry->GetItem(col); + assert(dynamic_cast<SvLBoxString*>(&rItem)); + static_cast<SvLBoxString&>(rItem).Align(fAlign); + + m_xTreeView->ModelHasEntryInvalidated(pEntry); + } + + virtual void set_text_align(const weld::TreeIter& rIter, double fAlign, int col) override + { + const SalInstanceTreeIter& rVclIter = static_cast<const SalInstanceTreeIter&>(rIter); + set_text_align(rVclIter.iter, fAlign, col); + } + + virtual void set_text_align(int pos, double fAlign, int col) override + { + SvTreeListEntry* pEntry = m_xTreeView->GetEntry(nullptr, pos); + set_text_align(pEntry, fAlign, col); + } + virtual void connect_editing( const Link<const weld::TreeIter&, bool>& rStartLink, const Link<const std::pair<const weld::TreeIter&, OUString>&, bool>& rEndLink) override |