Since GSoC 2014's Matteo Campanelli's work on "Enhancing text frames" [1], EditEngine supports CharBackColor property. This can be used not only in Draw (as the GSoC project was called), but anywhere where EditEngine is used, including Calc's cells. This code works and makes first three characters in A1 to be white-on-black: Sub SelectFirst3CharsInCell Dim oCell, oSheet, oCursor, oVCurs oSheet = thisComponent.CurrentSelection.getSpreadsheet oCell = oSheet.GetCellbyPosition(0, 0) ThisComponent.CurrentController.Select(oCell) oCell.setString("12345") oCursor=oCell.Text.createTextCursor() oCursor.gotoStart(False) oCursor.goRight(3, true) oCursor.CharBackColor = RGB(0,0,0) oCursor.CharColor = RGB(255,255,255) End Sub In bug 88276, sidebar got a UI to set the property in text boxes (v.5.0); later in the same bug it was added also to character properties dialog for text box objects (v.5.1). However, it never made it into Calc's cell character properties. Also it is not saved to ODS. It either needs to get full support (writing to ODS, UI access), or should not be available from the API (the property is optional, so may be absent in case of Calc's cell). [1] https://wiki.documentfoundation.org/Development/GSoC/Successfully_Implemented_Ideas#Improve_Text_Boxes_in_Draw
Repro in: Version: 7.4.2.3 (x64) / LibreOffice Community Build ID: 382eef1f22670f7f4118c8c2dd222ec7ad009daf CPU threads: 6; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win Locale: ru-RU (ru_RU); UI: ru-RU Calc: threaded
We already had bug 39274, but I'm reluctant to mark this as a duplicate given how much detail Mike provided.
(In reply to Stéphane Guillou (stragu) from comment #2) :-) I'm OK if my duplicated (with whatever level of details) are closed as dupes of other bugs; in the end, the details can be mentioned/copied there. OTOH, I myself tend to close *older* bugs with few detail level as duplicates of *newer* bugs of higher quality. But in this case, it's not a duplicate. Bug 39274 is a request for that functionality; it was filed in 2011, when the code that I'm talking about didn't exist. This bug 151839 is about existing functionality, introduced in 2014, that is incomplete. One of *viable* options for resolving/fixing this bug 151839 is to *remove* the API from Calc - something that would make it consistent, so would resolve this issue - but that would not resolve bug 39274. Of course, this bug 151839 is a good code pointer for anyone who would like to implement the rest for bug 39274.