Bug 90517 - Push WinBits constants down into subclasses
Summary: Push WinBits constants down into subclasses
Status: RESOLVED WONTFIX
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: Other All
: medium enhancement
Assignee: Noel Grandin
URL:
Whiteboard:
Keywords: difficultyInteresting, easyHack, skillCpp
Depends on:
Blocks:
 
Reported: 2015-04-08 13:29 UTC by Noel Grandin
Modified: 2021-11-05 12:58 UTC (History)
2 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 Noel Grandin 2015-04-08 13:29:11 UTC
So I started looking at converting the WinBits WB_* defines in

  include/tools/wintypes.hxx

to an 'enum class', and after a few changes and discovering that there are lots of WB_ macros scattered around that simply define a new WB_ value as pointing to an existing one e.g. in

  include/svtools/ivctrl.hxx
  #define WB_ICON         WB_RECTSTYLE
  #define WB_SMALLICON    WB_SMALLSTYLE

, I think that this whole thing needs a rethink.

Specifically, I think that

(*) we need to push these style things down to the subclass-specific level where each one applies, instead of multiplexing them into a single field at the root level

(*) we need to convert to using setter methods to turn them on and off

Further, I would suggest that

(*) the setter methods have the style

        MyWindowSubclass& MyWindowSubClass::SetFoo(bool b = true)

    so to make the code easier to write when setting multiple style flags i.e. we can then write

        MyWindowSubclass x();
        x.SetFoo().setBar();
Comment 1 Robinson Tryon (qubit) 2015-04-17 20:02:28 UTC
(In reply to Noel Grandin from comment #0)
> So I started looking at converting the WinBits WB_* defines in

Noel: What (if any) triage needs to happen here? Can we set this directly to NEW?

Status -> NEEDINFO
Comment 2 Robinson Tryon (qubit) 2015-12-14 05:02:04 UTC Comment hidden (obsolete)
Comment 3 Robinson Tryon (qubit) 2016-02-18 14:52:17 UTC Comment hidden (obsolete)
Comment 4 Noel Grandin 2021-11-05 12:58:22 UTC
This is too complicated to be an EasyHack, and looking at it now I don't see anything that is worth the effort anyhow