Fixed an issue in the hex editor search and replace widget.

Sun, 10 Jan 2016 17:16:20 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 10 Jan 2016 17:16:20 +0100
changeset 4654
9dafe6905667
parent 4653
e8b51747c48e
child 4655
f2f0abd5bc94

Fixed an issue in the hex editor search and replace widget.

HexEdit/HexEditSearchReplaceWidget.py file | annotate | diff | comparison | revisions
--- a/HexEdit/HexEditSearchReplaceWidget.py	Sun Jan 10 16:55:10 2016 +0100
+++ b/HexEdit/HexEditSearchReplaceWidget.py	Sun Jan 10 17:16:20 2016 +0100
@@ -243,13 +243,14 @@
            not self.__ui.replaceSearchButton.isEnabled():
             return
         
+        fba, ftxt = self.__getContent(False)
         rba, rtxt = self.__getContent(True)
         
         ok = False
         if self.__editor.hasSelection():
             # we did a successful search before
             startIdx = self.__editor.getSelectionBegin()
-            self.__editor.replaceByteArray(startIdx, len(rba), rba)
+            self.__editor.replaceByteArray(startIdx, len(fba), rba)
             
             if searchNext:
                 ok = self.findPrevNext(self.__findBackwards)
@@ -274,7 +275,7 @@
         while idx >= 0:
             idx = self.__editor.indexOf(fba, idx)
             if idx >= 0:
-                self.__editor.replaceByteArray(idx, len(rba), rba)
+                self.__editor.replaceByteArray(idx, len(fba), rba)
                 idx += len(rba)
                 replacements += 1
         

eric ide

mercurial