diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-02-18 14:30:58 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-02-19 09:39:57 +0100 |
commit | ddaaf6d1ae63320e15ce797ca2c0f11a2b539bee (patch) | |
tree | 54bbac3088b834983bd6dcb6ac7ece90f617ce84 /vcl | |
parent | 183debd7e078d2daef38170afc8542a4e625602c (diff) |
use boost::optional in SvTreeListEntry
it is inefficient to allocate a tiny object like Color separately on the
heap
Change-Id: Iac2cfc7c00c16240e7cf72e7d8814e97e9f65ac6
Reviewed-on: https://gerrit.libreoffice.org/67967
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/app/salvtables.cxx | 2 | ||||
-rw-r--r-- | vcl/source/treelist/treelistbox.cxx | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index c7ca128fd818..df7de9561743 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -2233,7 +2233,7 @@ public: virtual void set_font_color(int pos, const Color& rColor) const override { SvTreeListEntry* pEntry = m_xTreeView->GetEntry(nullptr, pos); - pEntry->SetTextColor(&rColor); + pEntry->SetTextColor(rColor); } virtual void remove(int pos) override diff --git a/vcl/source/treelist/treelistbox.cxx b/vcl/source/treelist/treelistbox.cxx index b069d1d0ea12..aa91551177d8 100644 --- a/vcl/source/treelist/treelistbox.cxx +++ b/vcl/source/treelist/treelistbox.cxx @@ -2701,8 +2701,8 @@ void SvTreeListBox::PaintEntry1(SvTreeListEntry& rEntry, long nLine, vcl::Render if (bCurFontIsSel || rEntry.GetTextColor()) { bCurFontIsSel = false; - if (const auto* pCustomTextColor = rEntry.GetTextColor()) - rRenderContext.SetTextColor(*pCustomTextColor); + if (const auto & xCustomTextColor = rEntry.GetTextColor()) + rRenderContext.SetTextColor(*xCustomTextColor); else rRenderContext.SetTextColor(aBackupTextColor); rRenderContext.SetFont(aBackupFont); |