diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index e859db6490..4977aadc28 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -13454,10 +13454,8 @@ const String String::createStringFromData (const void* const data_, const int si { return charToString ((char) data[0]); } - else if ((data[0] == (uint8) CharPointer_UTF16::byteOrderMarkBE1 - && data[1] == (uint8) CharPointer_UTF16::byteOrderMarkBE2) - || (data[0] == (uint8) CharPointer_UTF16::byteOrderMarkLE1 - && data[1] == (uint8) CharPointer_UTF16::byteOrderMarkLE1)) + else if ((data[0] == (uint8) CharPointer_UTF16::byteOrderMarkBE1 && data[1] == (uint8) CharPointer_UTF16::byteOrderMarkBE2) + || (data[0] == (uint8) CharPointer_UTF16::byteOrderMarkLE1 && data[1] == (uint8) CharPointer_UTF16::byteOrderMarkLE2)) { const bool bigEndian = (data[0] == (uint8) CharPointer_UTF16::byteOrderMarkBE1); const int numChars = size / 2 - 1; @@ -85124,7 +85122,6 @@ public: ClipRegion_EdgeTable (const RectangleList& r) : edgeTable (r) {} ClipRegion_EdgeTable (const Rectangle& bounds, const Path& p, const AffineTransform& t) : edgeTable (bounds, p, t) {} ClipRegion_EdgeTable (const ClipRegion_EdgeTable& other) : edgeTable (other.edgeTable) {} - ~ClipRegion_EdgeTable() {} const Ptr clone() const { @@ -85328,7 +85325,6 @@ public: ClipRegion_RectangleList (const Rectangle& r) : clip (r) {} ClipRegion_RectangleList (const RectangleList& r) : clip (r) {} ClipRegion_RectangleList (const ClipRegion_RectangleList& other) : clip (other.clip) {} - ~ClipRegion_RectangleList() {} const Ptr clone() const { @@ -85625,14 +85621,9 @@ private: { r.setEdgeTableYPos (totalTop); - if (doLeftAlpha) - r.handleEdgeTablePixel (totalLeft, (leftAlpha * topAlpha) >> 8); - - if (clippedWidth > 0) - r.handleEdgeTableLine (clippedLeft, clippedWidth, topAlpha); - - if (doRightAlpha) - r.handleEdgeTablePixel (right, (rightAlpha * topAlpha) >> 8); + if (doLeftAlpha) r.handleEdgeTablePixel (totalLeft, (leftAlpha * topAlpha) >> 8); + if (clippedWidth > 0) r.handleEdgeTableLine (clippedLeft, clippedWidth, topAlpha); + if (doRightAlpha) r.handleEdgeTablePixel (right, (rightAlpha * topAlpha) >> 8); } const int endY = jmin (bottom, clipBottom); @@ -85640,28 +85631,18 @@ private: { r.setEdgeTableYPos (y); - if (doLeftAlpha) - r.handleEdgeTablePixel (totalLeft, leftAlpha); - - if (clippedWidth > 0) - r.handleEdgeTableLineFull (clippedLeft, clippedWidth); - - if (doRightAlpha) - r.handleEdgeTablePixel (right, rightAlpha); + if (doLeftAlpha) r.handleEdgeTablePixel (totalLeft, leftAlpha); + if (clippedWidth > 0) r.handleEdgeTableLineFull (clippedLeft, clippedWidth); + if (doRightAlpha) r.handleEdgeTablePixel (right, rightAlpha); } if (bottomAlpha != 0 && bottom < clipBottom) { r.setEdgeTableYPos (bottom); - if (doLeftAlpha) - r.handleEdgeTablePixel (totalLeft, (leftAlpha * bottomAlpha) >> 8); - - if (clippedWidth > 0) - r.handleEdgeTableLine (clippedLeft, clippedWidth, bottomAlpha); - - if (doRightAlpha) - r.handleEdgeTablePixel (right, (rightAlpha * bottomAlpha) >> 8); + if (doLeftAlpha) r.handleEdgeTablePixel (totalLeft, (leftAlpha * bottomAlpha) >> 8); + if (clippedWidth > 0) r.handleEdgeTableLine (clippedLeft, clippedWidth, bottomAlpha); + if (doRightAlpha) r.handleEdgeTablePixel (right, (rightAlpha * bottomAlpha) >> 8); } } } @@ -248422,9 +248403,7 @@ void Desktop::setKioskComponent (Component* kioskModeComponent, bool enableOrDis static BOOL CALLBACK enumMonitorsProc (HMONITOR, HDC, LPRECT r, LPARAM userInfo) { Array >* const monitorCoords = (Array >*) userInfo; - monitorCoords->add (Rectangle (r->left, r->top, r->right - r->left, r->bottom - r->top)); - return TRUE; } diff --git a/juce_amalgamated.h b/juce_amalgamated.h index 7d6e7be965..f2f8af84b7 100644 --- a/juce_amalgamated.h +++ b/juce_amalgamated.h @@ -73,7 +73,7 @@ namespace JuceDummyNamespace {} */ #define JUCE_MAJOR_VERSION 1 #define JUCE_MINOR_VERSION 53 -#define JUCE_BUILDNUMBER 51 +#define JUCE_BUILDNUMBER 52 /** Current Juce version number. @@ -7113,13 +7113,16 @@ public: @param comparator the comparator to use to compare the elements - see the sort() method for details about the form this object should take @param newElement the new element to insert to the array + @returns the index at which the new item was added @see addUsingDefaultSort, add, sort */ template - void addSorted (ElementComparator& comparator, ParameterType newElement) + int addSorted (ElementComparator& comparator, ParameterType newElement) { const ScopedLockType lock (getLock()); - insert (findInsertIndexInSortedArray (comparator, data.elements.getData(), newElement, 0, numUsed), newElement); + const int index = findInsertIndexInSortedArray (comparator, data.elements.getData(), newElement, 0, numUsed); + insert (index, newElement); + return index; } /** Inserts a new element into the array, assuming that the array is sorted. @@ -9697,16 +9700,18 @@ public: @param comparator the comparator to use to compare the elements - see the sort method for details about this object's structure @param newObject the new object to insert to the array + @returns the index at which the new object was added @see add, sort, indexOfSorted */ template - void addSorted (ElementComparator& comparator, - ObjectClass* const newObject) throw() + int addSorted (ElementComparator& comparator, ObjectClass* const newObject) throw() { (void) comparator; // if you pass in an object with a static compareElements() method, this // avoids getting warning messages about the parameter being unused const ScopedLockType lock (getLock()); - insert (findInsertIndexInSortedArray (comparator, data.elements.getData(), newObject, 0, numUsed), newObject); + const int index = findInsertIndexInSortedArray (comparator, data.elements.getData(), newObject, 0, numUsed); + insert (index, newObject); + return index; } /** Finds the index of an object in the array, assuming that the array is sorted. @@ -13302,17 +13307,19 @@ public: should go. If the array isn't sorted, the behaviour of this method will be unpredictable. - @param comparator the comparator object to use to compare the elements - see the - sort() method for details about this object's form + @param comparator the comparator object to use to compare the elements - see the + sort() method for details about this object's form @param newObject the new object to insert to the array + @returns the index at which the new object was added @see add, sort */ template - void addSorted (ElementComparator& comparator, - ObjectClass* newObject) throw() + int addSorted (ElementComparator& comparator, ObjectClass* newObject) throw() { const ScopedLockType lock (getLock()); - insert (findInsertIndexInSortedArray (comparator, data.elements.getData(), newObject, 0, numUsed), newObject); + const int index = findInsertIndexInSortedArray (comparator, data.elements.getData(), newObject, 0, numUsed); + insert (index, newObject); + return index; } /** Inserts or replaces an object in the array, assuming it is sorted. diff --git a/src/containers/juce_Array.h b/src/containers/juce_Array.h index c7b939aa0b..231d450bdd 100644 --- a/src/containers/juce_Array.h +++ b/src/containers/juce_Array.h @@ -589,13 +589,16 @@ public: @param comparator the comparator to use to compare the elements - see the sort() method for details about the form this object should take @param newElement the new element to insert to the array + @returns the index at which the new item was added @see addUsingDefaultSort, add, sort */ template - void addSorted (ElementComparator& comparator, ParameterType newElement) + int addSorted (ElementComparator& comparator, ParameterType newElement) { const ScopedLockType lock (getLock()); - insert (findInsertIndexInSortedArray (comparator, data.elements.getData(), newElement, 0, numUsed), newElement); + const int index = findInsertIndexInSortedArray (comparator, data.elements.getData(), newElement, 0, numUsed); + insert (index, newElement); + return index; } /** Inserts a new element into the array, assuming that the array is sorted. diff --git a/src/containers/juce_OwnedArray.h b/src/containers/juce_OwnedArray.h index a60498b6a6..80c11a1af3 100644 --- a/src/containers/juce_OwnedArray.h +++ b/src/containers/juce_OwnedArray.h @@ -411,16 +411,18 @@ public: @param comparator the comparator to use to compare the elements - see the sort method for details about this object's structure @param newObject the new object to insert to the array + @returns the index at which the new object was added @see add, sort, indexOfSorted */ template - void addSorted (ElementComparator& comparator, - ObjectClass* const newObject) throw() + int addSorted (ElementComparator& comparator, ObjectClass* const newObject) throw() { (void) comparator; // if you pass in an object with a static compareElements() method, this // avoids getting warning messages about the parameter being unused const ScopedLockType lock (getLock()); - insert (findInsertIndexInSortedArray (comparator, data.elements.getData(), newObject, 0, numUsed), newObject); + const int index = findInsertIndexInSortedArray (comparator, data.elements.getData(), newObject, 0, numUsed); + insert (index, newObject); + return index; } /** Finds the index of an object in the array, assuming that the array is sorted. diff --git a/src/containers/juce_ReferenceCountedArray.h b/src/containers/juce_ReferenceCountedArray.h index 7ce16de19c..ed7d638a45 100644 --- a/src/containers/juce_ReferenceCountedArray.h +++ b/src/containers/juce_ReferenceCountedArray.h @@ -371,17 +371,19 @@ public: should go. If the array isn't sorted, the behaviour of this method will be unpredictable. - @param comparator the comparator object to use to compare the elements - see the - sort() method for details about this object's form - @param newObject the new object to insert to the array + @param comparator the comparator object to use to compare the elements - see the + sort() method for details about this object's form + @param newObject the new object to insert to the array + @returns the index at which the new object was added @see add, sort */ template - void addSorted (ElementComparator& comparator, - ObjectClass* newObject) throw() + int addSorted (ElementComparator& comparator, ObjectClass* newObject) throw() { const ScopedLockType lock (getLock()); - insert (findInsertIndexInSortedArray (comparator, data.elements.getData(), newObject, 0, numUsed), newObject); + const int index = findInsertIndexInSortedArray (comparator, data.elements.getData(), newObject, 0, numUsed); + insert (index, newObject); + return index; } /** Inserts or replaces an object in the array, assuming it is sorted. diff --git a/src/core/juce_StandardHeader.h b/src/core/juce_StandardHeader.h index 686d4373da..1a84e93ce4 100644 --- a/src/core/juce_StandardHeader.h +++ b/src/core/juce_StandardHeader.h @@ -33,7 +33,7 @@ */ #define JUCE_MAJOR_VERSION 1 #define JUCE_MINOR_VERSION 53 -#define JUCE_BUILDNUMBER 51 +#define JUCE_BUILDNUMBER 52 /** Current Juce version number. diff --git a/src/gui/graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp b/src/gui/graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp index ff2e99bb57..3bd06d6e51 100644 --- a/src/gui/graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp +++ b/src/gui/graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp @@ -1225,7 +1225,6 @@ public: ClipRegion_EdgeTable (const RectangleList& r) : edgeTable (r) {} ClipRegion_EdgeTable (const Rectangle& bounds, const Path& p, const AffineTransform& t) : edgeTable (bounds, p, t) {} ClipRegion_EdgeTable (const ClipRegion_EdgeTable& other) : edgeTable (other.edgeTable) {} - ~ClipRegion_EdgeTable() {} const Ptr clone() const { @@ -1431,7 +1430,6 @@ public: ClipRegion_RectangleList (const Rectangle& r) : clip (r) {} ClipRegion_RectangleList (const RectangleList& r) : clip (r) {} ClipRegion_RectangleList (const ClipRegion_RectangleList& other) : clip (other.clip) {} - ~ClipRegion_RectangleList() {} const Ptr clone() const { @@ -1730,14 +1728,9 @@ private: { r.setEdgeTableYPos (totalTop); - if (doLeftAlpha) - r.handleEdgeTablePixel (totalLeft, (leftAlpha * topAlpha) >> 8); - - if (clippedWidth > 0) - r.handleEdgeTableLine (clippedLeft, clippedWidth, topAlpha); - - if (doRightAlpha) - r.handleEdgeTablePixel (right, (rightAlpha * topAlpha) >> 8); + if (doLeftAlpha) r.handleEdgeTablePixel (totalLeft, (leftAlpha * topAlpha) >> 8); + if (clippedWidth > 0) r.handleEdgeTableLine (clippedLeft, clippedWidth, topAlpha); + if (doRightAlpha) r.handleEdgeTablePixel (right, (rightAlpha * topAlpha) >> 8); } const int endY = jmin (bottom, clipBottom); @@ -1745,28 +1738,18 @@ private: { r.setEdgeTableYPos (y); - if (doLeftAlpha) - r.handleEdgeTablePixel (totalLeft, leftAlpha); - - if (clippedWidth > 0) - r.handleEdgeTableLineFull (clippedLeft, clippedWidth); - - if (doRightAlpha) - r.handleEdgeTablePixel (right, rightAlpha); + if (doLeftAlpha) r.handleEdgeTablePixel (totalLeft, leftAlpha); + if (clippedWidth > 0) r.handleEdgeTableLineFull (clippedLeft, clippedWidth); + if (doRightAlpha) r.handleEdgeTablePixel (right, rightAlpha); } if (bottomAlpha != 0 && bottom < clipBottom) { r.setEdgeTableYPos (bottom); - if (doLeftAlpha) - r.handleEdgeTablePixel (totalLeft, (leftAlpha * bottomAlpha) >> 8); - - if (clippedWidth > 0) - r.handleEdgeTableLine (clippedLeft, clippedWidth, bottomAlpha); - - if (doRightAlpha) - r.handleEdgeTablePixel (right, (rightAlpha * bottomAlpha) >> 8); + if (doLeftAlpha) r.handleEdgeTablePixel (totalLeft, (leftAlpha * bottomAlpha) >> 8); + if (clippedWidth > 0) r.handleEdgeTableLine (clippedLeft, clippedWidth, bottomAlpha); + if (doRightAlpha) r.handleEdgeTablePixel (right, (rightAlpha * bottomAlpha) >> 8); } } } diff --git a/src/native/windows/juce_win32_Windowing.cpp b/src/native/windows/juce_win32_Windowing.cpp index 3bb893ad41..5bb169c919 100644 --- a/src/native/windows/juce_win32_Windowing.cpp +++ b/src/native/windows/juce_win32_Windowing.cpp @@ -2536,9 +2536,7 @@ void Desktop::setKioskComponent (Component* kioskModeComponent, bool enableOrDis static BOOL CALLBACK enumMonitorsProc (HMONITOR, HDC, LPRECT r, LPARAM userInfo) { Array >* const monitorCoords = (Array >*) userInfo; - monitorCoords->add (Rectangle (r->left, r->top, r->right - r->left, r->bottom - r->top)); - return TRUE; } diff --git a/src/text/juce_String.cpp b/src/text/juce_String.cpp index b6e231aa03..a5f93fb47d 100644 --- a/src/text/juce_String.cpp +++ b/src/text/juce_String.cpp @@ -2005,10 +2005,8 @@ const String String::createStringFromData (const void* const data_, const int si { return charToString ((char) data[0]); } - else if ((data[0] == (uint8) CharPointer_UTF16::byteOrderMarkBE1 - && data[1] == (uint8) CharPointer_UTF16::byteOrderMarkBE2) - || (data[0] == (uint8) CharPointer_UTF16::byteOrderMarkLE1 - && data[1] == (uint8) CharPointer_UTF16::byteOrderMarkLE1)) + else if ((data[0] == (uint8) CharPointer_UTF16::byteOrderMarkBE1 && data[1] == (uint8) CharPointer_UTF16::byteOrderMarkBE2) + || (data[0] == (uint8) CharPointer_UTF16::byteOrderMarkLE1 && data[1] == (uint8) CharPointer_UTF16::byteOrderMarkLE2)) { const bool bigEndian = (data[0] == (uint8) CharPointer_UTF16::byteOrderMarkBE1); const int numChars = size / 2 - 1;