diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index 3de54bf052..86813a37a0 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -12263,6 +12263,11 @@ void StringArray::removeString (const String& stringToRemove, } } +void StringArray::removeRange (int startIndex, int numberToRemove) +{ + strings.removeRange (startIndex, numberToRemove); +} + void StringArray::removeEmptyStrings (const bool removeWhitespaceStrings) { if (removeWhitespaceStrings) @@ -15637,7 +15642,11 @@ ValueTree::SharedObject::SharedObject (const SharedObject& other) : type (other.type), properties (other.properties), parent (0) { for (int i = 0; i < other.children.size(); ++i) - children.add (new SharedObject (*other.children.getUnchecked(i))); + { + SharedObject* const child = new SharedObject (*other.children.getUnchecked(i)); + child->parent = this; + children.add (child); + } } ValueTree::SharedObject::~SharedObject() @@ -42977,6 +42986,7 @@ ToolbarButton::ToolbarButton (const int itemId_, normalImage (normalImage_), toggledOnImage (toggledOnImage_) { + jassert (normalImage_ != 0); } ToolbarButton::~ToolbarButton() @@ -210341,11 +210351,11 @@ png_write_filtered_row(png_structp png_ptr, png_bytep filtered_row) } #else - #define PNG_INTERNAL - #define PNG_SETJMP_NOT_SUPPORTED - - #include - #include + extern "C" + { + #include + #include + } #endif } diff --git a/juce_amalgamated.h b/juce_amalgamated.h index 4b051d99ed..9568a506b3 100644 --- a/juce_amalgamated.h +++ b/juce_amalgamated.h @@ -3424,7 +3424,7 @@ private: #define __JUCE_SCOPEDPOINTER_JUCEHEADER__ template -class JUCE_API ScopedPointer +class ScopedPointer { public: @@ -4032,6 +4032,8 @@ public: void removeString (const String& stringToRemove, bool ignoreCase = false); + void removeRange (int startIndex, int numberToRemove); + void removeDuplicates (bool ignoreCase); void removeEmptyStrings (bool removeWhitespaceStrings = true); diff --git a/src/containers/juce_ScopedPointer.h b/src/containers/juce_ScopedPointer.h index 1f4c21fdf2..642c10e2cb 100644 --- a/src/containers/juce_ScopedPointer.h +++ b/src/containers/juce_ScopedPointer.h @@ -41,11 +41,16 @@ to an object. If you use the assignment operator to assign a different object to a ScopedPointer, the old one will be automatically deleted. + A const ScopedPointer is guaranteed not to lose ownership of its object or change the + object to which it points during its lifetime. This means that making a copy of a const + ScopedPointer is impossible, as that would involve the new copy taking ownership from the + old one. + If you need to get a pointer out of a ScopedPointer without it being deleted, you can use the release() method. */ template -class JUCE_API ScopedPointer +class ScopedPointer { public: //============================================================================== diff --git a/src/containers/juce_ValueTree.cpp b/src/containers/juce_ValueTree.cpp index 0f7d1269b8..814773d79d 100644 --- a/src/containers/juce_ValueTree.cpp +++ b/src/containers/juce_ValueTree.cpp @@ -191,7 +191,11 @@ ValueTree::SharedObject::SharedObject (const SharedObject& other) : type (other.type), properties (other.properties), parent (0) { for (int i = 0; i < other.children.size(); ++i) - children.add (new SharedObject (*other.children.getUnchecked(i))); + { + SharedObject* const child = new SharedObject (*other.children.getUnchecked(i)); + child->parent = this; + children.add (child); + } } ValueTree::SharedObject::~SharedObject() diff --git a/src/gui/components/buttons/juce_ToolbarButton.cpp b/src/gui/components/buttons/juce_ToolbarButton.cpp index 52b8fbd137..bfbff44345 100644 --- a/src/gui/components/buttons/juce_ToolbarButton.cpp +++ b/src/gui/components/buttons/juce_ToolbarButton.cpp @@ -42,6 +42,7 @@ ToolbarButton::ToolbarButton (const int itemId_, normalImage (normalImage_), toggledOnImage (toggledOnImage_) { + jassert (normalImage_ != 0); } ToolbarButton::~ToolbarButton() diff --git a/src/gui/graphics/geometry/juce_Line.h b/src/gui/graphics/geometry/juce_Line.h index 11381e46dc..c559644113 100644 --- a/src/gui/graphics/geometry/juce_Line.h +++ b/src/gui/graphics/geometry/juce_Line.h @@ -36,6 +36,11 @@ This class contains a bunch of useful methods for various geometric tasks. + The ValueType template parameter should be a primitive type - float or double + are what it's designed for. Integer types will work in a basic way, but some methods + that perform mathematical operations may not compile, or they may not produce + sensible results. + @see Point, Rectangle, Path, Graphics::drawLine */ template diff --git a/src/gui/graphics/imaging/image_file_formats/juce_PNGLoader.cpp b/src/gui/graphics/imaging/image_file_formats/juce_PNGLoader.cpp index adfb6a9fb0..1eabe09dc7 100644 --- a/src/gui/graphics/imaging/image_file_formats/juce_PNGLoader.cpp +++ b/src/gui/graphics/imaging/image_file_formats/juce_PNGLoader.cpp @@ -82,11 +82,11 @@ namespace pnglibNamespace #include "pnglib/pngwutil.c" } #else - #define PNG_INTERNAL - #define PNG_SETJMP_NOT_SUPPORTED - - #include - #include + extern "C" + { + #include + #include + } #endif } diff --git a/src/text/juce_StringArray.cpp b/src/text/juce_StringArray.cpp index 917497c09b..7b5558709b 100644 --- a/src/text/juce_StringArray.cpp +++ b/src/text/juce_StringArray.cpp @@ -230,6 +230,11 @@ void StringArray::removeString (const String& stringToRemove, } } +void StringArray::removeRange (int startIndex, int numberToRemove) +{ + strings.removeRange (startIndex, numberToRemove); +} + //============================================================================== void StringArray::removeEmptyStrings (const bool removeWhitespaceStrings) { diff --git a/src/text/juce_StringArray.h b/src/text/juce_StringArray.h index e835b8b46e..48895d6762 100644 --- a/src/text/juce_StringArray.h +++ b/src/text/juce_StringArray.h @@ -227,6 +227,19 @@ public: void removeString (const String& stringToRemove, bool ignoreCase = false); + /** Removes a range of elements from the array. + + This will remove a set of elements, starting from the given index, + and move subsequent elements down to close the gap. + + If the range extends beyond the bounds of the array, it will + be safely clipped to the size of the array. + + @param startIndex the index of the first element to remove + @param numberToRemove how many elements should be removed + */ + void removeRange (int startIndex, int numberToRemove); + /** Removes any duplicated elements from the array. If any string appears in the array more than once, only the first occurrence of