aboutsummaryrefslogtreecommitdiffhomepage
path: root/cocoa/QuartzTextLayout.h
diff options
context:
space:
mode:
authorNeil Hodgson <nyamatongwe@gmail.com>2018-04-22 08:22:53 +1000
committerNeil Hodgson <nyamatongwe@gmail.com>2018-04-22 08:22:53 +1000
commitde2433ffb9b9c98060a607427bd04b4c9e1d9c76 (patch)
tree5b18b0ec8fa10c6eddaa0131c57e5043da4fd966 /cocoa/QuartzTextLayout.h
parent501d1f9ab73f49c835aa4e2028eb33e9a83b065b (diff)
downloadscintilla-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.h6
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;