diff options
| author | Neil Hodgson <nyamatongwe@gmail.com> | 2015-06-19 10:11:44 +1000 |
|---|---|---|
| committer | Neil Hodgson <nyamatongwe@gmail.com> | 2015-06-19 10:11:44 +1000 |
| commit | 12a6c391c680132e8e273939e772c09721f1b733 (patch) | |
| tree | af5783970e9f602f3ffd8d0c5567c071e4da877b /cocoa | |
| parent | 4fced742300c7686b85879f1f773fdd9029ffd23 (diff) | |
| download | scintilla-mirror-12a6c391c680132e8e273939e772c09721f1b733.tar.gz | |
Fix crash in drag and drop.
Diffstat (limited to 'cocoa')
| -rw-r--r-- | cocoa/PlatCocoa.mm | 14 | ||||
| -rw-r--r-- | cocoa/ScintillaCocoa.mm | 2 |
2 files changed, 13 insertions, 3 deletions
diff --git a/cocoa/PlatCocoa.mm b/cocoa/PlatCocoa.mm index fd3e97619..8a0f942f4 100644 --- a/cocoa/PlatCocoa.mm +++ b/cocoa/PlatCocoa.mm @@ -270,9 +270,17 @@ void SurfaceImpl::InitPixMap(int width, int height, Surface* surface_, WindowID CGContextFillRect( gc, CGRectMake( 0, 0, width, height ) ); } - SurfaceImpl *psurfOther = static_cast<SurfaceImpl *>(surface_); - unicodeMode = psurfOther->unicodeMode; - codePage = psurfOther->codePage; + if (surface_) + { + SurfaceImpl *psurfOther = static_cast<SurfaceImpl *>(surface_); + unicodeMode = psurfOther->unicodeMode; + codePage = psurfOther->codePage; + } + else + { + unicodeMode = true; + codePage = SC_CP_UTF8; + } } //-------------------------------------------------------------------------------------------------- diff --git a/cocoa/ScintillaCocoa.mm b/cocoa/ScintillaCocoa.mm index e3d0369b6..2fce53ded 100644 --- a/cocoa/ScintillaCocoa.mm +++ b/cocoa/ScintillaCocoa.mm @@ -1426,6 +1426,8 @@ void ScintillaCocoa::StartDrag() paintState = notPainting; pixmap->InitPixMap(static_cast<int>(imageRect.Width()), static_cast<int>(imageRect.Height()), NULL, NULL); + pixmap->SetUnicodeMode(IsUnicodeMode()); + pixmap->SetDBCSMode(CodePage()); CGContextRef gc = pixmap->GetContext(); // To make Paint() work on a bitmap, we have to flip our coordinates and translate the origin |
