summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan MacArthur <imacarthur@gmail.com>2011-05-10 09:27:18 +0000
committerIan MacArthur <imacarthur@gmail.com>2011-05-10 09:27:18 +0000
commiteb16787f7aeafb5937de9c418184cbb631ccb553 (patch)
tree8c1311aa94f2fd1412518363c0e01610f2a1793c
parent80ea4bcde6f2f5a767e4fb0ef9d26fcea18be5d8 (diff)
Pushing this as a possible fix for STR #2622.
This might not be correct (though I think it is) but should be no worse than the current mess I made... Please test with as many different win32/64 compilers as possible and let me know! git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8643 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--src/fl_font_win32.cxx5
1 files changed, 0 insertions, 5 deletions
diff --git a/src/fl_font_win32.cxx b/src/fl_font_win32.cxx
index 376df1d69..2dca456d5 100644
--- a/src/fl_font_win32.cxx
+++ b/src/fl_font_win32.cxx
@@ -282,7 +282,6 @@ void Fl_GDI_Graphics_Driver::text_extents(const char *c, int n, int &dx, int &dy
}
static unsigned short *ext_buff = NULL; // UTF-16 converted version of input UTF-8 string
- static WCHAR *c_buff = NULL; // glyph class array (if needed)
static WORD *w_buff = NULL; // glyph indices array
static unsigned wc_len = 0; // current string buffer dimensions
static const MAT2 matrix = { { 0, 1 }, { 0, 0 }, { 0, 0 }, { 0, 1 } }; // identity mat for GetGlyphOutlineW
@@ -315,11 +314,9 @@ void Fl_GDI_Graphics_Driver::text_extents(const char *c, int n, int &dx, int &dy
if(len >= wc_len) {
if(ext_buff) {delete [] ext_buff;}
if(w_buff) {delete [] w_buff;}
- if(c_buff) {delete [] c_buff;}
wc_len = len + 64;
ext_buff = new unsigned short[wc_len];
w_buff = new WORD[wc_len];
- c_buff = new WCHAR[wc_len];
len = fl_utf8toUtf16(c, n, ext_buff, wc_len);
}
SelectObject(gc, fl_fontsize->fid);
@@ -339,10 +336,8 @@ void Fl_GDI_Graphics_Driver::text_extents(const char *c, int n, int &dx, int &dy
if (has_surrogates) {
// GetGlyphIndices will not work - use GetCharacterPlacementW() instead
GCP_RESULTSW gcp_res;
- memset(c_buff, 0, (sizeof(WCHAR) * wc_len));
memset(w_buff, 0, (sizeof(WORD) * wc_len));
memset(&gcp_res, 0, sizeof(GCP_RESULTSW));
- gcp_res.lpClass = c_buff;
gcp_res.lpGlyphs = (LPWSTR)w_buff;
gcp_res.nGlyphs = wc_len;
gcp_res.lStructSize = sizeof(gcp_res);