Commit 73be90b9 authored by claes's avatar claes

Bugfix in enum values

parent b2bd6dbb
/*
* Proview $Id: wb_ldh.cpp,v 1.64 2007-12-06 10:55:04 claes Exp $
* Proview $Id: wb_ldh.cpp,v 1.65 2008-01-24 09:47:46 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -2113,7 +2113,7 @@ ldh_GetEnumValueDef( ldh_tSession session, pwr_tTid tid, ldh_sValueDef **valuede
if ( !a) return a.sts();
strcpy( (*valuedef)[*rows].Name, valo.name());
(*valuedef)[*rows].Value = (pwr_sValue *) a.value();
memcpy( &(*valuedef)[*rows].Value, a.value(), sizeof(pwr_sValue));
(*rows)++;
}
}
......
/*
* Proview $Id: wb_ldh.h,v 1.42 2007-12-06 10:55:04 claes Exp $
* Proview $Id: wb_ldh.h,v 1.43 2008-01-24 09:48:28 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -397,7 +397,7 @@ struct ldh_s_BitDef {
struct ldh_s_ValueDef {
pwr_tObjName Name;
pwr_sValue *Value;
pwr_sValue Value;
};
struct ldh_s_LCB {
......
/*
* Proview $Id: wb_wnav_item.cpp,v 1.24 2007-08-28 07:30:36 claes Exp $
* Proview $Id: wb_wnav_item.cpp,v 1.25 2008-01-24 09:50:00 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -1259,9 +1259,9 @@ int WItemAttr::open_children( double x, double y)
brow_SetNodraw( brow->ctx);
for ( int i = 0; i < rows; i++) {
new WItemEnum( brow, ldhses, objid, vd[i].Value->Text, attr,
new WItemEnum( brow, ldhses, objid, vd[i].Value.Text, attr,
type_id, tid,
size, flags, body, vd[i].Value->Value, 0, 0,
size, flags, body, vd[i].Value.Value, 0, 0,
node, flow_eDest_IntoLast);
}
free( (char *)vd);
......@@ -1350,8 +1350,8 @@ int WItemAttr::update()
sts = ldh_GetEnumValueDef( ldhses, tid, &vd, &rows);
if ( ODD(sts)) {
for ( int i = 0; i < rows; i++) {
if ( vd[i].Value->Value == *(pwr_tInt32 *)value) {
strcpy( buf, vd[i].Value->Text);
if ( vd[i].Value.Value == *(pwr_tInt32 *)value) {
strcpy( buf, vd[i].Value.Text);
buff = buf;
len = strlen(buf);
found = true;
......@@ -2731,9 +2731,9 @@ int WItemAttrArrayElem::open_children( double x, double y)
brow_SetNodraw( brow->ctx);
for ( int i = 0; i < rows; i++) {
new WItemEnum( brow, ldhses, objid, vd[i].Value->Text, attr,
new WItemEnum( brow, ldhses, objid, vd[i].Value.Text, attr,
type_id, tid,
size, flags, body, vd[i].Value->Value, 1, element,
size, flags, body, vd[i].Value.Value, 1, element,
node, flow_eDest_IntoLast);
}
free( (char *)vd);
......@@ -2822,9 +2822,9 @@ int WItemAttrArrayElem::update()
sts = ldh_GetEnumValueDef( ldhses, tid, &vd, &rows);
if ( ODD(sts)) {
for ( int i = 0; i < rows; i++) {
if ( vd[i].Value->Value ==
if ( vd[i].Value.Value ==
* (pwr_tInt32 *)((char *) value + size * element)) {
strcpy( buf, vd[i].Value->Text);
strcpy( buf, vd[i].Value.Text);
buff = buf;
len = strlen(buf);
found = true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment