rem: finder.caseSensitive    = gReplaceDialog.caseSensitive.checked; 
add: finder.caseSensitive = gReplaceDialog.caseSensitive.checked; 
context: function onReplaceAll(){  if (!gEditor)    return;  var findStr = gReplaceDialog.findInput.value;  var repStr = gReplaceDialog.replaceInput.value;  // Transfer dialog contents to the find service.  saveFindData();  var finder = Components.classes["@mozilla.org/embedcomp/rangefind;1"].createInstance().QueryInterface(Components.interfaces.nsIFind);  finder.caseSensitive    = gReplaceDialog.caseSensitive.checked;  finder.findBackwards = gReplaceDialog.searchBackwards.checked;  // Make a range containing the current selection,   // so we don't go past it when we wrap.  var selection = gEditor.selection;  var selecRange;  if (selection.rangeCount > 0)    selecRange = selection.getRangeAt(0);  var origRange = selecRange.cloneRange();  // We'll need a range for the whole document:  var wholeDocRange = gEditor.document.createRange();  var rootNode = gEditor.rootElement.QueryInterface(Components.interfaces.nsIDOMNode);  wholeDocRange.selectNodeContents(rootNode);  // And start and end points:  var startPt = gEditor.document.createRange();  startPt.setStart(wholeDocRange.startContainer, wholeDocRange.startOffset);  startPt.setEnd(wholeDocRange.startContainer, wholeDocRange.startOffset);  var endPt = gEditor.document.createRange();  endPt.setStart(wholeDocRange.endContainer, wholeDocRange.endOffset);  endPt.setEnd(wholeDocRange.endContainer, wholeDocRange.endOffset);  // Find and replace from here to end of document:  var foundRange;  while ((foundRange = finder.Find(findStr, wholeDocRange,                                   selecRange, endPt)) != null)  {    gEditor.selection.removeAllRanges();    gEditor.selection.addRange(foundRange);    gEditor.insertText(repStr);    selection = gEditor.selection;    if (selection.rangeCount <= 0) {      return;    }    selecRange = selection.getRangeAt(0);  }  // If wrapping, find from start of document back to start point.  selecRange.setStart(wholeDocRange.startContainer, wholeDocRange.startOffset);  selecRange.setEnd(wholeDocRange.startContainer, wholeDocRange.startOffset);  // Collapse origRange to start:  origRange.setEnd(origRange.startContainer, origRange.startOffset);  if (gReplaceDialog.wrap.checked)  {    while ((foundRange = finder.Find(findStr, wholeDocRange,                                     selecRange, origRange)) != null)    {      gEditor.selection.removeAllRanges();      gEditor.selection.addRange(foundRange);      gEditor.insertText(repStr);      selection = gEditor.selection;      if (selection.rangeCount <= 0) {        return;      }      selecRange = selection.getRangeAt(0);    }  }}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/67b4b615a92a5c833aceedbd509fe4888e306339/EdReplace.js/clean/editor/ui/dialogs/content/EdReplace.js