From 6e28c96eb4ac81fba49dde0d11872c90ef971484 Mon Sep 17 00:00:00 2001 From: Zufu Liu Date: Sat, 23 Mar 2024 09:25:01 +1100 Subject: Feature [feature-requests:#1512]. Size ms in initializer list. Remove erase() and reset() for items that are not set. --- src/ViewStyle.cxx | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/ViewStyle.cxx b/src/ViewStyle.cxx index a06882879..b22666cf0 100644 --- a/src/ViewStyle.cxx +++ b/src/ViewStyle.cxx @@ -103,7 +103,8 @@ void FontRealised::Realise(Surface &surface, int zoomLevel, Technology technolog ViewStyle::ViewStyle(size_t stylesSize_) : styles(stylesSize_), markers(MarkerMax + 1), - indicators(static_cast(IndicatorNumbers::Max) + 1) { + indicators(static_cast(IndicatorNumbers::Max) + 1), + ms(MaxMargin + 1) { nextExtendedStyle = 256; ResetDefaultStyle(); @@ -173,11 +174,6 @@ ViewStyle::ViewStyle(size_t stylesSize_) : tabWidth = spaceWidth * 8; // Default is for no selection foregrounds - elementColours.erase(Element::SelectionText); - elementColours.erase(Element::SelectionAdditionalText); - elementColours.erase(Element::SelectionSecondaryText); - elementColours.erase(Element::SelectionInactiveText); - elementColours.erase(Element::SelectionInactiveAdditionalText); // Shades of grey for selection backgrounds elementBaseColours[Element::SelectionBack] = ColourRGBA::Grey(light); constexpr unsigned int veryLight = 0xd7U; @@ -198,9 +194,6 @@ ViewStyle::ViewStyle(size_t stylesSize_) : Element::SelectionInactiveAdditionalBack, }); - foldmarginColour.reset(); - foldmarginHighlightColour.reset(); - controlCharSymbol = 0; /* Draw the control characters */ controlCharWidth = 0; selbar = Platform::Chrome(); @@ -215,19 +208,16 @@ ViewStyle::ViewStyle(size_t stylesSize_) : Element::CaretAdditional, }); - elementColours.erase(Element::CaretLineBack); elementAllowsTranslucent.insert(Element::CaretLineBack); someStylesProtected = false; someStylesForceCase = false; hotspotUnderline = true; - elementColours.erase(Element::HotSpotActive); elementAllowsTranslucent.insert(Element::HotSpotActive); leftMarginWidth = 1; rightMarginWidth = 1; - ms.resize(MaxMargin + 1); ms[0] = MarginStyle(MarginType::Number); ms[1] = MarginStyle(MarginType::Symbol, 16, ~MaskFolders); ms[2] = MarginStyle(MarginType::Symbol); @@ -238,7 +228,6 @@ ViewStyle::ViewStyle(size_t stylesSize_) : viewWhitespace = WhiteSpace::Invisible; tabDrawMode = TabDrawMode::LongArrow; whitespaceSize = 1; - elementColours.erase(Element::WhiteSpace); elementAllowsTranslucent.insert(Element::WhiteSpace); viewIndentationGuides = IndentView::None; -- cgit v1.2.3