Bug 149775

Summary: New Find objects created for each call to Selection.Find
Product: LibreOffice Reporter: Hannah Meeks <hmeeks4135>
Component: WriterAssignee: Hannah Meeks <hmeeks4135>
Status: RESOLVED FIXED    
Severity: normal CC: aron.budea, ilmari.lauhakangas, xiscofauli
Priority: medium    
Version: 7.5.0.0 alpha0+   
Hardware: All   
OS: All   
Whiteboard: target:7.5.0
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 108908    

Description Hannah Meeks 2022-06-29 17:16:39 UTC
Description:
Find state needs to be persisted so as to be compatible with: https://docs.microsoft.com/en-us/office/vba/api/word.find
Seems to be application level so use static

Steps to Reproduce:
/

Actual Results:
/

Expected Results:
/


Reproducible: Always


User Profile Reset: No



Additional Info:
/
Comment 1 Hannah Meeks 2022-06-29 17:20:38 UTC
With Selection.Find 
 .ClearFormatting 
 .Text = "hi" 
 .Execute Forward:=True 
End With

- This would make a new object for every line which ends up not executing anything useful! :-)
Comment 2 Julien Nabet 2022-06-29 19:02:51 UTC
Let's put this one as ASSIGNED since you assigned yourself :-)
Comment 3 Commit Notification 2022-07-12 05:38:51 UTC
Hannah Meeks committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/f6be2bf969bac1f5c6ac452b313374ba09ffaa58

tdf#149775 - VBA: Find should stay around.

It will be available in 7.5.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Buovjaga 2022-11-01 07:02:25 UTC
Looks like this can be changed to fixed status. Thanks.
Comment 5 Xisco FaulĂ­ 2023-03-07 11:56:02 UTC
Hi Hannah Meeks,
would it be possible to have a unittest for this issue ?