From 877def4f243e1ef5eb39a6132f3969844e00be95 Mon Sep 17 00:00:00 2001 From: Neil Date: Thu, 11 Jun 2020 10:08:29 +1000 Subject: Backport: Use noexcept where safe and maintainable. Backport of changeset 8300:266c8247814e. --- src/ViewStyle.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/ViewStyle.cxx') diff --git a/src/ViewStyle.cxx b/src/ViewStyle.cxx index 8be2bdf6a..5b8a226f3 100644 --- a/src/ViewStyle.cxx +++ b/src/ViewStyle.cxx @@ -153,7 +153,7 @@ ViewStyle::~ViewStyle() { fonts.clear(); } -void ViewStyle::CalculateMarginWidthAndMask() { +void ViewStyle::CalculateMarginWidthAndMask() noexcept { fixedColumnWidth = marginInside ? leftMarginWidth : 0; maskInLine = 0xffffffff; int maskDefinedMarkers = 0; @@ -400,7 +400,7 @@ int ViewStyle::ExternalMarginWidth() const noexcept { return marginInside ? 0 : fixedColumnWidth; } -int ViewStyle::MarginFromLocation(Point pt) const { +int ViewStyle::MarginFromLocation(Point pt) const noexcept { int margin = -1; int x = marginInside ? 0 : -fixedColumnWidth; for (size_t i = 0; i < ms.size(); i++) { @@ -415,7 +415,7 @@ bool ViewStyle::ValidStyle(size_t styleIndex) const noexcept { return styleIndex < styles.size(); } -void ViewStyle::CalcLargestMarkerHeight() { +void ViewStyle::CalcLargestMarkerHeight() noexcept { largestMarkerHeight = 0; for (const LineMarker &marker : markers) { switch (marker.markType) { @@ -446,7 +446,7 @@ bool ViewStyle::IsLineFrameOpaque(bool caretActive, bool lineContainsCaret) cons // display itself (as long as it's not an SC_MARK_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. -ColourOptional ViewStyle::Background(int marksOfLine, bool caretActive, bool lineContainsCaret) const { +ColourOptional ViewStyle::Background(int marksOfLine, bool caretActive, bool lineContainsCaret) const noexcept { ColourOptional background; if (!caretLineFrame && (caretActive || alwaysShowCaretLineBackground) && showCaretLineBackground && (caretLineAlpha == SC_ALPHA_NOALPHA) && lineContainsCaret) { @@ -492,7 +492,7 @@ bool ViewStyle::WhiteSpaceVisible(bool inIndent) const noexcept { viewWhitespace == wsVisibleAlways; } -ColourDesired ViewStyle::WrapColour() const { +ColourDesired ViewStyle::WrapColour() const noexcept { if (whitespaceColours.fore.isSet) return whitespaceColours.fore; else -- cgit v1.2.3