Issue 106665 - basic-ide: find & replace: cannot replace text with empty
Summary: basic-ide: find & replace: cannot replace text with empty
Status: CLOSED FIXED
Alias: None
Product: App Dev
Classification: Unclassified
Component: scripting (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: Unknown All
: P3 Trivial
Target Milestone: 4.1.0
Assignee: ab
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-06 09:18 UTC by Oliver Brinzing
Modified: 2017-05-20 09:32 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Patch to replace selection with string even it is empty (505 bytes, patch)
2012-10-05 13:37 UTC, hanya
hanya.runo: review? (hanya.runo)
Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description Oliver Brinzing 2009-11-06 09:18:13 UTC
it seems not to be possible anymore to find text and 
replace it with an empty string.

- open basic ide
- open a basic module
- open Edit - Find & Replace
- enter searchtext in "Search for" 
- leave "Replace with" blank
- press "replace"

in addition: "replace all" seems to work
Comment 1 kay.ramme 2009-11-09 09:13:02 UTC
Andreas, please have a look ...
Comment 2 ab 2009-12-18 08:03:20 UTC
STARTED, needs to be evaluated

ab->tl: Are you aware of any changes in the Text Engine
that could have caused this problem?
Comment 3 thomas.lange 2009-12-18 08:14:49 UTC
tl->ab: No. I don't even remember when the text engine was modified the last time.
Comment 4 ab 2010-06-04 08:07:24 UTC
-> OOo 3.x
Comment 5 hanya 2012-10-05 13:22:35 UTC
Nothing happen to call TextView::InsertNewText with empty string method to 
replace selected string. It was introduced by issue 87633, insertion of long string.
Comment 6 hanya 2012-10-05 13:37:46 UTC
Created attachment 79736 [details]
Patch to replace selection with string even it is empty
Comment 7 hanya 2012-10-05 13:41:09 UTC
Attached patch introduce the condition if passed string is zero lenght and 
replace current selection even the string is empty.
Comment 8 damjan 2012-10-31 17:20:56 UTC
Hi Hanya, thank you for you patch. While it works, there is a number of actions that don't take place as a result of that while loop being skipped (for example the ImpSetSelection function doesn't get called). Wouldn't it be better to convert that while loop into a do-while loop so that it runs at least once?

Also are the others here still alive? Andreas? Thomas?
Comment 9 SVN Robot 2014-01-11 09:18:00 UTC
"hanya" committed SVN revision 1557329 into trunk:
#i106665# fix failed to replace with empty string on text view
Comment 10 hanya 2014-01-12 07:19:12 UTC
Fixed on trunk.