299 (lineFrom, indexFrom, lineTo, indexTo) == self.__selection: |
299 (lineFrom, indexFrom, lineTo, indexTo) == self.__selection: |
300 # initial call |
300 # initial call |
301 line = self.__selection[2] |
301 line = self.__selection[2] |
302 index = self.__selection[3] |
302 index = self.__selection[3] |
303 else: |
303 else: |
304 line = lineFrom |
304 if (lineFrom, indexFrom) == (-1, -1): |
305 index = indexFrom - 1 |
305 # no selection present |
|
306 line = cline |
|
307 index = cindex |
|
308 else: |
|
309 line = lineFrom |
|
310 index = indexFrom - 1 |
306 if self.ui.selectionCheckBox.isChecked() and \ |
311 if self.ui.selectionCheckBox.isChecked() and \ |
307 line == self.__selection[0] and \ |
312 line == self.__selection[0] and \ |
308 index >= 0 and \ |
313 index >= 0 and \ |
309 index < self.__selection[1]: |
314 index < self.__selection[1]: |
310 ok = False |
315 ok = False |
472 |
477 |
473 def __doReplace(self, searchNext): |
478 def __doReplace(self, searchNext): |
474 """ |
479 """ |
475 Private method to replace one occurrence of text. |
480 Private method to replace one occurrence of text. |
476 |
481 |
477 @param searchNext flag indicating to search for the next occurrence. |
482 @param searchNext flag indicating to search for the next occurrence (boolean). |
478 """ |
483 """ |
479 self.__finding = True |
484 self.__finding = True |
480 |
485 |
481 # Check enabled status due to dual purpose usage of this method |
486 # Check enabled status due to dual purpose usage of this method |
482 if not self.ui.replaceButton.isEnabled() and \ |
487 if not self.ui.replaceButton.isEnabled() and \ |