From 67a9a76f245f77be16805e7bb40dc579d6441cce Mon Sep 17 00:00:00 2001 From: ed Date: Wed, 1 Jul 2020 09:36:42 +0100 Subject: [PATCH] Projucer: Fixed a bug causing GUI editor code written with older Projucer versions to be overwritten --- .../Components/jucer_ComponentTypeHandler.h | 8 +++++++- .../Source/ComponentEditor/jucer_JucerDocument.cpp | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/extras/Projucer/Source/ComponentEditor/Components/jucer_ComponentTypeHandler.h b/extras/Projucer/Source/ComponentEditor/Components/jucer_ComponentTypeHandler.h index ffd39ad387..ca295ae909 100644 --- a/extras/Projucer/Source/ComponentEditor/Components/jucer_ComponentTypeHandler.h +++ b/extras/Projucer/Source/ComponentEditor/Components/jucer_ComponentTypeHandler.h @@ -52,7 +52,13 @@ public: static ComponentTypeHandler* getHandlerFor (Component& component); //============================================================================== - virtual String getXmlTagName() const noexcept { return className.toUpperCase(); } + virtual String getXmlTagName() const noexcept + { + if (className.startsWith ("juce::")) + return className.substring (6).toUpperCase(); + + return className.toUpperCase(); + } static ComponentTypeHandler* getHandlerForXmlTag (const String& tagName); diff --git a/extras/Projucer/Source/ComponentEditor/jucer_JucerDocument.cpp b/extras/Projucer/Source/ComponentEditor/jucer_JucerDocument.cpp index 5193f61fdf..47357bf520 100644 --- a/extras/Projucer/Source/ComponentEditor/jucer_JucerDocument.cpp +++ b/extras/Projucer/Source/ComponentEditor/jucer_JucerDocument.cpp @@ -311,7 +311,8 @@ void JucerDocument::setOptionalMethodEnabled (const String& methodSignature, con bool JucerDocument::isOptionalMethodEnabled (const String& sig) const noexcept { - return activeExtraMethods.contains (sig); + return activeExtraMethods.contains (sig) + || activeExtraMethods.contains (sig.replace ("juce::", {})); } void JucerDocument::addExtraClassProperties (PropertyPanel&)