https://bugs.documentfoundation.org/show_bug.cgi?id=153272
Bug ID: 153272
Summary: Writer Macro Find with certain Search Attributes
performs Replacement.
Product: LibreOffice
Version: 7.3.4.2 release
Hardware: All
OS: Windows (All)
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: BASIC
Assignee: [email protected]
Reporter: [email protected]
Description:
When Setting the following Search Attributes singly, (I have not tried
combining them), the FindAll or FindFirst Macro command performs a Replace
command. See Macro pasted below.
Steps to Reproduce:
1.Open a new Writer Document
2.Type the Following words
3.This Fish This Fish (can be any words, but my macro I am attaching searches
for "This")
4. Create and run the following Macro
5. You can comment and uncomment each Search attribute individually, and see
each causes the same error.
Sub SearchFormatting
Dim oSearch
Dim SrchAttributes(0) as new com.sun.star.beans.PropertyValue
oSearch = ThisComponent.createSearchDescriptor()
oSearch.SearchString = "this"
'oSearch.ReplaceString = "That" 'Uncomment this to see that the Find is
performing a replace.
oSearch.ValueSearch = True ' True or False, the effect is the same.
REM Set the CharRelief attribute to find
SrchAttributes(0).Name = "CharRelief"
SrchAttributes(0).Value = 0
'NONE = 0
'EMBOSSED = 1
' ENGRAVED = 2 Any of these values causes the error.
' SrchAttributes(0).Name = "CharRotation"
'SrchAttributes(0).Value = 0 'Any acceptable value causes the same error.
' SrchAttributes(0).Name = "CharScaleWidth"
'SrchAttributes(0).Value = 100 'Any acceptable value causes the same error.
' SrchAttributes(0).Name = "ParaVertAlignment"
'SrchAttributes(0).Value = 0 'Any acceptable value causes the same error.
REM Set the attributes in the Search descriptor
oSearch.SetSearchAttributes(SrchAttributes())
ThisComponent.findAll(oSearch)
'ThisComponent.findFirst(oSearch)'Both FindAll and FindFirst behave the same.
End Sub
Actual Results:
After running the above Macro all results matching "this" are erased, if I
uncomment 'oSearch.ReplaceString, all results are replaced with the set replace
string.
Expected Results:
I would expect the Basic/Macro commands FindAll and FindFirst to return the
Result as an Object and NOT modify the text.
Reproducible: Always
User Profile Reset: Yes
Additional Info:
Version: 7.3.4.2 (x64) / LibreOffice Community
Build ID: 728fec16bd5f605073805c3c9e7c4212a0120dc5
CPU threads: 2; OS: Windows 6.1 Service Pack 1 Build 7601; UI render:
Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL
' SrchAttributes(0).Name = ""WritingMode""
'SrchAttributes(0).Value = 0 'Any acceptable value causes the same error.
also causes the same error when search individually, but not when combined,
this may not be part of a bug?
--
You are receiving this mail because:
You are the assignee for the bug.