Issue 122423

Summary: SearchStyles does not apply in createReplaceDescriptor
Product: App Dev Reporter: Jakub Grzmiel <grzmiel>
Component: scriptingAssignee: AOO issues mailing list <issues>
Status: UNCONFIRMED --- QA Contact:
Severity: Normal    
Priority: P2 CC: hanya.runo, issues
Version: 3.4.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---

Description Jakub Grzmiel 2013-05-30 07:08: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
Comment 1 hanya 2013-06-01 13:25:31 UTC
The macro works on AOO400m2(Build:9701)  -  Rev. 1486438.
But not working on 3.4.1.