diff options
author | nyamatongwe <unknown> | 2013-05-02 14:51:06 +1000 |
---|---|---|
committer | nyamatongwe <unknown> | 2013-05-02 14:51:06 +1000 |
commit | 23e42e320f2957a97d1a23c88e60c7cddb79fa01 (patch) | |
tree | 3613acbf69ed21b7cfc2e92a31ad17f6a71e7300 /src/Style.cxx | |
parent | 1f8862974636d649b93b514fc0ff8e5526e304b7 (diff) | |
download | scintilla-mirror-23e42e320f2957a97d1a23c88e60c7cddb79fa01.tar.gz |
Replacing raw pointers and allocations with std::vector and std::map.
Diffstat (limited to 'src/Style.cxx')
-rw-r--r-- | src/Style.cxx | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/src/Style.cxx b/src/Style.cxx index 375738c67..8b5b42dbf 100644 --- a/src/Style.cxx +++ b/src/Style.cxx @@ -21,7 +21,7 @@ FontAlias::FontAlias() { FontAlias::~FontAlias() { SetID(0); - // ~Font will not release the actual font resource sine it is now 0 + // ~Font will not release the actual font resource since it is now 0 } void FontAlias::MakeAlias(Font &fontOrigin) { @@ -32,12 +32,29 @@ void FontAlias::ClearFont() { SetID(0); } -bool FontSpecification::EqualTo(const FontSpecification &other) const { - return weight == other.weight && +bool FontSpecification::operator==(const FontSpecification &other) const { + return fontName == other.fontName && + weight == other.weight && italic == other.italic && size == other.size && characterSet == other.characterSet && - fontName == other.fontName; + extraFontFlag == other.extraFontFlag; +} + +bool FontSpecification::operator<(const FontSpecification &other) const { + if (fontName != other.fontName) + return fontName < other.fontName; + if (weight != other.weight) + return weight < other.weight; + if (italic != other.italic) + return italic == false; + if (size != other.size) + return size < other.size; + if (characterSet != other.characterSet) + return characterSet < other.characterSet; + if (extraFontFlag != other.extraFontFlag) + return extraFontFlag < other.extraFontFlag; + return false; } FontMeasurements::FontMeasurements() { @@ -68,6 +85,7 @@ Style::Style(const Style &source) : FontSpecification(), FontMeasurements() { weight = source.weight; italic = source.italic; size = source.size; + fontName = source.fontName; eolFilled = source.eolFilled; underline = source.underline; caseForce = source.caseForce; @@ -91,6 +109,7 @@ Style &Style::operator=(const Style &source) { weight = source.weight; italic = source.italic; size = source.size; + fontName = source.fontName; eolFilled = source.eolFilled; underline = source.underline; caseForce = source.caseForce; |