From 152ec5103367d6d5e2c77ab180e9e432b58deac7 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 19 Nov 2020 16:34:17 +0100 Subject: [PATCH] Add missing wxUSE_XXX checks to persistent adapters headers Make sure these headers can be compiled even when the control they're written for is not available in the build. Including them in this case doesn't make much sense, of course, but not giving any errors is still nicer and consistent with the rest of wx headers. --- include/wx/persist/bookctrl.h | 4 ++++ include/wx/persist/combobox.h | 4 ++++ include/wx/persist/dataview.h | 4 ++++ include/wx/persist/treebook.h | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/include/wx/persist/bookctrl.h b/include/wx/persist/bookctrl.h index cf3397e3ed..f6370cc973 100644 --- a/include/wx/persist/bookctrl.h +++ b/include/wx/persist/bookctrl.h @@ -12,6 +12,8 @@ #include "wx/persist/window.h" +#if wxUSE_BOOKCTRL + #include "wx/bookctrl.h" // ---------------------------------------------------------------------------- @@ -63,4 +65,6 @@ inline wxPersistentObject *wxCreatePersistentObject(wxBookCtrlBase *book) return new wxPersistentBookCtrl(book); } +#endif // wxUSE_BOOKCTRL + #endif // _WX_PERSIST_BOOKCTRL_H_ diff --git a/include/wx/persist/combobox.h b/include/wx/persist/combobox.h index 52efe25474..1f69d1fa03 100644 --- a/include/wx/persist/combobox.h +++ b/include/wx/persist/combobox.h @@ -12,6 +12,8 @@ #include "wx/persist/window.h" +#if wxUSE_COMBOBOX + #include "wx/combobox.h" #define wxPERSIST_COMBOBOX_KIND wxASCII_STR("Combobox") @@ -96,4 +98,6 @@ inline wxPersistentObject *wxCreatePersistentObject(wxComboBox* combobox) return new wxPersistentComboBox(combobox); } +#endif // wxUSE_COMBOBOX + #endif // _WX_PERSIST_COMBOBOX_H_ diff --git a/include/wx/persist/dataview.h b/include/wx/persist/dataview.h index e673eedac6..fe6dac1490 100644 --- a/include/wx/persist/dataview.h +++ b/include/wx/persist/dataview.h @@ -12,6 +12,8 @@ #include "wx/persist/window.h" +#if wxUSE_DATAVIEWCTRL + #include "wx/dataview.h" // ---------------------------------------------------------------------------- @@ -168,4 +170,6 @@ inline wxPersistentObject *wxCreatePersistentObject(wxDataViewCtrl* control) return new wxPersistentDataViewCtrl(control); } +#endif // wxUSE_DATAVIEWCTRL + #endif // _WX_PERSIST_DATAVIEW_H_ diff --git a/include/wx/persist/treebook.h b/include/wx/persist/treebook.h index 379447fdab..c7b4cf002b 100644 --- a/include/wx/persist/treebook.h +++ b/include/wx/persist/treebook.h @@ -12,6 +12,8 @@ #include "wx/persist/bookctrl.h" +#if wxUSE_TREEBOOK + #include "wx/arrstr.h" #include "wx/treebook.h" @@ -93,4 +95,6 @@ inline wxPersistentObject *wxCreatePersistentObject(wxTreebook *book) return new wxPersistentTreeBookCtrl(book); } +#endif // wxUSE_TREEBOOK + #endif // _WX_PERSIST_TREEBOOK_H_