aboutsummaryrefslogtreecommitdiffhomepage
path: root/cocoa/QuartzTextStyle.h
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2021-03-17 14:58:11 +1100
committerNeil <nyamatongwe@gmail.com>2021-03-17 14:58:11 +1100
commit1b5dd62b71d8d9b657b0cd7c138c9dc523a07cc4 (patch)
treef25f7353ad23c041da607b07b5ddd247214ba90c /cocoa/QuartzTextStyle.h
parent7fbe52f835688967a6079582ed8839cb55d0f9ea (diff)
downloadscintilla-mirror-1b5dd62b71d8d9b657b0cd7c138c9dc523a07cc4.tar.gz
Change Font to an interface and stop using FontID. Fonts are shared and
reference counted using std::shared_ptr. This optimizes memory and reduces potential for allocation bugs.
Diffstat (limited to 'cocoa/QuartzTextStyle.h')
-rw-r--r--cocoa/QuartzTextStyle.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/cocoa/QuartzTextStyle.h b/cocoa/QuartzTextStyle.h
index 3c5684685..f8d50ebe9 100644
--- a/cocoa/QuartzTextStyle.h
+++ b/cocoa/QuartzTextStyle.h
@@ -21,14 +21,14 @@ public:
characterSet = 0;
}
- QuartzTextStyle(const QuartzTextStyle &other) {
+ QuartzTextStyle(const QuartzTextStyle *other) {
// Does not copy font colour attribute
- fontRef = static_cast<CTFontRef>(CFRetain(other.fontRef));
+ fontRef = static_cast<CTFontRef>(CFRetain(other->fontRef));
styleDict = CFDictionaryCreateMutable(kCFAllocatorDefault, 2,
&kCFTypeDictionaryKeyCallBacks,
&kCFTypeDictionaryValueCallBacks);
CFDictionaryAddValue(styleDict, kCTFontAttributeName, fontRef);
- characterSet = other.characterSet;
+ characterSet = other->characterSet;
}
~QuartzTextStyle() {
@@ -77,11 +77,11 @@ public:
CFDictionaryAddValue(styleDict, kCTFontAttributeName, fontRef);
}
- CTFontRef getFontRef() {
+ CTFontRef getFontRef() const noexcept {
return fontRef;
}
- int getCharacterSet() {
+ int getCharacterSet() const noexcept {
return characterSet;
}