aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2000-09-07 23:56:41 +0000
committernyamatongwe <devnull@localhost>2000-09-07 23:56:41 +0000
commitf6ef56aebf011adf947959a0c26db6964924004c (patch)
tree161bfbc99812bf0773fee8c7a0018586ae2e9aaf
parenta95266ce78a29739ff3fed6d2e6087920c2178c3 (diff)
downloadscintilla-mirror-f6ef56aebf011adf947959a0c26db6964924004c.tar.gz
Incorporated Mark's patch to handle failing GetTextExtentExPoint.
-rw-r--r--win32/PlatWin.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx
index 4eb1e2b47..2eb2d12f0 100644
--- a/win32/PlatWin.cxx
+++ b/win32/PlatWin.cxx
@@ -516,7 +516,11 @@ void Surface::MeasureWidths(Font &font_, const char *s, int len, int *positions)
}
positions[i] = sz.cx;
} else {
- ::GetTextExtentExPoint(hdc, s, len, 30000, &fit, positions, &sz);
+ if (!::GetTextExtentExPoint(hdc, s, len, 30000, &fit, positions, &sz)) {
+ // Eeek - a NULL DC or other foolishness could cause this.
+ // The least we can do is set the positions to zero!
+ memset(positions, 0, len * sizeof(*positions));
+ }
}
}