[Libreoffice-bugs] [Bug 129841] New: XTextTableCursor::setPropertyValue("BackColor", x) sets paragraph background color, not cell background

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Mon Jan 6 19:42:09 UTC 2020


https://bugs.documentfoundation.org/show_bug.cgi?id=129841

            Bug ID: 129841
           Summary: XTextTableCursor::setPropertyValue("BackColor", x)
                    sets paragraph background color, not cell background
           Product: LibreOffice
           Version: Inherited From OOo
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: BASIC
          Assignee: libreoffice-bugs at lists.freedesktop.org
          Reporter: mikekaganski at hotmail.com

In a text document insert a table; select several cells in it; run the
following BASIC code:

> Sub ColorizeTable1
>   ThisComponent.getCurrentSelection().BackColor = &H00FF0000
> End Sub

Expected result is the cells having red background. Actual result is cells'
paragraphs get red background, which makes cells have white spacing.

Compare to

> Sub ColorizeTable2
>   ThisComponent.getTextTables().getByIndex(0).getCellRangeByName("A1:A1").BackColor = &H00FF0000
> End Sub

which correctly does the job.

Both SwXTextTableCursor::setPropertyValue and SwXCellRange::setPropertyValue do
the same thing: they check for FN_UNO_TABLE_CELL_BACKGROUND to apply the value
to the cells [1]. For SwXCellRange, property name "BackColor" correctly maps to
that value. But in case of SwXTextTableCursor, neither "BackColor", nor any
other name maps to FN_UNO_TABLE_CELL_BACKGROUND, making it impossible to apply
cell color using text table cursor.

The same for getPropertyValue.

Tested in Version: 6.4.0.1 (x64)
Build ID: 1b6477b31f0334bd8620a96f0aeeb449b587be9f
CPU threads: 12; OS: Windows 10.0 Build 18363; UI render: default; VCL: win; 
Locale: ru-RU (ru_RU); UI-Language: en-US
Calc: threaded

and in OpenOffice.org 2.2.0

but not in OpenOffice.org 1.0.3

Regression after
https://git.libreoffice.org/core/+/eba784710e92597282a2284b56dce3a45ac38776

[1]
https://opengrok.libreoffice.org/xref/core/sw/source/core/unocore/unotbl.cxx?r=24314773

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20200106/793a1cab/attachment.htm>


More information about the Libreoffice-bugs mailing list