@@ -679,8 +679,8 @@ MidiMessage MidiMessage::textMetaEvent (int type, const StringRef& text) | |||||
const size_t headerLen = sizeof (header) - n; | const size_t headerLen = sizeof (header) - n; | ||||
uint8* const dest = result.allocateSpace (headerLen + textSize); | |||||
result.size = headerLen + textSize; | |||||
uint8* const dest = result.allocateSpace ((int) (headerLen + textSize)); | |||||
result.size = (int) (headerLen + textSize); | |||||
memcpy (dest, header + n, headerLen); | memcpy (dest, header + n, headerLen); | ||||
memcpy (dest + headerLen, text.text.getAddress(), textSize); | memcpy (dest + headerLen, text.text.getAddress(), textSize); | ||||
@@ -119,15 +119,18 @@ struct AutoResizingNSViewComponentWithParent : public AutoResizingNSViewCompone | |||||
{ | { | ||||
if (NSView* parent = (NSView*) getView()) | if (NSView* parent = (NSView*) getView()) | ||||
{ | { | ||||
if (NSView* child = [[parent subviews] objectAtIndex: 0]) | |||||
if ([[parent subviews] count] > 0) | |||||
{ | { | ||||
NSRect f = [parent frame]; | |||||
NSSize newSize = [child frame].size; | |||||
if (f.size.width != newSize.width || f.size.height != newSize.height) | |||||
if (NSView* child = [[parent subviews] objectAtIndex: 0]) | |||||
{ | { | ||||
f.size = newSize; | |||||
[parent setFrame: f]; | |||||
NSRect f = [parent frame]; | |||||
NSSize newSize = [child frame].size; | |||||
if (f.size.width != newSize.width || f.size.height != newSize.height) | |||||
{ | |||||
f.size = newSize; | |||||
[parent setFrame: f]; | |||||
} | |||||
} | } | ||||
} | } | ||||
} | } | ||||