Bug 144299 - SheetCellRanges service SEARCHING FOR STYLE cant FindAll or ReplaceAll if .Count=1 / simple SheetCellRange also can't.
Summary: SheetCellRanges service SEARCHING FOR STYLE cant FindAll or ReplaceAll if .Co...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: sdk (show other bugs)
Version:
(earliest affected)
3.5.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: UNO
  Show dependency treegraph
 
Reported: 2021-09-04 21:18 UTC by Wolfgang Jäger
Modified: 2022-09-07 13:11 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
the announced attachment (9.56 KB, application/vnd.oasis.opendocument.spreadsheet)
2021-09-04 21:18 UTC, Wolfgang Jäger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Wolfgang Jäger 2021-09-04 21:18:41 UTC
Created attachment 174779 [details]
the announced attachment

If a .FindAll(searchDescriptor) or a .ReplaceAll(searchDescriptor) is called from a SfheetCellRange service or from a SheetCellRanges service containing exactly one range (.Count=1) there is no action. 
The foundRanges is Null, and the replacement not executed.

This I recently experienced with LibO V 7.2.0.4, but also trying old versions (32 bit) I found that even a version as early as 3.5.2 ad the bug.  

I couldn't test with versions in-betwwen, but the heritage version 3.3. was not afflicted. (AOO 4.1.7 also isn't.)  

Trying the code contained in the attached example should exemplify the bug. 
Run it with only a single range of the first sheet selected --> failure
Select a second range OR the tab of the second sheet in addition --> success.
Comment 1 Wolfgang Jäger 2021-09-19 10:09:07 UTC
Sorryy!  
When reporting the bug I completely missed to emphasize (in fact I not even mentioned) the very important condition "searching for style".
The Basic code in the attached example is containing the lines 

With searchDe
  .SearchStyles = True
  .SearchString = workCS
End With

The search for 
  .SearchStyles = False
with an ordinary .SearchString is NOT afflicted.

Sorry
Comment 2 Buovjaga 2022-09-07 13:11:29 UTC
(In reply to Wolfgang Jäger from comment #0)
> Created attachment 174779 [details]
> the announced attachment
> Trying the code contained in the attached example should exemplify the bug. 
> Run it with only a single range of the first sheet selected --> failure
> Select a second range OR the tab of the second sheet in addition --> success.

I reproduce.

The failure error is:
Inadmissible value or data type.
Data type mismatch.

Pointing to line 17
For Each rg In csRgs

Arch Linux 64-bit
Version: 7.5.0.0.alpha0+ / LibreOffice Community
Build ID: f5c6ef40dd494f6984c6ed784fccc02806999836
CPU threads: 8; OS: Linux 5.19; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Built on 7 September 2022