diff options
| author | Neil <nyamatongwe@gmail.com> | 2019-11-04 08:40:07 +1100 | 
|---|---|---|
| committer | Neil <nyamatongwe@gmail.com> | 2019-11-04 08:40:07 +1100 | 
| commit | d24d9ad03c0c4f0933dd68c8a1900fe959a8e420 (patch) | |
| tree | 8de717560849b5cf5ff8da8b78ed5349807bbaea /qt/ScintillaEditBase/PlatQt.cpp | |
| parent | ab5649715fac088b12e3fd1588e0493094e5d4ad (diff) | |
| download | scintilla-mirror-d24d9ad03c0c4f0933dd68c8a1900fe959a8e420.tar.gz | |
Backport: Avoid warnings where const reasonable.
Backport of changeset 7760:372f84867e9d.
Diffstat (limited to 'qt/ScintillaEditBase/PlatQt.cpp')
| -rw-r--r-- | qt/ScintillaEditBase/PlatQt.cpp | 18 | 
1 files changed, 14 insertions, 4 deletions
| diff --git a/qt/ScintillaEditBase/PlatQt.cpp b/qt/ScintillaEditBase/PlatQt.cpp index cce9c0802..b4ea7a7d0 100644 --- a/qt/ScintillaEditBase/PlatQt.cpp +++ b/qt/ScintillaEditBase/PlatQt.cpp @@ -105,15 +105,25 @@ public:  		pfont = nullptr;  	}  }; -static int FontCharacterSet(Font &f) + +namespace { + +FontAndCharacterSet *AsFontAndCharacterSet(const Font &f) { +	return reinterpret_cast<FontAndCharacterSet *>(f.GetID()); +} + +int FontCharacterSet(const Font &f)  { -	return reinterpret_cast<FontAndCharacterSet *>(f.GetID())->characterSet; +	return AsFontAndCharacterSet(f)->characterSet;  } -static QFont *FontPointer(Font &f) +QFont *FontPointer(const Font &f)  { -	return reinterpret_cast<FontAndCharacterSet *>(f.GetID())->pfont; +	return AsFontAndCharacterSet(f)->pfont; +} +  } +  Font::Font() noexcept : fid(nullptr) {}  Font::~Font()  { | 
