aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2015-05-13 13:35:38 +1000
committerNeil <nyamatongwe@gmail.com>2015-05-13 13:35:38 +1000
commitb57c5c13df4434754f3bf3d39c20e1926578a6da (patch)
treee3d716764d3dd87811f1c2ccf2145558050ec884
parent5f5ca4123c3a3ae3443e8f45c2b3d4df7309c708 (diff)
downloadscintilla-mirror-b57c5c13df4434754f3bf3d39c20e1926578a6da.tar.gz
Bug [#1703]. Fix bug when drawing text margins in buffered mode which would use
default encoding instead of chosen encoding.
-rw-r--r--cocoa/PlatCocoa.mm6
-rw-r--r--doc/ScintillaHistory.html5
-rw-r--r--gtk/PlatGTK.cxx1
-rw-r--r--qt/ScintillaEditBase/PlatQt.cpp5
-rw-r--r--win32/PlatWin.cxx9
5 files changed, 22 insertions, 4 deletions
diff --git a/cocoa/PlatCocoa.mm b/cocoa/PlatCocoa.mm
index 442f1f3bb..02cae162b 100644
--- a/cocoa/PlatCocoa.mm
+++ b/cocoa/PlatCocoa.mm
@@ -223,7 +223,7 @@ void SurfaceImpl::Init(SurfaceID sid, WindowID)
//--------------------------------------------------------------------------------------------------
-void SurfaceImpl::InitPixMap(int width, int height, Surface* /* surface_ */, WindowID /* wid */)
+void SurfaceImpl::InitPixMap(int width, int height, Surface* surface_, WindowID /* wid */)
{
Release();
@@ -269,6 +269,10 @@ void SurfaceImpl::InitPixMap(int width, int height, Surface* /* surface_ */, Win
CGContextSetRGBFillColor( gc, 1.0, 1.0, 1.0, 1.0 );
CGContextFillRect( gc, CGRectMake( 0, 0, width, height ) );
}
+
+ SurfaceImpl *psurfOther = static_cast<SurfaceImpl *>(surface_);
+ unicodeMode = psurfOther->unicodeMode;
+ codePage = psurfOther->codePage;
}
//--------------------------------------------------------------------------------------------------
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index 700de78fd..e2b770fb1 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -512,6 +512,11 @@
VHDL folder folds units declarations and fixes a case insensitivity bug with not treating "IS" the same as "is".
</li>
<li>
+ Fix bug when drawing text margins in buffered mode which would use default
+ encoding instead of chosen encoding.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1703/">Bug #1703</a>.
+ </li>
+ <li>
Fix link error on Windows when SCI_NAMESPACE used.
</li>
<li>
diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx
index 1445ac130..f2d8f190e 100644
--- a/gtk/PlatGTK.cxx
+++ b/gtk/PlatGTK.cxx
@@ -602,6 +602,7 @@ void SurfaceImpl::InitPixMap(int width, int height, Surface *surface_, WindowID
cairo_set_line_width(context, 1);
createdGC = true;
inited = true;
+ et = surfImpl->et;
}
void SurfaceImpl::PenColour(ColourDesired fore) {
diff --git a/qt/ScintillaEditBase/PlatQt.cpp b/qt/ScintillaEditBase/PlatQt.cpp
index 71bdae792..35e4aee78 100644
--- a/qt/ScintillaEditBase/PlatQt.cpp
+++ b/qt/ScintillaEditBase/PlatQt.cpp
@@ -182,7 +182,7 @@ void SurfaceImpl::Init(SurfaceID sid, WindowID /*wid*/)
void SurfaceImpl::InitPixMap(int width,
int height,
- Surface * /*surface*/,
+ Surface *surface,
WindowID /*wid*/)
{
Release();
@@ -190,6 +190,9 @@ void SurfaceImpl::InitPixMap(int width,
if (height < 1) height = 1;
deviceOwned = true;
device = new QPixmap(width, height);
+ SurfaceImpl *psurfOther = static_cast<SurfaceImpl *>(surface);
+ SetUnicodeMode(psurfOther->unicodeMode);
+ SetDBCSMode(psurfOther->codePage);
}
void SurfaceImpl::Release()
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx
index 37724ced8..6ea35d388 100644
--- a/win32/PlatWin.cxx
+++ b/win32/PlatWin.cxx
@@ -634,11 +634,14 @@ void SurfaceGDI::Init(SurfaceID sid, WindowID) {
void SurfaceGDI::InitPixMap(int width, int height, Surface *surface_, WindowID) {
Release();
- hdc = ::CreateCompatibleDC(static_cast<SurfaceGDI *>(surface_)->hdc);
+ SurfaceGDI *psurfOther = static_cast<SurfaceGDI *>(surface_);
+ hdc = ::CreateCompatibleDC(psurfOther->hdc);
hdcOwned = true;
- bitmap = ::CreateCompatibleBitmap(static_cast<SurfaceGDI *>(surface_)->hdc, width, height);
+ bitmap = ::CreateCompatibleBitmap(psurfOther->hdc, width, height);
bitmapOld = static_cast<HBITMAP>(::SelectObject(hdc, bitmap));
::SetTextAlign(reinterpret_cast<HDC>(hdc), TA_BASELINE);
+ SetUnicodeMode(psurfOther->unicodeMode);
+ SetDBCSMode(psurfOther->codePage);
}
void SurfaceGDI::PenColour(ColourDesired fore) {
@@ -1287,6 +1290,8 @@ void SurfaceD2D::InitPixMap(int width, int height, Surface *surface_, WindowID)
pRenderTarget->BeginDraw();
ownRenderTarget = true;
}
+ SetUnicodeMode(psurfOther->unicodeMode);
+ SetDBCSMode(psurfOther->codePage);
}
void SurfaceD2D::PenColour(ColourDesired fore) {