diff --git a/modules/juce_graphics/colour/juce_ColourGradient.cpp b/modules/juce_graphics/colour/juce_ColourGradient.cpp index 635e63ac72..df015d3196 100644 --- a/modules/juce_graphics/colour/juce_ColourGradient.cpp +++ b/modules/juce_graphics/colour/juce_ColourGradient.cpp @@ -114,7 +114,7 @@ double ColourGradient::getColourPosition (const int index) const noexcept return 0; } -const Colour ColourGradient::getColour (const int index) const noexcept +Colour ColourGradient::getColour (const int index) const noexcept { if (isPositiveAndBelow (index, colours.size())) return colours.getReference (index).colour; diff --git a/modules/juce_graphics/colour/juce_ColourGradient.h b/modules/juce_graphics/colour/juce_ColourGradient.h index 809942a487..dd4caca78e 100644 --- a/modules/juce_graphics/colour/juce_ColourGradient.h +++ b/modules/juce_graphics/colour/juce_ColourGradient.h @@ -112,7 +112,7 @@ public: /** Returns the colour that was added with a given index. The index is from 0 to getNumColours() - 1. */ - const Colour getColour (int index) const noexcept; + Colour getColour (int index) const noexcept; /** Changes the colour at a given index. The index is from 0 to getNumColours() - 1. diff --git a/modules/juce_graphics/colour/juce_Colours.cpp b/modules/juce_graphics/colour/juce_Colours.cpp index 672e714fd9..a977b68546 100644 --- a/modules/juce_graphics/colour/juce_Colours.cpp +++ b/modules/juce_graphics/colour/juce_Colours.cpp @@ -168,8 +168,8 @@ const Colour Colours::yellow (0xffffff00); const Colour Colours::yellowgreen (0xff9acd32); //============================================================================== -const Colour Colours::findColourForName (const String& colourName, - const Colour& defaultColour) +Colour Colours::findColourForName (const String& colourName, + const Colour& defaultColour) { static const int presets[] = { diff --git a/modules/juce_graphics/colour/juce_Colours.h b/modules/juce_graphics/colour/juce_Colours.h index cc068b9260..5f3ee8150b 100644 --- a/modules/juce_graphics/colour/juce_Colours.h +++ b/modules/juce_graphics/colour/juce_Colours.h @@ -95,8 +95,8 @@ public: if a match is found, that colour is returned. If no match is found, the colour passed in as the defaultColour parameter is returned. */ - static JUCE_API const Colour findColourForName (const String& colourName, - const Colour& defaultColour); + static JUCE_API Colour findColourForName (const String& colourName, + const Colour& defaultColour); private: //============================================================================== diff --git a/modules/juce_graphics/images/juce_Image.cpp b/modules/juce_graphics/images/juce_Image.cpp index 39958d4ed2..452f08c707 100644 --- a/modules/juce_graphics/images/juce_Image.cpp +++ b/modules/juce_graphics/images/juce_Image.cpp @@ -373,7 +373,7 @@ Image::BitmapData::~BitmapData() { } -const Colour Image::BitmapData::getPixelColour (const int x, const int y) const noexcept +Colour Image::BitmapData::getPixelColour (const int x, const int y) const noexcept { jassert (isPositiveAndBelow (x, width) && isPositiveAndBelow (y, height)); diff --git a/modules/juce_graphics/images/juce_Image.h b/modules/juce_graphics/images/juce_Image.h index bc989c2937..84f084d340 100644 --- a/modules/juce_graphics/images/juce_Image.h +++ b/modules/juce_graphics/images/juce_Image.h @@ -338,7 +338,7 @@ public: For performance reasons, this won't do any bounds-checking on the coordinates, so it's the caller's repsonsibility to make sure they're within the image's size. */ - const Colour getPixelColour (int x, int y) const noexcept; + Colour getPixelColour (int x, int y) const noexcept; /** Sets the colour of a given pixel. For performance reasons, this won't do any bounds-checking on the coordinates, so it's the caller's diff --git a/modules/juce_gui_basics/components/juce_Component.cpp b/modules/juce_gui_basics/components/juce_Component.cpp index 0a11b9b62a..88c96508e4 100644 --- a/modules/juce_gui_basics/components/juce_Component.cpp +++ b/modules/juce_gui_basics/components/juce_Component.cpp @@ -2071,7 +2071,7 @@ void Component::sendLookAndFeelChange() } } -const Colour Component::findColour (const int colourId, const bool inheritFromParent) const +Colour Component::findColour (const int colourId, const bool inheritFromParent) const { const var* const v = properties.getVarPointer (ComponentHelpers::getColourPropertyId (colourId)); diff --git a/modules/juce_gui_basics/components/juce_Component.h b/modules/juce_gui_basics/components/juce_Component.h index ad55829d7d..5d766fd226 100644 --- a/modules/juce_gui_basics/components/juce_Component.h +++ b/modules/juce_gui_basics/components/juce_Component.h @@ -2061,7 +2061,7 @@ public: @see setColour, isColourSpecified, colourChanged, LookAndFeel::findColour, LookAndFeel::setColour */ - const Colour findColour (int colourId, bool inheritFromParent = false) const; + Colour findColour (int colourId, bool inheritFromParent = false) const; /** Registers a colour to be used for a particular purpose. diff --git a/modules/juce_gui_basics/drawables/juce_DrawableImage.cpp b/modules/juce_gui_basics/drawables/juce_DrawableImage.cpp index 1826d075ce..0464b1fbec 100644 --- a/modules/juce_gui_basics/drawables/juce_DrawableImage.cpp +++ b/modules/juce_gui_basics/drawables/juce_DrawableImage.cpp @@ -203,7 +203,7 @@ void DrawableImage::ValueTreeWrapper::setOpacity (float newOpacity, UndoManager* state.setProperty (opacity, newOpacity, undoManager); } -const Colour DrawableImage::ValueTreeWrapper::getOverlayColour() const +Colour DrawableImage::ValueTreeWrapper::getOverlayColour() const { return Colour::fromString (state [overlay].toString()); } diff --git a/modules/juce_gui_basics/drawables/juce_DrawableImage.h b/modules/juce_gui_basics/drawables/juce_DrawableImage.h index 2e800e1fa7..f1aa98f3a8 100644 --- a/modules/juce_gui_basics/drawables/juce_DrawableImage.h +++ b/modules/juce_gui_basics/drawables/juce_DrawableImage.h @@ -113,7 +113,7 @@ public: void setOpacity (float newOpacity, UndoManager* undoManager); Value getOpacityValue (UndoManager* undoManager); - const Colour getOverlayColour() const; + Colour getOverlayColour() const; void setOverlayColour (const Colour& newColour, UndoManager* undoManager); Value getOverlayColourValue (UndoManager* undoManager); diff --git a/modules/juce_gui_basics/drawables/juce_SVGParser.cpp b/modules/juce_gui_basics/drawables/juce_SVGParser.cpp index 9b05821a33..61f3a9ca52 100644 --- a/modules/juce_gui_basics/drawables/juce_SVGParser.cpp +++ b/modules/juce_gui_basics/drawables/juce_SVGParser.cpp @@ -1070,7 +1070,7 @@ private: } //============================================================================== - static const Colour parseColour (const String& s, int& index, const Colour& defaultColour) + static Colour parseColour (const String& s, int& index, const Colour& defaultColour) { if (s [index] == '#') { diff --git a/modules/juce_gui_basics/layout/juce_TabbedButtonBar.cpp b/modules/juce_gui_basics/layout/juce_TabbedButtonBar.cpp index eb79a84152..ce31dbc621 100644 --- a/modules/juce_gui_basics/layout/juce_TabbedButtonBar.cpp +++ b/modules/juce_gui_basics/layout/juce_TabbedButtonBar.cpp @@ -450,7 +450,7 @@ void TabbedButtonBar::resized() } //============================================================================== -const Colour TabbedButtonBar::getTabBackgroundColour (const int tabIndex) +Colour TabbedButtonBar::getTabBackgroundColour (const int tabIndex) { TabInfo* const tab = tabs [tabIndex]; return tab == nullptr ? Colours::white : tab->colour; diff --git a/modules/juce_gui_basics/layout/juce_TabbedButtonBar.h b/modules/juce_gui_basics/layout/juce_TabbedButtonBar.h index 9cb41f0aeb..555fd27192 100644 --- a/modules/juce_gui_basics/layout/juce_TabbedButtonBar.h +++ b/modules/juce_gui_basics/layout/juce_TabbedButtonBar.h @@ -234,7 +234,7 @@ public: This is the colour that was specified in addTab(). */ - const Colour getTabBackgroundColour (int tabIndex); + Colour getTabBackgroundColour (int tabIndex); /** Changes the background colour of a tab. diff --git a/modules/juce_gui_basics/layout/juce_TabbedComponent.cpp b/modules/juce_gui_basics/layout/juce_TabbedComponent.cpp index ca4769c98c..faac202dd3 100644 --- a/modules/juce_gui_basics/layout/juce_TabbedComponent.cpp +++ b/modules/juce_gui_basics/layout/juce_TabbedComponent.cpp @@ -72,7 +72,7 @@ public: owner.popupMenuClickOnTab (tabIndex, tabName); } - const Colour getTabBackgroundColour (const int tabIndex) + Colour getTabBackgroundColour (const int tabIndex) { return owner.tabs->getTabBackgroundColour (tabIndex); } @@ -192,7 +192,7 @@ Component* TabbedComponent::getTabContentComponent (const int tabIndex) const no return contentComponents [tabIndex]; } -const Colour TabbedComponent::getTabBackgroundColour (const int tabIndex) const noexcept +Colour TabbedComponent::getTabBackgroundColour (const int tabIndex) const noexcept { return tabs->getTabBackgroundColour (tabIndex); } diff --git a/modules/juce_gui_basics/layout/juce_TabbedComponent.h b/modules/juce_gui_basics/layout/juce_TabbedComponent.h index 1938f14d1a..67b48c7000 100644 --- a/modules/juce_gui_basics/layout/juce_TabbedComponent.h +++ b/modules/juce_gui_basics/layout/juce_TabbedComponent.h @@ -138,7 +138,7 @@ public: Component* getTabContentComponent (int tabIndex) const noexcept; /** Returns the colour of one of the tabs. */ - const Colour getTabBackgroundColour (int tabIndex) const noexcept; + Colour getTabBackgroundColour (int tabIndex) const noexcept; /** Changes the background colour of one of the tabs. */ void setTabBackgroundColour (int tabIndex, const Colour& newColour); diff --git a/modules/juce_gui_basics/layout/juce_Viewport.cpp b/modules/juce_gui_basics/layout/juce_Viewport.cpp index 0d1942cf0b..de38ff26e4 100644 --- a/modules/juce_gui_basics/layout/juce_Viewport.cpp +++ b/modules/juce_gui_basics/layout/juce_Viewport.cpp @@ -63,6 +63,9 @@ void Viewport::viewedComponentChanged (Component*) {} //============================================================================== void Viewport::deleteContentComp() { + if (contentComp != nullptr) + contentComp->removeComponentListener (this); + if (deleteContent) { // This sets the content comp to a null pointer before deleting the old one, in case diff --git a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel.cpp b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel.cpp index 1c4f4bab7d..acf5d8013d 100644 --- a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel.cpp +++ b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel.cpp @@ -268,7 +268,7 @@ LookAndFeel::~LookAndFeel() } //============================================================================== -const Colour LookAndFeel::findColour (const int colourId) const noexcept +Colour LookAndFeel::findColour (const int colourId) const noexcept { const int index = colourIds.indexOf (colourId); diff --git a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel.h b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel.h index 622f99d899..d7367d3442 100644 --- a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel.h +++ b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel.h @@ -111,7 +111,7 @@ public: @see setColour, Component::findColour, Component::setColour */ - const Colour findColour (int colourId) const noexcept; + Colour findColour (int colourId) const noexcept; /** Registers a colour to be used for a particular purpose. diff --git a/modules/juce_gui_basics/windows/juce_ResizableWindow.cpp b/modules/juce_gui_basics/windows/juce_ResizableWindow.cpp index c01f57f216..700c8ab52a 100644 --- a/modules/juce_gui_basics/windows/juce_ResizableWindow.cpp +++ b/modules/juce_gui_basics/windows/juce_ResizableWindow.cpp @@ -402,7 +402,7 @@ void ResizableWindow::lookAndFeelChanged() } } -const Colour ResizableWindow::getBackgroundColour() const noexcept +Colour ResizableWindow::getBackgroundColour() const noexcept { return findColour (backgroundColourId, false); } diff --git a/modules/juce_gui_basics/windows/juce_ResizableWindow.h b/modules/juce_gui_basics/windows/juce_ResizableWindow.h index 0644294352..9996b1b453 100644 --- a/modules/juce_gui_basics/windows/juce_ResizableWindow.h +++ b/modules/juce_gui_basics/windows/juce_ResizableWindow.h @@ -94,7 +94,7 @@ public: @see setBackgroundColour */ - const Colour getBackgroundColour() const noexcept; + Colour getBackgroundColour() const noexcept; /** Changes the colour currently being used for the window's background. diff --git a/modules/juce_gui_extra/code_editor/juce_CodeEditorComponent.cpp b/modules/juce_gui_extra/code_editor/juce_CodeEditorComponent.cpp index f678ee3561..6d5bfb4832 100644 --- a/modules/juce_gui_extra/code_editor/juce_CodeEditorComponent.cpp +++ b/modules/juce_gui_extra/code_editor/juce_CodeEditorComponent.cpp @@ -1109,7 +1109,7 @@ void CodeEditorComponent::setColourForTokenType (const int tokenType, const Colo repaint(); } -const Colour CodeEditorComponent::getColourForTokenType (const int tokenType) const +Colour CodeEditorComponent::getColourForTokenType (const int tokenType) const { if (! isPositiveAndBelow (tokenType, coloursForTokenCategories.size())) return findColour (CodeEditorComponent::defaultTextColourId); diff --git a/modules/juce_gui_extra/code_editor/juce_CodeEditorComponent.h b/modules/juce_gui_extra/code_editor/juce_CodeEditorComponent.h index 82f74ceb4e..f7beefc58a 100644 --- a/modules/juce_gui_extra/code_editor/juce_CodeEditorComponent.h +++ b/modules/juce_gui_extra/code_editor/juce_CodeEditorComponent.h @@ -191,7 +191,7 @@ public: CodeTokeniser::getTokenTypes() to get a list of the token types. @see setColourForTokenType */ - const Colour getColourForTokenType (int tokenType) const; + Colour getColourForTokenType (int tokenType) const; //============================================================================== /** A set of colour IDs to use to change the colour of various aspects of the editor.