From 794c599d481e46dbf9a5251a57fafb528b3fff2d Mon Sep 17 00:00:00 2001 From: Neil Date: Mon, 22 Mar 2021 12:56:26 +1100 Subject: Replace multiple mode setting calls on Surface with SetMode as this is extensible. For CallTip, GTK and Qt hardcode BidiR2L to false as they don't support bidirectional, its the same as current, and the BidiR2L state on EditModel isn't easily accessible. --- cocoa/ScintillaCocoa.mm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'cocoa') diff --git a/cocoa/ScintillaCocoa.mm b/cocoa/ScintillaCocoa.mm index 8e7c80260..4a688bdff 100644 --- a/cocoa/ScintillaCocoa.mm +++ b/cocoa/ScintillaCocoa.mm @@ -1058,8 +1058,7 @@ void ScintillaCocoa::CTPaint(void *gc, NSRect rc) { #pragma unused(rc) std::unique_ptr surfaceWindow(Surface::Allocate(SC_TECHNOLOGY_DEFAULT)); surfaceWindow->Init(gc, wMain.GetID()); - surfaceWindow->SetUnicodeMode(SC_CP_UTF8 == ct.codePage); - surfaceWindow->SetDBCSMode(ct.codePage); + surfaceWindow->SetMode(SurfaceMode(ct.codePage, BidirectionalR2L())); ct.PaintCT(surfaceWindow.get()); surfaceWindow->Release(); } @@ -1428,8 +1427,7 @@ void ScintillaCocoa::StartDrag() { SurfaceImpl pixmap; pixmap.InitPixMap(static_cast(imageRect.Width()), static_cast(imageRect.Height()), NULL, NULL); - pixmap.SetUnicodeMode(IsUnicodeMode()); - pixmap.SetDBCSMode(CodePage()); + pixmap.SetMode(SurfaceMode(CodePage(), BidirectionalR2L())); CGContextRef gc = pixmap.GetContext(); // To make Paint() work on a bitmap, we have to flip our coordinates and translate the origin -- cgit v1.2.3