mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-02-03 03:30:06 +00:00
Added Value support to the Button's toggle state and TextEditor content. Refactored the atomic operation functions to live inside a class called Atomic, and the byte order functions into a class called ByteOrder.
This commit is contained in:
parent
3ddbc82f9f
commit
18ffeba9da
64 changed files with 3721 additions and 3609 deletions
|
|
@ -117,21 +117,55 @@ const var& var::operator= (const var& valueToCopy) throw()
|
|||
{
|
||||
if (this != &valueToCopy)
|
||||
{
|
||||
if (type == stringType)
|
||||
delete value.stringValue;
|
||||
if (type == valueToCopy.type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case voidType:
|
||||
break;
|
||||
|
||||
DynamicObject* const oldObject = getObject();
|
||||
case intType:
|
||||
case boolType:
|
||||
case doubleType:
|
||||
value = valueToCopy.value;
|
||||
break;
|
||||
|
||||
type = valueToCopy.type;
|
||||
value = valueToCopy.value;
|
||||
case stringType:
|
||||
*(value.stringValue) = *(valueToCopy.value.stringValue);
|
||||
break;
|
||||
|
||||
if (type == stringType)
|
||||
value.stringValue = new String (*(value.stringValue));
|
||||
else if (type == objectType && value.objectValue != 0)
|
||||
value.objectValue->incReferenceCount();
|
||||
case objectType:
|
||||
if (valueToCopy.value.objectValue != 0)
|
||||
valueToCopy.value.objectValue->incReferenceCount();
|
||||
|
||||
if (oldObject != 0)
|
||||
oldObject->decReferenceCount();
|
||||
if (value.objectValue != 0)
|
||||
value.objectValue->decReferenceCount();
|
||||
|
||||
value.objectValue = valueToCopy.value.objectValue;
|
||||
break;
|
||||
|
||||
default:
|
||||
jassertfalse;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
releaseValue();
|
||||
type = valueToCopy.type;
|
||||
|
||||
if (type == stringType)
|
||||
{
|
||||
value.stringValue = new String (*(valueToCopy.value.stringValue));
|
||||
}
|
||||
else
|
||||
{
|
||||
value = valueToCopy.value;
|
||||
|
||||
if (type == objectType && value.objectValue != 0)
|
||||
value.objectValue->incReferenceCount();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return *this;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue