https://issues.apache.org/ooo/show_bug.cgi?id=122423
Bug ID: 122423
Issue Type: DEFECT
Summary: SearchStyles does not apply in createReplaceDescriptor
Product: App Dev
Version: AOO 3.4.1
Hardware: PC
OS: Windows 7
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: scripting
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
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
--
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.