aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil Hodgson <nyamatongwe@gmail.com>2015-06-19 10:11:44 +1000
committerNeil Hodgson <nyamatongwe@gmail.com>2015-06-19 10:11:44 +1000
commitf85a86f72d0f51ba13ecb9445468dbf2a8a89edd (patch)
tree45c8b921a3458d4eef9961161ffcece4aba5c29d
parent87c616aca17c4f5b0fdd373641f9ec95c4bbe04b (diff)
downloadscintilla-mirror-f85a86f72d0f51ba13ecb9445468dbf2a8a89edd.tar.gz
Fix crash in drag and drop.
-rw-r--r--cocoa/PlatCocoa.mm14
-rw-r--r--cocoa/ScintillaCocoa.mm2
-rw-r--r--doc/ScintillaHistory.html3
3 files changed, 16 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
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index 1e1356b4f..409245739 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -514,6 +514,9 @@
<a href="http://sourceforge.net/p/scintilla/bugs/1728/">Bug #1728</a>.
</li>
<li>
+ On Cocoa fix crash in drag and drop.
+ </li>
+ <li>
On GTK+ 3.4+, when there are both horizontal and vertical scrollbars, draw the lower-right corner
so that it does not appear black when text selected.
<a href="http://sourceforge.net/p/scintilla/bugs/1611/">Bug #1611</a>.