diff --git a/extras/Projucer/Source/ComponentEditor/jucer_JucerDocument.cpp b/extras/Projucer/Source/ComponentEditor/jucer_JucerDocument.cpp index 261691d608..5540ad09ea 100644 --- a/extras/Projucer/Source/ComponentEditor/jucer_JucerDocument.cpp +++ b/extras/Projucer/Source/ComponentEditor/jucer_JucerDocument.cpp @@ -171,7 +171,7 @@ void JucerDocument::setParentClasses (const String& classes) type = s = String(); } - s = type + CodeHelpers::makeValidIdentifier (s.trim(), false, false, true); + s = type + CodeHelpers::makeValidIdentifier (s.trim(), false, false, true, true); parentClassLines.set (i, s); } diff --git a/extras/Projucer/Source/Utility/jucer_CodeHelpers.cpp b/extras/Projucer/Source/Utility/jucer_CodeHelpers.cpp index a465a9e004..a540b291f3 100644 --- a/extras/Projucer/Source/Utility/jucer_CodeHelpers.cpp +++ b/extras/Projucer/Source/Utility/jucer_CodeHelpers.cpp @@ -69,7 +69,7 @@ namespace CodeHelpers return lines.joinIntoString (newLine); } - String makeValidIdentifier (String s, bool capitalise, bool removeColons, bool allowTemplates) + String makeValidIdentifier (String s, bool capitalise, bool removeColons, bool allowTemplates, bool allowAsterisks) { if (s.isEmpty()) return "unknown"; @@ -93,6 +93,9 @@ namespace CodeHelpers if (! removeColons) allowedChars += ":"; + if (allowAsterisks) + allowedChars += "*"; + StringArray words; words.addTokens (s.retainCharacters (allowedChars), false); words.trim(); diff --git a/extras/Projucer/Source/Utility/jucer_CodeHelpers.h b/extras/Projucer/Source/Utility/jucer_CodeHelpers.h index 5efa7aa737..537c336f05 100644 --- a/extras/Projucer/Source/Utility/jucer_CodeHelpers.h +++ b/extras/Projucer/Source/Utility/jucer_CodeHelpers.h @@ -32,7 +32,8 @@ namespace CodeHelpers { String indent (const String& code, int numSpaces, bool indentFirstLine); String unindent (const String& code, int numSpaces); - String makeValidIdentifier (String s, bool capitalise, bool removeColons, bool allowTemplates); + String makeValidIdentifier (String s, bool capitalise, bool removeColons, + bool allowTemplates, bool allowAsterisks = false); String createIncludeStatement (const File& includedFile, const File& targetFile); String createIncludeStatement (const String& includePath); String makeHeaderGuardName (const File& file);