View Single Post
Old 12-07-2020, 01:21 PM   #1
un_pogaz
Chalut o/
un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.
 
un_pogaz's Avatar
 
Posts: 441
Karma: 145424
Join Date: Dec 2017
Device: Kobo
[BUG] Incorrect Case with the test field

I discover a bug in the "Search and Replace" module:
When the "Character match" mode is selected, the Case is not correctly applied to the test result field (based on s_r_do_regexp() )

I'm not too sure what to do to submit the fix, so there you go:

in the s_r_paint_results()
source code
Code:
self.test_result.setText(self.s_r_obj.sub(self.s_r_func,
                         unicode_type(self.test_text.text())))
new code
Code:
t = self.s_r_obj.sub(self.s_r_func, unicode_type(self.test_text.text()))
if self.search_mode.currentIndex() == 0:
    rfunc = self.s_r_functions[unicode_type(self.replace_func.currentText())]
    t = rfunc(t)
self.test_result.setText(t)
https://github.com/un-pogaz/calibre/...ca05d82ef62a3c

Last edited by un_pogaz; 12-07-2020 at 01:27 PM.
un_pogaz is online now   Reply With Quote