Farbflash projects: Imaging lingo table | 3-D scene list | Find all | Handler menu | Lingo message window

Changeset 108 for trunk/lingosource


Ignore:
Timestamp:
01/16/08 09:03:56 (4 years ago)
Author:
alex
Message:

fixed a bug where mGetGlobalList was called in the wrong scope

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lingosource/castlib1/thisMoviesScript.ls

    r105 r108  
    101101  savelist = [:] 
    102102   
     103   
     104  -- list to cache results for every different searchword 
     105  pCachedResults = xscr().mGetGlobalValue(#pCachedResults) 
     106  if ilk(pCachedResults) <> #proplist then 
     107    pCachedResults = [:] 
     108    xscr().mSetGlobalValue(#pCachedResults, pCachedResults) 
     109  end if 
     110   
     111   
     112   
    103113  tell the stage 
    104114     
     
    108118        if memref.type = #script then 
    109119           
    110           thisScriptList = mGetScriptHandlerList(memref, kw, searchmode, len) 
     120          thisScriptList = mGetScriptHandlerList(memref, kw, searchmode, len, pCachedResults) 
    111121           
    112122          if count(thisScriptList) > 0 then 
     
    248258-- get a list of all handlers which pass through the filter if any, in the format we need for the menu 
    249259 
    250 on mGetScriptHandlerList memref, kw, searchmode, len 
     260on mGetScriptHandlerList memref, kw, searchmode, len, pCachedResults 
    251261   
    252262  scrtext = string(memref.scripttext) 
     
    262272     
    263273    if len < 1 then 
     274       
    264275      -- we cache only the results, if there is no search word 
    265276      -- otherwise we would need to cache the result for every different searchword 
    266       pCachedResults = xscr().mGetGlobalValue(#pCachedResults) 
    267       if ilk(pCachedResults) <> #proplist then 
    268         pCachedResults = [:] 
    269         xscr().mSetGlobalValue(#pCachedResults, pCachedResults) 
    270       end if 
     277       
     278      --      pCachedResults = xscr().mGetGlobalValue(#pCachedResults) 
     279      --      if ilk(pCachedResults) <> #proplist then 
     280      --        pCachedResults = [:] 
     281      --        xscr().mSetGlobalValue(#pCachedResults, pCachedResults) 
     282      --      end if 
     283       
    271284      cached = pCachedResults.getaprop(string(memref)) 
    272285      if ilk(cached) = #proplist then 
     
    281294    end if 
    282295    if found <> 1 then 
    283     found = mParseScriptText(scrtext, theItems, defaultItem, kw, searchmode, len) 
     296      found = mParseScriptText(scrtext, theItems, defaultItem, kw, searchmode, len) 
    284297      if len < 1 then 
    285         pCachedResults = xscr().mGetGlobalValue(#pCachedResults) 
    286         if ilk(pCachedResults) <> #proplist then 
    287           pCachedResults = [:] 
    288           xscr().mSetGlobalValue(#pCachedResults, pCachedResults) 
    289         end if 
     298         
     299        --        pCachedResults = xscr().mGetGlobalValue(#pCachedResults) 
     300        --        if ilk(pCachedResults) <> #proplist then 
     301        --          pCachedResults = [:] 
     302        --        xscr().mSetGlobalValue(#pCachedResults, pCachedResults) 
     303        --      end if 
     304         
     305         
    290306        pCachedResults.setaprop(string(memref), [#theDate:memref.modifiedDate, #items:duplicate(theItems)]) 
    291307      end if 
Note: See TracChangeset for help on using the changeset viewer.