Ignore:
Timestamp:
02/02/03 14:06:10 (21 years ago)
Author:
Nicholas Riley
Message:

ICeCoffEE 1.3b3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ICeCoffEE/ICeCoffEE/ICeCoffEETextEdit.c

    r75 r79  
    2020//-----------------------------------------------------------------------------
    2121TEClickProcPtr  gTEClick = NULL;
    22 Handle                  gErrors;
    2322
    2423//=============================================================================
     
    119118    SInt8               s;
    120119    ConstStringPtr hint;
     120    Boolean             needsSlashes;
    121121    textH = (Handle)TEGetText(teH);
    122122    s = HGetState(textH);
    123123    HLock(textH);
    124     hint = ICCF_GetHint(inst, *textH, selStart, selEnd);
     124    hint = ICCF_GetHint(inst, *textH, GetHandleSize(textH), &selStart, &selEnd, &needsSlashes);
     125    ICapeprintf("ICCF_DoCommandClick: %sneedsSlashes\n", needsSlashes ? "" : "doesn't ");
    125126    if (hint != NULL) {
    126127        CGrafPtr thePort = teH[0]->inPort;
    127128        if (!QDIsPortBuffered(thePort)) thePort = NULL;
    128 
    129129        TESetSelect(selStart, selEnd, teH);
    130130        if (thePort != NULL) QDFlushPortBuffer(thePort, NULL);
     
    136136            } else {
    137137                err = ICParseURL(inst, hint, *textH, GetHandleSize(textH), &selStart, &selEnd, urlH);
    138                 if (err == noErr)
    139                     err = ICCF_DoURLActionMenu(inst, hint, *urlH, 0, GetHandleSize(urlH) - 1);
     138                if (err == noErr) {
     139                    if (needsSlashes) ICCF_AddSlashes(urlH, hint);
     140                    err = ICCF_DoURLActionMenu(inst, hint, *urlH, 0, GetHandleSize(urlH));
     141                }
    140142                DisposeHandle(urlH);
    141143            }
    142144        } else {
    143             err = ICLaunchURL(inst, hint, *textH, GetHandleSize(textH), &selStart, &selEnd);
     145            if (needsSlashes) {
     146                Handle urlH = NewHandle(0);
     147                err = ICParseURL(inst, hint, *textH, GetHandleSize(textH), &selStart, &selEnd, urlH);
     148                if (err == noErr) {
     149                    ICCF_AddSlashes(urlH, hint);
     150                    // don't want to disturb text selection
     151                    long tmpEnd = GetHandleSize(urlH);
     152                    long tmpStart = 0;
     153                    err = ICLaunchURL(inst, hint, *urlH, GetHandleSize(urlH), &tmpStart, &tmpEnd);
     154                }
     155            } else {
     156                err = ICLaunchURL(inst, hint, *textH, GetHandleSize(textH), &selStart, &selEnd);
     157            }
    144158        }
    145159       
Note: See TracChangeset for help on using the changeset viewer.