From 8f8cbf13ba1391960611a6e43158772635d81420 Mon Sep 17 00:00:00 2001 From: Randalphwa <38287198+Randalphwa@users.noreply.github.com> Date: Sat, 2 Dec 2023 05:13:41 -0800 Subject: [PATCH 1/2] Change when to generation declaration/definition If there is an Image List file, then all wxue functions are in that file, and declared in the header file that is #included in the source file. If there is no Image List file, then either a declaration or definition must be generated. --- src/generate/gen_cpp.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/generate/gen_cpp.cpp b/src/generate/gen_cpp.cpp index 98025ddfd..127cb9376 100644 --- a/src/generate/gen_cpp.cpp +++ b/src/generate/gen_cpp.cpp @@ -611,7 +611,7 @@ void BaseCodeGenerator::GenerateCppClass(PANEL_PAGE panel_type) if (m_NeedImageFunction || m_NeedHeaderFunction) { - if (Project.getForm_Image() == m_form_node && !has_images_list_header) + if (!has_images_list_header) { tt_string_vector function; function.ReadString(Project.getForm_Image() == m_form_node ? txt_wxueImageFunction : @@ -637,7 +637,7 @@ void BaseCodeGenerator::GenerateCppClass(PANEL_PAGE panel_type) m_source->writeLine("#endif", indent::none); } - if (Project.getForm_BundleSVG() == m_form_node && !has_images_list_header) + if (!has_images_list_header) { tt_string_vector function; function.ReadString(Project.getForm_BundleSVG() == m_form_node ? txt_GetBundleFromSVG : @@ -652,7 +652,7 @@ void BaseCodeGenerator::GenerateCppClass(PANEL_PAGE panel_type) if (m_NeedAnimationFunction) { - if (Project.getForm_Animation() == m_form_node && !has_images_list_header) + if (!has_images_list_header) { tt_string_vector function; function.ReadString(Project.getForm_Animation() == m_form_node ? txt_GetAnimFromHdrFunction : From 6640795926de987ea71be81bcffd750b740b7396 Mon Sep 17 00:00:00 2001 From: Randalphwa <38287198+Randalphwa@users.noreply.github.com> Date: Sat, 2 Dec 2023 05:28:24 -0800 Subject: [PATCH 2/2] Fix problem caused by #1201 Because of this issue, any time this file is generated, it has to be manually reformatted with clang-format. --- src/ui/startup_dlg.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ui/startup_dlg.h b/src/ui/startup_dlg.h index d905c173b..71571bac9 100644 --- a/src/ui/startup_dlg.h +++ b/src/ui/startup_dlg.h @@ -56,8 +56,8 @@ class StartupDlg : public wxDialog // Code below this comment block will be preserved // if the code for this class is re-generated. // -// clang-format on -// *********************************************** + // clang-format on + // *********************************************** public: enum : size_t