Apache OpenOffice (AOO) Bugzilla – Issue 122190
Function getCurrentController.select() not selected all occurences of collection
Last modified: 2013-04-29 16:46:23 UTC
Try the following: - create a new empty writer-document - place a text: text text text text - run the following Basic code: oDesc = ThisComponent.createReplaceDescriptor() oDesc.SearchString = "text" ' find for string "text" oFoundAll = ThisComponent.findAll(oDesc) ' find all occurences msgbox oFoundAll.count ' get 4 occurences ThisComponent.getCurrentController.select(oFoundAll()) ' select all occurences ' You'll see there's only 3 occurences of collection oFoundAll is selected, ' the cursor is placed on end of first occurence of "text" string, without highlight This behaviour has several unnatural consequenses: 1. the clipboard/transferable-content will not be the same if one tries to work with it after performing a selection 2. more complicated and causing uncertainty in the mass processing of selected texts This issue occurs with OOo 3.4.1., with OOo 3.2.0 works good.
same problem in aoo4 rev. 1476029 - select(oFoundAll()) ignores oFoundAll(0) it's still posible to loop over the four ranges