Apache OpenOffice (AOO) Bugzilla – Issue 122423
SearchStyles does not apply in createReplaceDescriptor
Last modified: 2013-06-01 13:25:31 UTC
I had a macro which was working well until last update. It was making italic text non-italic and wrap it around text I provide. However after last update of OO it stopped working. I finds the italic text but does not find it's end and goes to the end of paragraph. E.g. test <italic> test <no-italic> test previously was translated to: test Italic test Normal test however now it's: test Italic test test Normal Here is my macro: Sub italicf Dim oDoc As Object Dim oReplace As Object Dim SrchAttributes(0) As New com.sun.star.beans.PropertyValue Dim ReplAttributes(0) As New com.sun.star.beans.PropertyValue oDoc = ThisComponent oReplace = oDoc.createReplaceDescriptor oReplace.SearchString = ".*" oReplace.ReplaceString = "Italic" + "&" + "Normal" oReplace.SearchRegularExpression=True oReplace.searchStyles=True oReplace.searchAll=True SrchAttributes(0).Name = "CharPosture" SrchAttributes(0).Value =com.sun.star.awt.FontSlant.ITALIC ReplAttributes(0).Name = "CharPosture" ReplAttributes(0).Value =com.sun.star.awt.FontSlant.NONE oReplace.SetSearchAttributes(SrchAttributes()) oReplace.SetReplaceAttributes(ReplAttributes()) oDoc.replaceAll(oReplace) End sub It repro as well for looking for a bold text. Thanks, Jakub
The macro works on AOO400m2(Build:9701) - Rev. 1486438. But not working on 3.4.1.