241 # Check enabled status due to dual purpose usage of this method |
241 # Check enabled status due to dual purpose usage of this method |
242 if not self.__ui.replaceButton.isEnabled() and \ |
242 if not self.__ui.replaceButton.isEnabled() and \ |
243 not self.__ui.replaceSearchButton.isEnabled(): |
243 not self.__ui.replaceSearchButton.isEnabled(): |
244 return |
244 return |
245 |
245 |
|
246 fba, ftxt = self.__getContent(False) |
246 rba, rtxt = self.__getContent(True) |
247 rba, rtxt = self.__getContent(True) |
247 |
248 |
248 ok = False |
249 ok = False |
249 if self.__editor.hasSelection(): |
250 if self.__editor.hasSelection(): |
250 # we did a successful search before |
251 # we did a successful search before |
251 startIdx = self.__editor.getSelectionBegin() |
252 startIdx = self.__editor.getSelectionBegin() |
252 self.__editor.replaceByteArray(startIdx, len(rba), rba) |
253 self.__editor.replaceByteArray(startIdx, len(fba), rba) |
253 |
254 |
254 if searchNext: |
255 if searchNext: |
255 ok = self.findPrevNext(self.__findBackwards) |
256 ok = self.findPrevNext(self.__findBackwards) |
256 |
257 |
257 if not ok: |
258 if not ok: |