diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2022-05-24 18:14:16 +0200 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2022-05-25 08:45:08 +0200 |
commit | 27fb97fbfe3da858cefb830614c90a496dfe3ad6 (patch) | |
tree | fece4cbea044e5b74f9355d27bc7a5db7fd06d1f /include/vcl/sysdata.hxx | |
parent | 7bf9629d4f3e8504b5d09685d7721275b3287443 (diff) |
VCL SysEnvData: add Invalid Platform and Toolkit
I accidently almost introduced some subtle sytactic error in Qt,
because the default platform and toolkit values are actually valid.
So add an Invalid value to both enum classes and then sprinkle
some asserts, so these tests aren't working on invalid data.
Thanks Michael Weghorn for catching this in review.
Change-Id: Ic6a0764dfc5168181251023f4d1c66ffa32651d8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134882
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'include/vcl/sysdata.hxx')
-rw-r--r-- | include/vcl/sysdata.hxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/vcl/sysdata.hxx b/include/vcl/sysdata.hxx index 00cd5142c2e3..07ddea45dae3 100644 --- a/include/vcl/sysdata.hxx +++ b/include/vcl/sysdata.hxx @@ -50,7 +50,7 @@ typedef struct CGContext *CGContextRef; struct VCL_DLLPUBLIC SystemEnvData { - enum class Toolkit { Gen, Gtk, Qt }; + enum class Toolkit { Invalid, Gen, Gtk, Qt }; Toolkit toolkit; // the toolkit in use #if defined(_WIN32) HWND hWnd; // the window hwnd @@ -62,7 +62,7 @@ struct VCL_DLLPUBLIC SystemEnvData #elif defined( IOS ) // Nothing #elif defined( UNX ) - enum class Platform { Wayland, Xcb, WASM }; + enum class Platform { Invalid, Wayland, Xcb, WASM }; void* pDisplay; // the relevant display connection SalFrame* pSalFrame; // contains a salframe, if object has one @@ -89,7 +89,7 @@ public: #endif SystemEnvData() - : toolkit(Toolkit::Gen) + : toolkit(Toolkit::Invalid) #if defined(_WIN32) , hWnd(nullptr) #elif defined( MACOSX ) @@ -104,7 +104,7 @@ public: , pVisual(nullptr) , nScreen(0) , aShellWindow(0) - , platform(Platform()) + , platform(Platform::Invalid) , aWindow(0) #endif { |