Bug 137525 - Update ColumnValueSet drawing to use the Push/Pop API
Summary: Update ColumnValueSet drawing to use the Push/Pop API
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium trivial
Assignee: Ritobroto Mukherjee
URL:
Whiteboard:
Keywords: difficultyMedium, easyHack, skillCpp, topicCleanup
Depends on:
Blocks: Dev-related
  Show dependency treegraph
 
Reported: 2020-10-16 10:21 UTC by Jan-Marek Glogowski
Modified: 2024-03-31 10:15 UTC (History)
4 users (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 Jan-Marek Glogowski 2020-10-16 10:21:30 UTC
While fixing bug 136924, I found the code manually restores the line and fill colors it changed in the ColumnValueSet::UserDraw function. There is a more "modern" API (Push/Pop) in RenderContext using PushFlags to restore these more automatically. So get rid of the manual backup of the colors and call the API instead.

Code is in sw/source/ui/frmdlg/column.cxx

There are probably more places in the codebase, which could be converted, but I don't see a way to identify them, so this is just a single easy hack.
Comment 1 Xisco Faulí 2020-10-22 14:20:00 UTC
Moving to NEW
Comment 2 Shubham Jain 2021-01-15 18:00:38 UTC
Hi, I would like to work on this. I looked in rendercontext.cxx and can't figure out which function(API) to use. Can someone point me in the right direction? Thanks!
Comment 3 Jan-Marek Glogowski 2021-01-16 12:21:18 UTC
(In reply to Shubham Jain from comment #2)
> Hi, I would like to work on this. I looked in rendercontext.cxx and can't
> figure out which function(API) to use. Can someone point me in the right
> direction? Thanks!

Does the following help: "typedef OutputDevice RenderContext;"?
Comment 4 Ritobroto Mukherjee 2024-03-31 10:15:08 UTC
Fixed in https://gerrit.libreoffice.org/c/core/+/165587, among a few other instances of the same problem. I believe this issue can be marked resolved as it was for one particular case in the code.

Using the command "git grep -E 'Old.*pDev->Get'", there seem to be yet more places in the code that need upgrading to the Push/Pop API.
I think the rest could be made into a difficultyBeginner EasyHack, since the above gerrit patch and grep command would make for decent code pointers.