diff options
author | Neil Hodgson <nyamatongwe@gmail.com> | 2018-04-22 08:22:53 +1000 |
---|---|---|
committer | Neil Hodgson <nyamatongwe@gmail.com> | 2018-04-22 08:22:53 +1000 |
commit | de2433ffb9b9c98060a607427bd04b4c9e1d9c76 (patch) | |
tree | 5b18b0ec8fa10c6eddaa0131c57e5043da4fd966 /cocoa/QuartzTextLayout.h | |
parent | 501d1f9ab73f49c835aa4e2028eb33e9a83b065b (diff) | |
download | scintilla-mirror-de2433ffb9b9c98060a607427bd04b4c9e1d9c76.tar.gz |
Backport: Reduce casts by moving casting from char* to UInt8* into QuartzTextLayout::SetText
and adding helper TextStyleFromFont to cast from Font to QuartzTextStyle.
Backport of changeset 6729:2d72313a7d6d.
Diffstat (limited to 'cocoa/QuartzTextLayout.h')
-rw-r--r-- | cocoa/QuartzTextLayout.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cocoa/QuartzTextLayout.h b/cocoa/QuartzTextLayout.h index 33869ae6e..0f813f301 100644 --- a/cocoa/QuartzTextLayout.h +++ b/cocoa/QuartzTextLayout.h @@ -42,9 +42,9 @@ public: } } - inline void setText( const UInt8* buffer, size_t byteLength, CFStringEncoding encoding, const QuartzTextStyle& r ) - { - CFStringRef str = CFStringCreateWithBytes( NULL, buffer, byteLength, encoding, false ); + void setText(const char *buffer, size_t byteLength, CFStringEncoding encoding, const QuartzTextStyle &r) { + const UInt8 *puiBuffer = reinterpret_cast<const UInt8 *>(buffer); + CFStringRef str = CFStringCreateWithBytes(NULL, puiBuffer, byteLength, encoding, false); if (!str) return; |