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: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-11 14:11 UTC by Vladimir Sokolinskiy
Modified: 2025-05-07 14:13 UTC (History)
1 user (show)

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
Comment 1 Buovjaga 2025-05-07 14:13:54 UTC
Repro.

Arch Linux 64-bit
Version: 25.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: b710ba48503372ddaf10a17ce7f4f3340bc8adb8
CPU threads: 8; OS: Linux 6.14; UI render: default; VCL: kf6 (cairo+wayland)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: CL threaded
Built on 7 May 2025