summaryrefslogtreecommitdiffstats
path: root/generic/tkText.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2010-03-11 09:43:19 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2010-03-11 09:43:19 (GMT)
commit34d6610e816c6d60f58dc99c2f1554d0410f28bf (patch)
treea6308a0dd54c3a26ee2fe51ee430fa98e9e84a71 /generic/tkText.c
parent3259fbc2451dd52b8aec46351254cf38818b3b83 (diff)
downloadtk-34d6610e816c6d60f58dc99c2f1554d0410f28bf.zip
tk-34d6610e816c6d60f58dc99c2f1554d0410f28bf.tar.gz
tk-34d6610e816c6d60f58dc99c2f1554d0410f28bf.tar.bz2
Removed lame reliance on the leading letters of the names of segment types when
dumping a text widget. Entailed expanding the scope of the declarations of the types of embedded images and windows.
Diffstat (limited to 'generic/tkText.c')
-rw-r--r--generic/tkText.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/generic/tkText.c b/generic/tkText.c
index 49cfae0..3010d6e 100644
--- a/generic/tkText.c
+++ b/generic/tkText.c
@@ -13,7 +13,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkText.c,v 1.98 2010/03/11 09:24:07 dkf Exp $
+ * RCS: @(#) $Id: tkText.c,v 1.99 2010/03/11 09:43:19 dkf Exp $
*/
#include "default.h"
@@ -4708,7 +4708,9 @@ DumpLine(
segPtr->body.chars + first, command, &index, what);
}
} else if ((offset >= startByte)) {
- if ((what & TK_DUMP_MARK) && (segPtr->typePtr->name[0] == 'm')) {
+ if ((what & TK_DUMP_MARK)
+ && (segPtr->typePtr == &tkTextLeftMarkType
+ || segPtr->typePtr == &tkTextRightMarkType)) {
const char *name;
TkTextMark *markPtr = (TkTextMark *) &segPtr->body;
@@ -4744,7 +4746,7 @@ DumpLine(
segPtr->body.toggle.tagPtr->name, command, &index,
what);
} else if ((what & TK_DUMP_IMG) &&
- (segPtr->typePtr->name[0] == 'i')) {
+ (segPtr->typePtr == &tkTextEmbImageType)) {
TkTextEmbImage *eiPtr = (TkTextEmbImage *)&segPtr->body;
const char *name = (eiPtr->name == NULL) ? "" : eiPtr->name;
@@ -4753,7 +4755,7 @@ DumpLine(
lineChanged = DumpSegment(textPtr, interp, "image", name,
command, &index, what);
} else if ((what & TK_DUMP_WIN) &&
- (segPtr->typePtr->name[0] == 'w')) {
+ (segPtr->typePtr == &tkTextEmbWindowType)) {
TkTextEmbWindow *ewPtr = (TkTextEmbWindow *)&segPtr->body;
const char *pathname;