mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-08-20 22:06:25 +08:00
wxColour ctor from NSColor added inb478f24288didn't work correctly as it didn't initialize wxColour::m_cgColour and so any attempts to use the colour created by it resulted in an immediate crash (so the code added in16671f229alikely didn't work neither). It also assumed that the NSColor given to it was always in the RGBA colorspace and crashed if it wasn't (so56ebe6dfacfixed compilation at the price of making the code crash at run-time). Now explicitly request the RGBA colorspace and leave the colour uninitialized, which is better than crashing, if it can't be obtained. After making this ctor safe to use, there is no reason to reproduce its logic in wxColourDialog and wxFontDialog, so just use it from there. Also make the ctor explicit as it's a non-trivial operation which shouldn't be performed implicitly and document that it doesn't take ownership of NSColor, unlike the similar ctor from CGColorRef.