~ubuntu-branches/ubuntu/wily/tk8.6/wily

« back to all changes in this revision

Viewing changes to generic/tkTextDisp.c

  • Committer: Package Import Robot
  • Author(s): Sergei Golovan
  • Date: 2013-10-05 11:59:47 UTC
  • mfrom: (8.1.5 experimental)
  • Revision ID: package-import@ubuntu.com-20131005115947-fuy2i0zetr6iuyn3
Added the libtk8.6-dbg package with libtk8.6 debug symbols in it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6064
6064
    if (textPtr->xScrollCmd != NULL) {
6065
6065
        char buf1[TCL_DOUBLE_SPACE+1];
6066
6066
        char buf2[TCL_DOUBLE_SPACE+1];
 
6067
        Tcl_DString buf;
6067
6068
 
6068
6069
        buf1[0] = ' ';
6069
6070
        buf2[0] = ' ';
6070
6071
        Tcl_PrintDouble(NULL, first, buf1+1);
6071
6072
        Tcl_PrintDouble(NULL, last, buf2+1);
6072
 
        code = Tcl_VarEval(interp, textPtr->xScrollCmd, buf1, buf2, NULL);
 
6073
        Tcl_DStringInit(&buf);
 
6074
        Tcl_DStringAppend(&buf, textPtr->xScrollCmd, -1);
 
6075
        Tcl_DStringAppend(&buf, buf1, -1);
 
6076
        Tcl_DStringAppend(&buf, buf2, -1);
 
6077
        code = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, 0);
 
6078
        Tcl_DStringFree(&buf);
6073
6079
        if (code != TCL_OK) {
6074
6080
            Tcl_AddErrorInfo(interp,
6075
6081
                    "\n    (horizontal scrolling command executed by text)");
6346
6352
    if (textPtr->yScrollCmd != NULL) {
6347
6353
        char buf1[TCL_DOUBLE_SPACE+1];
6348
6354
        char buf2[TCL_DOUBLE_SPACE+1];
 
6355
        Tcl_DString buf;
6349
6356
 
6350
6357
        buf1[0] = ' ';
6351
6358
        buf2[0] = ' ';
6352
6359
        Tcl_PrintDouble(NULL, first, buf1+1);
6353
6360
        Tcl_PrintDouble(NULL, last, buf2+1);
6354
 
        code = Tcl_VarEval(interp, textPtr->yScrollCmd, buf1, buf2, NULL);
 
6361
        Tcl_DStringInit(&buf);
 
6362
        Tcl_DStringAppend(&buf, textPtr->yScrollCmd, -1);
 
6363
        Tcl_DStringAppend(&buf, buf1, -1);
 
6364
        Tcl_DStringAppend(&buf, buf2, -1);
 
6365
        code = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, 0);
 
6366
        Tcl_DStringFree(&buf);
6355
6367
        if (code != TCL_OK) {
6356
6368
            Tcl_AddErrorInfo(interp,
6357
6369
                    "\n    (vertical scrolling command executed by text)");
8196
8208
    };
8197
8209
    int index;
8198
8210
 
8199
 
    if (Tcl_GetIndexFromObj(interp, objv[2], subcommands, "option", 0,
8200
 
            &index) != TCL_OK) {
 
8211
    if (Tcl_GetIndexFromObjStruct(interp, objv[2], subcommands,
 
8212
            sizeof(char *), "option", 0, &index) != TCL_OK) {
8201
8213
        return TKTEXT_SCROLL_ERROR;
8202
8214
    }
8203
8215
 
8216
8228
            Tcl_WrongNumArgs(interp, 3, objv, "number units|pages|pixels");
8217
8229
            return TKTEXT_SCROLL_ERROR;
8218
8230
        }
8219
 
        if (Tcl_GetIndexFromObj(interp, objv[4], units, "argument", 0,
8220
 
                &index) != TCL_OK) {
 
8231
        if (Tcl_GetIndexFromObjStruct(interp, objv[4], units,
 
8232
                sizeof(char *), "argument", 0, &index) != TCL_OK) {
8221
8233
            return TKTEXT_SCROLL_ERROR;
8222
8234
        }
8223
8235
        switch ((enum viewUnits) index) {