(In reply to Lars Jødal from comment #37)
> Can anybody come up with a case where searching within deleted text
> and replacing with new text would be the intended behaviour?
At the code level, ReplaceImpl is also used by the spell checker. In the case 
of spell checking, it definitely does not need to look at deletions. So the 
search part is intelligent enough to see only the "normal" text, but at the 
implementation level it might have selected a mixture of deletions and regular 
text.

Obviously in this case we need to replace with new text (although it
makes the resulting track-changes an ugly mess).

Thankfully an existing unit test caught that in my patch. I found a way
to limit my changes to when Find/Replace is running.

Well - almost. If you 'Close' the Find/Replace dialog, then it resets
the static SwView::GetSearchItem()->GetCommand() to SvxSearchCmd::FIND.
However, if you 'x' out of the dialog, then no such reset happens. So I
also compare the current 'replace' string with the search item's replace
string. That gets me 99.9% accuracy.

My patch will get into trouble if:
-you are showing tracked changes
-and you at some earlier point in this session have done a search and replace
-and the very last action in S&R was a replace
-and you didn't close the S&R dialog with the close button
-and very first spell-checked word requests the same replacement as S&R last did
-and the word spell-check is correcting contains a deletion

I hope the odds of that happening are low enough...

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1126858

Title:
  [upstream] Search and replace, with tracked changes on, changing only
  format of text, causes Writer to hang

To manage notifications about this bug go to:
https://bugs.launchpad.net/df-libreoffice/+bug/1126858/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to