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 | 23ef8619d029b9edbe0f19212a6b3954b9f79874 (patch) | |
tree | 125f89702ee442456ba78c8e8f55ddb605ea3730 /cocoa/QuartzTextLayout.h | |
parent | e5afba6e119511b90bb8bc533a0d1414735bc6bd (diff) | |
download | scintilla-mirror-23ef8619d029b9edbe0f19212a6b3954b9f79874.tar.gz |
Reduce casts by moving casting from char* to UInt8* into QuartzTextLayout::SetText
and adding helper TextStyleFromFont to cast from Font to QuartzTextStyle.
Diffstat (limited to 'cocoa/QuartzTextLayout.h')
-rw-r--r-- | cocoa/QuartzTextLayout.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cocoa/QuartzTextLayout.h b/cocoa/QuartzTextLayout.h index 033859529..2f4de363b 100644 --- a/cocoa/QuartzTextLayout.h +++ b/cocoa/QuartzTextLayout.h @@ -37,8 +37,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; |