diff options
author | Neil <nyamatongwe@gmail.com> | 2019-01-15 11:01:52 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2019-01-15 11:01:52 +1100 |
commit | 8a3ff5e93b7e1ca8055e41891433146304969074 (patch) | |
tree | 3224261ed22f76d1de99e4823ed845c31a6239b5 /src/Style.cxx | |
parent | 1d055f5b839ddce03636f65c901fd59e304f5a42 (diff) | |
download | scintilla-mirror-8a3ff5e93b7e1ca8055e41891433146304969074.tar.gz |
Fix use of "0" for nulls and mark methods "noexcept" where simple.
Diffstat (limited to 'src/Style.cxx')
-rw-r--r-- | src/Style.cxx | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/Style.cxx b/src/Style.cxx index 5fff777a6..c07022dff 100644 --- a/src/Style.cxx +++ b/src/Style.cxx @@ -17,27 +17,27 @@ using namespace Scintilla; -FontAlias::FontAlias() { +FontAlias::FontAlias() noexcept { } -FontAlias::FontAlias(const FontAlias &other) : Font() { +FontAlias::FontAlias(const FontAlias &other) noexcept : Font() { SetID(other.fid); } FontAlias::~FontAlias() { - SetID(0); + SetID(FontID{}); // ~Font will not release the actual font resource since it is now 0 } -void FontAlias::MakeAlias(const Font &fontOrigin) { +void FontAlias::MakeAlias(const Font &fontOrigin) noexcept { SetID(fontOrigin.GetID()); } -void FontAlias::ClearFont() { - SetID(0); +void FontAlias::ClearFont() noexcept { + SetID(FontID{}); } -bool FontSpecification::operator==(const FontSpecification &other) const { +bool FontSpecification::operator==(const FontSpecification &other) const noexcept { return fontName == other.fontName && weight == other.weight && italic == other.italic && @@ -46,7 +46,7 @@ bool FontSpecification::operator==(const FontSpecification &other) const { extraFontFlag == other.extraFontFlag; } -bool FontSpecification::operator<(const FontSpecification &other) const { +bool FontSpecification::operator<(const FontSpecification &other) const noexcept { if (fontName != other.fontName) return fontName < other.fontName; if (weight != other.weight) @@ -62,11 +62,11 @@ bool FontSpecification::operator<(const FontSpecification &other) const { return false; } -FontMeasurements::FontMeasurements() { +FontMeasurements::FontMeasurements() noexcept { ClearMeasurements(); } -void FontMeasurements::ClearMeasurements() { +void FontMeasurements::ClearMeasurements() noexcept { ascent = 1; descent = 1; capitalHeight = 1; |