From 064d956da8fe7d823eba5a584675e9cdfdd14451 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sun, 15 Sep 2002 02:25:11 +0000 Subject: Limiting the number of characters to ExtTextOut to be less than 65536 as there appears to be a GDI 16 bit limitation. --- win32/PlatWin.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index 8b7373cc5..3bfd923ae 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -501,6 +501,9 @@ void SurfaceImpl::DrawTextNoClip(PRectangle rc, Font &font_, int ybase, const ch tbuf[tlen] = L'\0'; ::ExtTextOutW(hdc, rc.left, ybase, ETO_OPAQUE, &rcw, tbuf, tlen, NULL); } else { + // There appears to be a 16 bit string length limit in GDI + if (len > 65535) + len = 65535; ::ExtTextOut(hdc, rc.left, ybase, ETO_OPAQUE, &rcw, s, len, NULL); } } @@ -517,6 +520,9 @@ void SurfaceImpl::DrawTextClipped(PRectangle rc, Font &font_, int ybase, const c tbuf[tlen] = L'\0'; ::ExtTextOutW(hdc, rc.left, ybase, ETO_OPAQUE | ETO_CLIPPED, &rcw, tbuf, tlen, NULL); } else { + // There appears to be a 16 bit string length limit in GDI + if (len > 65535) + len = 65535; ::ExtTextOut(hdc, rc.left, ybase, ETO_OPAQUE | ETO_CLIPPED, &rcw, s, len, NULL); } } -- cgit v1.2.3