summaryrefslogtreecommitdiff
path: root/vcl/source/app
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-02-27 21:28:04 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-02-28 10:00:47 +0100
commitf4873d0e7972ec3ee646aa0d847c626ebe7d857f (patch)
treec830fd586c7430042878d5fb48d37a0b051a6e90 /vcl/source/app
parent2b4f2cdd3deb9b131ea19c91ae50e2c34f35754c (diff)
use COL_AUTO to let set_font_color reset to automatic text color
Change-Id: I5761081fde66da3dc8071709e53b2014f10b5916 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89651 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source/app')
-rw-r--r--vcl/source/app/salvtables.cxx16
1 files changed, 12 insertions, 4 deletions
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 943f6f1e0be4..cd076d517150 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -3276,6 +3276,14 @@ private:
return nullptr;
}
+ static void set_font_color(SvTreeListEntry* pEntry, const Color& rColor)
+ {
+ if (rColor == COL_AUTO)
+ pEntry->SetTextColor(std::optional<Color>());
+ else
+ pEntry->SetTextColor(rColor);
+ }
+
public:
SalInstanceTreeView(SvTabListBox* pTreeView, SalInstanceBuilder* pBuilder, bool bTakeOwnership)
: SalInstanceContainer(pTreeView, pBuilder, bTakeOwnership)
@@ -3523,16 +3531,16 @@ public:
thaw();
}
- virtual void set_font_color(int pos, const Color& rColor) const override
+ virtual void set_font_color(int pos, const Color& rColor) override
{
SvTreeListEntry* pEntry = m_xTreeView->GetEntry(nullptr, pos);
- pEntry->SetTextColor(rColor);
+ set_font_color(pEntry, rColor);
}
- virtual void set_font_color(const weld::TreeIter& rIter, const Color& rColor) const override
+ virtual void set_font_color(const weld::TreeIter& rIter, const Color& rColor) override
{
const SalInstanceTreeIter& rVclIter = static_cast<const SalInstanceTreeIter&>(rIter);
- rVclIter.iter->SetTextColor(rColor);
+ set_font_color(rVclIter.iter, rColor);
}
virtual void remove(int pos) override