Issue 122423 - SearchStyles does not apply in createReplaceDescriptor
Summary: SearchStyles does not apply in createReplaceDescriptor
Status: UNCONFIRMED
Alias: None
Product: App Dev
Classification: Unclassified
Component: scripting (show other issues)
Version: 3.4.1
Hardware: PC Windows 7
: P2 Normal
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-30 07:08 UTC by Jakub Grzmiel
Modified: 2013-06-01 13:25 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
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.