summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXFont.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2007-11-21 16:46:25 (GMT)
committerdgp <dgp@users.sourceforge.net>2007-11-21 16:46:25 (GMT)
commit41749d2f0483a6d2f71f624be6b96faff276f491 (patch)
tree2d7b44a18db2c51b77444675eef3981a791da3c4 /macosx/tkMacOSXFont.c
parent2168c0147d8f33747f24da4a35a2b6e29ebdee55 (diff)
downloadtk-41749d2f0483a6d2f71f624be6b96faff276f491.zip
tk-41749d2f0483a6d2f71f624be6b96faff276f491.tar.gz
tk-41749d2f0483a6d2f71f624be6b96faff276f491.tar.bz2
merge updates from 8.5b3
Diffstat (limited to 'macosx/tkMacOSXFont.c')
-rw-r--r--macosx/tkMacOSXFont.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c
index d78670e..34128e9 100644
--- a/macosx/tkMacOSXFont.c
+++ b/macosx/tkMacOSXFont.c
@@ -35,7 +35,7 @@
* that such fonts can not be used for controls, because controls
* definitely require a family id (this assertion needs testing).
*
- * RCS: @(#) $Id: tkMacOSXFont.c,v 1.24.2.9 2007/11/13 13:08:44 dgp Exp $
+ * RCS: @(#) $Id: tkMacOSXFont.c,v 1.24.2.10 2007/11/21 16:46:27 dgp Exp $
*/
#include "tkMacOSXPrivate.h"
@@ -938,13 +938,13 @@ TkpMeasureCharsInContext(
*/
if (flags & TK_WHOLE_WORDS) {
- if ((flags & TK_AT_LEAST_ONE)
- && ((offset == urstart) || (uchars[offset] != ' '))) {
+ if ((flags & TK_AT_LEAST_ONE) && ((offset == urstart)
+ || ((offset != urend) && (uchars[offset] != ' ')))) {
/*
* With TK_AT_LEAST_ONE, if we are the the start of the
* range, we need to add at least one character. If we are
* not at the end of a word, we must be in the middle of the
- * first word still and we want to run with what we have so
+ * first word still and we want to just use what we have so
* far. In both cases we still need to find the right
* character boundary, so we set a flag that gets us into the
* code for character mode below.
@@ -971,13 +971,15 @@ TkpMeasureCharsInContext(
/*
* If "flags" says that we don't actually want a word break, we need
- * to find the next character break ourself, as ATSUBreakLine() will
- * only give us word breaks. Do a simple linear search.
+ * to find the next character break ourself, as ATSUBreakLine will
+ * only give us word breaks. Do a simple linear search.
+ *
+ * Even do this, if ATSUBreakLine returned kATSULineBreakInWord,
+ * because we have not accounted correctly for all of the flags yet,
+ * like TK_AT_LEAST_ONE.
*/
- if ((err != kATSULineBreakInWord)
- && (!(flags & TK_WHOLE_WORDS) || forceCharacterMode)
- && (offset <= urend)) {
+ if ((!(flags & TK_WHOLE_WORDS) || forceCharacterMode) && (offset <= urend)) {
UniCharArrayOffset lastOffset = offset;
UniCharArrayOffset nextoffset;
int lastX = -1;