Bug 163844 - CopyRange: The method may not work correctly if the target range contains merged cells.
Summary: CopyRange: The method may not work correctly if the target range contains mer...
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-11 14:11 UTC by Vladimir Sokolinskiy
Modified: 2024-11-11 14:11 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Sokolinskiy 2024-11-11 14:11:10 UTC
Create a new Calc document and run the macro:

Sub Test
  Dim oSheet As Object
  oSheet=ThisComponent.Sheets(0)
  With oSheet
    .getCellRangeByName("A1").setvalue 1     ' A1=1
    .getCellRangeByName("A2:A3").merge True  ' merge A2:A3
    .getCellRangeByName("B3:B4").merge True  ' merge B3:B4
    
    ' copy A1:A4 To B1:B4
    .copyRange .getCellByPosition(1, 0).cellAddress, .getCellRangeByName("A1:A4").RangeAddress
  End With  
End Sub

Result: Range not copied.

I think in the implementation of the copyRange method it is possible to unmerge the cells in the target range at the beginning of the work. 

See also: https://forumooo.ru/index.php?topic=11398.msg7102