From 4bae79983a02af9c822a714f3dba48c52f347629 Mon Sep 17 00:00:00 2001 From: Neil Date: Fri, 9 Dec 2022 13:54:57 +1100 Subject: Shorten code with ColourOptional alias for std::optional. --- src/ViewStyle.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/ViewStyle.cxx') diff --git a/src/ViewStyle.cxx b/src/ViewStyle.cxx index a79e60102..19a7b5275 100644 --- a/src/ViewStyle.cxx +++ b/src/ViewStyle.cxx @@ -530,8 +530,8 @@ bool ViewStyle::IsLineFrameOpaque(bool caretActive, bool lineContainsCaret) cons // display itself (as long as it's not an MarkerSymbol::Empty marker). These are checked in order // with the earlier taking precedence. When multiple markers cause background override, // the colour for the highest numbered one is used. -std::optional ViewStyle::Background(int marksOfLine, bool caretActive, bool lineContainsCaret) const { - std::optional background; +ColourOptional ViewStyle::Background(int marksOfLine, bool caretActive, bool lineContainsCaret) const { + ColourOptional background; if (!caretLine.frame && (caretActive || caretLine.alwaysShow) && (caretLine.layer == Layer::Base) && lineContainsCaret) { background = ElementColour(Element::CaretLineBack); @@ -601,7 +601,7 @@ void ViewStyle::AddMultiEdge(int column, ColourRGBA colour) { EdgeProperties(column, colour)); } -std::optional ViewStyle::ElementColour(Element element) const { +ColourOptional ViewStyle::ElementColour(Element element) const { ElementMap::const_iterator search = elementColours.find(element); if (search != elementColours.end()) { if (search->second.has_value()) { -- cgit v1.2.3