Issue 77376 - Find & Replace with regex fails with "Replace All"
Summary: Find & Replace with regex fails with "Replace All"
Status: CLOSED FIXED
Alias: None
Product: Calc
Classification: Application
Component: editing (show other issues)
Version: OOo 2.2
Hardware: All All
: P3 Trivial with 1 vote (vote)
Target Milestone: ---
Assignee: stefan.baltzer
QA Contact: issues@sc
URL:
Keywords: oooqa
: 83938 (view as issue list)
Depends on:
Blocks:
 
Reported: 2007-05-15 07:03 UTC by Joe Smith
Modified: 2013-08-07 15:14 UTC (History)
2 users (show)

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


Attachments
Sample document demonstrating problem (8.45 KB, application/vnd.sun.xml.calc)
2007-05-15 07:05 UTC, Joe Smith
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Joe Smith 2007-05-15 07:03:42 UTC
1. File > New > Spreadsheet
2. Enter "abcd" in A1:A3
3. Select A1:A3
4. Edit > Find & Replace
   Search for: ^[^h] (text beginning with any character except 'h')
   Replace with: h(&)
   Options: Current selection only = YES
   Options: Regular expressions = YES
5. Click "Replace All"
   * Expected result: "h(a)bcd" in each cell A1:A3
   * Actual result is: "h(a)h(b)h(c)h(d)" in each cell
6. Leave Find & Replace dialog open
7. Undo step 5 (Ctrl+z); A1:A3 are still selected
8. Click "Find" and "Replace" to cycle through each cell
   * Result is correct
Comment 1 Joe Smith 2007-05-15 07:05:00 UTC
Created attachment 45111 [details]
Sample document demonstrating problem
Comment 2 paul.m.nz 2007-05-17 01:53:07 UTC
confirmed issue as stated.

However interestingly the correct result will occur when the cells are not
highlighted.
eg, if you do not highlight A1:A3, follow step 4, select 'replace all' the
result will be the 'expected result' in step 4.

The issue does however required to be corrected when the cells are highlighted.
Have updated status to 'new' and added appropriate keywords.
Comment 3 Joe Smith 2007-05-17 03:30:44 UTC
Thanks for having a look.

I encountered this problem when trying to restrict a Find & Replace to specific
cells using the "Current selection only" option. The sample document does not
need to have the cells selected, but my document needed them to be selected.

After some testing of the problem, I found that it was triggered even if the
"Current selection only" option was not checked. I only reported the minimum
necessary conditions, even though this minimal situation would not be chosen
under normal use.

The workaround for the normal situation is to select the cells, set the "Current
selection only" option, but then step through the changes one at a time.
Comment 4 frank 2007-07-09 11:33:47 UTC
Hi Eike,

please have a look at this one.

Frank
Comment 5 ooo 2007-07-09 12:44:15 UTC
Accepted.
Comment 6 drking 2007-10-29 18:23:23 UTC
This also occurs in Writer (OOo2.3):
Select a paragraph starting with aaaa
Search for ^a
Replace with x
Regular expressions and current selection only boxes ticked
Replace all

get xxxx instead of xaaa

I hope that's useful
Comment 7 andreas.martens 2007-11-01 13:28:53 UTC
Will be fixed in CWS regexp02 for OOo2.4
Comment 8 andreas.martens 2007-11-09 08:04:05 UTC
Fixed in CWS regexp02
textsearch.cxx
Comment 9 andreas.martens 2007-11-09 16:20:25 UTC
Ready for QA
Comment 10 stefan.baltzer 2007-11-26 13:28:33 UTC
SBA: Verified both dedscribed cases in CWS regexp02.
Comment 11 Joe Smith 2007-12-13 02:49:46 UTC
Verified FIXED in SRC680_m239.

Thank you!
Comment 12 stefan.baltzer 2008-04-15 23:16:10 UTC
Closed.
Comment 13 stefan.baltzer 2008-05-27 17:08:18 UTC
*** Issue 83938 has been marked as a duplicate of this issue. ***