aboutsummaryrefslogtreecommitdiffhomepage
path: root/win32/PlatWin.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'win32/PlatWin.cxx')
-rw-r--r--win32/PlatWin.cxx48
1 files changed, 6 insertions, 42 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx
index 7407d64f0..b0a5fb512 100644
--- a/win32/PlatWin.cxx
+++ b/win32/PlatWin.cxx
@@ -67,7 +67,6 @@ typedef BOOL (WINAPI *GetMonitorInfoSig)(HMONITOR, LPMONITORINFO);
static CRITICAL_SECTION crPlatformLock;
static HINSTANCE hinstPlatformRes = 0;
-static bool onNT = false;
static HMODULE hDLLImage = 0;
static AlphaBlendSig AlphaBlendFn = 0;
@@ -83,10 +82,6 @@ static HCURSOR reverseArrowCursor = NULL;
namespace Scintilla {
#endif
-bool IsNT() {
- return onNT;
-}
-
Point Point::FromLong(long lpoint) {
return Point(static_cast<short>(LOWORD(lpoint)), static_cast<short>(HIWORD(lpoint)));
}
@@ -516,8 +511,6 @@ class SurfaceGDI : public Surface {
int maxLenText;
int codePage;
- // If 9x OS and current code page is same as ANSI code page.
- bool win9xACPSame;
void BrushColor(ColourDesired back);
void SetFont(Font &font_);
@@ -579,14 +572,11 @@ SurfaceGDI::SurfaceGDI() :
brush(0), brushOld(0),
font(0), fontOld(0),
bitmap(0), bitmapOld(0) {
- // Windows 9x has only a 16 bit coordinate system so break after 30000 pixels
- maxWidthMeasure = IsNT() ? INT_MAX : 30000;
- // There appears to be a 16 bit string length limit in GDI on NT and a limit of
- // 8192 characters on Windows 95.
- maxLenText = IsNT() ? 65535 : 8192;
+ maxWidthMeasure = INT_MAX;
+ // There appears to be a 16 bit string length limit in GDI on NT.
+ maxLenText = 65535;
codePage = 0;
- win9xACPSame = false;
}
SurfaceGDI::~SurfaceGDI() {
@@ -910,7 +900,7 @@ void SurfaceGDI::DrawTextCommon(PRectangle rc, Font &font_, XYPOSITION ybase, co
// If it does fail, slice up into segments and draw each segment.
const int maxSegmentLength = 0x200;
- if ((!unicodeMode) && (IsNT() || (codePage==0) || win9xACPSame)) {
+ if (!unicodeMode) {
// Use ANSI calls
int lenDraw = Platform::Minimum(len, maxLenText);
if (!::ExtTextOutA(hdc, x, yBaseInt, fuOptions, &rcw, s, lenDraw, NULL)) {
@@ -974,7 +964,7 @@ void SurfaceGDI::DrawTextTransparent(PRectangle rc, Font &font_, XYPOSITION ybas
XYPOSITION SurfaceGDI::WidthText(Font &font_, const char *s, int len) {
SetFont(font_);
SIZE sz={0,0};
- if ((!unicodeMode) && (IsNT() || (codePage==0) || win9xACPSame)) {
+ if (!unicodeMode) {
::GetTextExtentPoint32A(hdc, s, Platform::Minimum(len, maxLenText), &sz);
} else {
const TextWide tbuf(s, len, unicodeMode, codePage);
@@ -1026,7 +1016,7 @@ void SurfaceGDI::MeasureWidths(Font &font_, const char *s, int len, XYPOSITION *
while (i<len) {
positions[i++] = lastPos;
}
- } else if (IsNT() || (codePage==0) || win9xACPSame) {
+ } else {
// Zero positions to avoid random behaviour on failure.
std::fill(positions, positions + len, 0.0f);
// len may be larger than platform supports so loop over segments small enough for platform
@@ -1052,28 +1042,6 @@ void SurfaceGDI::MeasureWidths(Font &font_, const char *s, int len, XYPOSITION *
positions += lenBlock;
s += lenBlock;
}
- } else {
- // Support Asian string display in 9x English
- const TextWide tbuf(s, len, unicodeMode, codePage);
- TextPositionsI poses(tbuf.tlen);
- for (int widthSS=0; widthSS<tbuf.tlen; widthSS++) {
- ::GetTextExtentPoint32W(hdc, tbuf.buffer, widthSS+1, &sz);
- poses.buffer[widthSS] = sz.cx;
- }
-
- int ui = 0;
- for (int i=0; i<len;) {
- if (Platform::IsDBCSLeadByte(codePage, s[i])) {
- positions[i] = static_cast<XYPOSITION>(poses.buffer[ui]);
- positions[i + 1] = static_cast<XYPOSITION>(poses.buffer[ui]);
- i += 2;
- } else {
- positions[i] = static_cast<XYPOSITION>(poses.buffer[ui]);
- i++;
- }
-
- ui++;
- }
}
}
@@ -1144,7 +1112,6 @@ void SurfaceGDI::SetUnicodeMode(bool unicodeMode_) {
void SurfaceGDI::SetDBCSMode(int codePage_) {
// No action on window as automatically handled by system.
codePage = codePage_;
- win9xACPSame = !IsNT() && ((unsigned int)codePage == ::GetACP());
}
#if defined(USE_D2D)
@@ -3259,9 +3226,6 @@ int Platform::Clamp(int val, int minVal, int maxVal) {
#endif
void Platform_Initialise(void *hInstance) {
- OSVERSIONINFO osv = {sizeof(OSVERSIONINFO),0,0,0,0,TEXT("")};
- ::GetVersionEx(&osv);
- onNT = osv.dwPlatformId == VER_PLATFORM_WIN32_NT;
::InitializeCriticalSection(&crPlatformLock);
hinstPlatformRes = reinterpret_cast<HINSTANCE>(hInstance);
// This may be called from DllMain, in which case the call to LoadLibrary