Skip to content

Commit

Permalink
ecere/ide: Fixed DataBox::SetData to use any_object data type; Fixed …
Browse files Browse the repository at this point in the history
…IDE's property sheet to reflect data passed being of any_object data type (Fix for hotkey crash reported by Sam on forums)
  • Loading branch information
jerstlouis committed Aug 18, 2011
1 parent 4ad777f commit 0385bad
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion ecere/src/gui/controls/DataBox.ec
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public:
bool readOnly;
bool keepEditor;

virtual void SetData(void * newData, bool closingDropDown)
virtual void SetData(any_object newData, bool closingDropDown)
{
//type._vTbl[__ecereVMethodID_class_OnCopy](type, data, newData);

Expand Down
1 change: 0 additions & 1 deletion ecere/src/gui/typeEdit.ec
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ private:

bool DataBox::NotifySelect(DropBox control, DataRow row, Modifiers mods)
{
//SetData((void *)row.tag), mods.closingDropDown;
SetData(row.GetData(null), mods.closingDropDown);
return true;
}
Expand Down
13 changes: 7 additions & 6 deletions ide/src/designer/Sheet.ec
Original file line number Diff line number Diff line change
Expand Up @@ -1025,12 +1025,12 @@ class Sheet : Window
// row.SetData(null, codeObject); // Is this necessary?
}

void DataBox::EditSetData(void * setValue, bool closingDropDown)
void DataBox::EditSetData(any_object setValue, bool closingDropDown)
{
((Sheet)master.master).SetData(setValue, this);
}

void SetData(void * setValue, DataBox dataBox)
void SetData(any_object setValue, DataBox dataBox)
{
//PropertyInfo propertyPtr = row.GetData(null);
PropertyInfo propertyPtr = properties.GetData(null);
Expand Down Expand Up @@ -1058,7 +1058,7 @@ class Sheet : Window
data = new0 byte[dataType.structSize];
prop.Get(object, data);
// CopyBytes((byte *)data + member.offset + propertyPtr.extraOffset, &setValue, subDataType.size);
CopyBytes((byte *)data + member.offset + propertyPtr.extraOffset, &setValue, subDataType.dataType.size);
CopyBytes((byte *)data + member.offset + propertyPtr.extraOffset, setValue, subDataType.dataType.size);
prop.Set(object, data);
}
else if(dataType.type == normalClass || dataType.type == noHeadClass)
Expand All @@ -1074,7 +1074,7 @@ class Sheet : Window
DataValue value = { 0 };
value.ui = prop.Get(object);
value.ui &= ~ (uint)bitMember.mask;
value.ui |= (uint)setValue << bitMember.pos;
value.ui |= *(uint *)setValue << bitMember.pos;
prop.Set(object, value.ui);
}
}
Expand All @@ -1083,7 +1083,7 @@ class Sheet : Window
data = dataType.typeSize ? new0 byte[dataType.typeSize] : null;
prop.Get(object, data);
// CopyBytes((byte *)data + member.offset + propertyPtr.extraOffset, &setValue, subDataType.typeSize);
CopyBytes((byte *)data + member.offset + propertyPtr.extraOffset, &setValue, subDataType.dataType.size);
CopyBytes((byte *)data + member.offset + propertyPtr.extraOffset, setValue, subDataType.dataType.size);
// TODO: Support non 32 bit datatypes here
prop.Set(object, data);
}
Expand All @@ -1107,7 +1107,7 @@ class Sheet : Window
{
data = new0 byte[dataType.structSize];
prop.Get(object, data);
subProperty.Set(data, (uint)setValue);
subProperty.Set(data, *(uint *)setValue);
prop.Set(object, data);
}
else if(dataType.type == normalClass || dataType.type == noHeadClass)
Expand Down Expand Up @@ -1463,6 +1463,7 @@ public:
else
{
GetProperty(prop, object, &valueData);

if(dataType.type == normalClass)
dataPtr = valueData.p;
else
Expand Down

0 comments on commit 0385bad

Please sign in to comment.