Commit 7d4a69b0 authored by Claes's avatar Claes Committed by Esteban Blanc

wb GetNextAttrRef() bugfix for attrobjects with disableattr

parent afc88119
...@@ -167,6 +167,10 @@ public: ...@@ -167,6 +167,10 @@ public:
{ {
return m_adrep; return m_adrep;
} }
void addFlagsDisableAttr()
{
m_flags |= PWR_MASK_DISABLEATTR;
}
void castId(pwr_tCastId* castid); void castId(pwr_tCastId* castid);
pwr_tDisableAttr disabled(); pwr_tDisableAttr disabled();
pwr_tCid adefCid(); pwr_tCid adefCid();
......
...@@ -362,8 +362,8 @@ pwr_tStatus ldh_CreateObject(ldh_tSession session, pwr_tOid* oid, ...@@ -362,8 +362,8 @@ pwr_tStatus ldh_CreateObject(ldh_tSession session, pwr_tOid* oid,
try { try {
wb_name n(name); wb_name n(name);
//if (!n) if (name && !n)
// return n.sts(); return n.sts();
wb_cdef cdef = sp->cdef(cid); wb_cdef cdef = sp->cdef(cid);
......
...@@ -610,7 +610,7 @@ void wb_merep::classVersion(pwr_tStatus* sts, pwr_tCid cid, pwr_tTime* time) ...@@ -610,7 +610,7 @@ void wb_merep::classVersion(pwr_tStatus* sts, pwr_tCid cid, pwr_tTime* time)
} }
void wb_merep::insertCattObject( void wb_merep::insertCattObject(
pwr_tStatus* sts, pwr_tCid cid, wb_adrep* adp, int offset) pwr_tStatus* sts, pwr_tCid cid, wb_adrep* adp, int offset, int disableattr)
{ {
merep_sClassAttrKey key; merep_sClassAttrKey key;
merep_sClassAttr* item; merep_sClassAttr* item;
...@@ -634,12 +634,12 @@ void wb_merep::insertCattObject( ...@@ -634,12 +634,12 @@ void wb_merep::insertCattObject(
if (ODD(*sts)) { if (ODD(*sts)) {
// Insert in found item // Insert in found item
item->offset[item->numOffset] = offset + adp->offset(); item->offset[item->numOffset] = offset + adp->offset();
item->flags[item->numOffset++] = adp->flags(); item->flags[item->numOffset++] = adp->flags() | disableattr;
} else { } else {
// Insert a new item // Insert a new item
item = (merep_sClassAttr*)tree_Insert(sts, m_catt_tt, &key); item = (merep_sClassAttr*)tree_Insert(sts, m_catt_tt, &key);
item->offset[item->numOffset] = offset + adp->offset(); item->offset[item->numOffset] = offset + adp->offset();
item->flags[item->numOffset++] = adp->flags(); item->flags[item->numOffset++] = adp->flags() | disableattr;
} }
// Look for class attributes in this class // Look for class attributes in this class
...@@ -654,7 +654,12 @@ void wb_merep::insertCattObject( ...@@ -654,7 +654,12 @@ void wb_merep::insertCattObject(
for (ad = bd->adrep(sts); ODD(*sts); for (ad = bd->adrep(sts); ODD(*sts);
adnext = ad->next(sts), delete ad, ad = adnext) { adnext = ad->next(sts), delete ad, ad = adnext) {
if (ad->flags() & PWR_MASK_CLASS && cdh_tidIsCid(ad->tid())) { if (ad->flags() & PWR_MASK_CLASS && cdh_tidIsCid(ad->tid())) {
insertCattObject(sts, cid, ad, offset + adp->offset()); if (ad->flags() & PWR_MASK_SUPERCLASS)
insertCattObject(sts, cid, ad, offset + adp->offset(),
disableattr);
else
insertCattObject(sts, cid, ad, offset + adp->offset(),
ad->flags() & PWR_MASK_DISABLEATTR);
if (EVEN(*sts)) if (EVEN(*sts))
return; return;
} }
...@@ -692,7 +697,7 @@ void wb_merep::insertCattObject( ...@@ -692,7 +697,7 @@ void wb_merep::insertCattObject(
adnext = ad->next(sts), delete ad, ad = adnext) { adnext = ad->next(sts), delete ad, ad = adnext) {
if (ad->flags() & PWR_MASK_CLASS && cdh_tidIsCid(ad->tid())) { if (ad->flags() & PWR_MASK_CLASS && cdh_tidIsCid(ad->tid())) {
insertCattObject(sts, cid, ad, insertCattObject(sts, cid, ad,
offset + adp->offset() + j * adp->size() / adp->nElement()); offset + adp->offset() + j * adp->size() / adp->nElement(), ad->flags() & PWR_MASK_DISABLEATTR);
if (EVEN(*sts)) if (EVEN(*sts))
return; return;
} }
...@@ -740,7 +745,8 @@ tree_sTable* wb_merep::buildCatt(pwr_tStatus* sts) ...@@ -740,7 +745,8 @@ tree_sTable* wb_merep::buildCatt(pwr_tStatus* sts)
for (ad = bd->adrep(sts); ODD(*sts); for (ad = bd->adrep(sts); ODD(*sts);
adnext = ad->next(sts), delete ad, ad = adnext) { adnext = ad->next(sts), delete ad, ad = adnext) {
if (ad->flags() & PWR_MASK_CLASS && cdh_tidIsCid(ad->tid())) { if (ad->flags() & PWR_MASK_CLASS && cdh_tidIsCid(ad->tid())) {
insertCattObject(sts, cid, ad, 0); insertCattObject(sts, cid, ad, 0,
ad->flags() & PWR_MASK_DISABLEATTR);
if (EVEN(*sts)) if (EVEN(*sts))
throw wb_error(*sts); throw wb_error(*sts);
} }
...@@ -776,7 +782,8 @@ tree_sTable* wb_merep::buildCatt(pwr_tStatus* sts) ...@@ -776,7 +782,8 @@ tree_sTable* wb_merep::buildCatt(pwr_tStatus* sts)
for (ad = bd->adrep(sts); ODD(*sts); for (ad = bd->adrep(sts); ODD(*sts);
adnext = ad->next(sts), delete ad, ad = adnext) { adnext = ad->next(sts), delete ad, ad = adnext) {
if (ad->flags() & PWR_MASK_CLASS && cdh_tidIsCid(ad->tid())) { if (ad->flags() & PWR_MASK_CLASS && cdh_tidIsCid(ad->tid())) {
insertCattObject(sts, cid, ad, 0); insertCattObject(sts, cid, ad, 0,
ad->flags() & PWR_MASK_DISABLEATTR);
if (EVEN(*sts)) if (EVEN(*sts))
throw wb_error(*sts); throw wb_error(*sts);
} }
......
...@@ -109,7 +109,8 @@ public: ...@@ -109,7 +109,8 @@ public:
void classVersion(pwr_tStatus* sts, pwr_tCid cid, pwr_tTime* time); void classVersion(pwr_tStatus* sts, pwr_tCid cid, pwr_tTime* time);
tree_sTable* buildCatt(pwr_tStatus* sts); tree_sTable* buildCatt(pwr_tStatus* sts);
void insertCattObject( void insertCattObject(
pwr_tStatus* sts, pwr_tCid cid, wb_adrep* adp, int offset); pwr_tStatus* sts, pwr_tCid cid, wb_adrep* adp, int offset,
int disableattr);
tree_sTable* catt_tt() tree_sTable* catt_tt()
{ {
return m_catt_tt; return m_catt_tt;
......
...@@ -424,6 +424,8 @@ wb_attribute wb_volume::attribute(const pwr_sAttrRef* arp) const ...@@ -424,6 +424,8 @@ wb_attribute wb_volume::attribute(const pwr_sAttrRef* arp) const
wb_attribute a(LDH__SUCCESS, orep, adrep, idx); wb_attribute a(LDH__SUCCESS, orep, adrep, idx);
if (arp->Flags.b.Shadowed) if (arp->Flags.b.Shadowed)
a.setShadowed(true); a.setShadowed(true);
if (arp->Flags.b.DisableAttr)
a.addFlagsDisableAttr();
delete bdrep; delete bdrep;
orep->unref(); orep->unref();
return a; return a;
...@@ -1240,12 +1242,14 @@ void wb_volume::nextAref(pwr_tCid cid, pwr_sAttrRef* arp, pwr_sAttrRef* oarp) ...@@ -1240,12 +1242,14 @@ void wb_volume::nextAref(pwr_tCid cid, pwr_sAttrRef* arp, pwr_sAttrRef* oarp)
*oarp = pwr_cNAttrRef; *oarp = pwr_cNAttrRef;
oarp->Objid = op->oid(); oarp->Objid = op->oid();
oarp->Flags.b.ObjectAttr = 1; oarp->Flags.b.ObjectAttr = 1;
if (item->flags[i] & PWR_MASK_DISABLEATTR)
oarp->Flags.b.DisableAttr = 1;
oarp->Offset = item->offset[i]; oarp->Offset = item->offset[i];
oarp->Size = bd_size; oarp->Size = bd_size;
oarp->Body = cdh_cidToBid(cid, pwr_eBix_rt); oarp->Body = cdh_cidToBid(cid, pwr_eBix_rt);
op->unref(); op->unref();
if (item->flags[0] & PWR_MASK_DISABLEATTR) { if (item->flags[i] & PWR_MASK_DISABLEATTR) {
wb_attribute a = attribute(oarp); wb_attribute a = attribute(oarp);
if (a.disabled()) { if (a.disabled()) {
pwr_sAttrRef aref = *oarp; pwr_sAttrRef aref = *oarp;
...@@ -1297,6 +1301,8 @@ void wb_volume::nextAref(pwr_tCid cid, pwr_sAttrRef* arp, pwr_sAttrRef* oarp) ...@@ -1297,6 +1301,8 @@ void wb_volume::nextAref(pwr_tCid cid, pwr_sAttrRef* arp, pwr_sAttrRef* oarp)
*oarp = pwr_cNAttrRef; *oarp = pwr_cNAttrRef;
oarp->Objid = ol->oid(); oarp->Objid = ol->oid();
oarp->Flags.b.ObjectAttr = 1; oarp->Flags.b.ObjectAttr = 1;
if (item->flags[0] & PWR_MASK_DISABLEATTR)
oarp->Flags.b.DisableAttr = 1;
oarp->Offset = item->offset[0]; oarp->Offset = item->offset[0];
oarp->Size = bd_size; oarp->Size = bd_size;
oarp->Body = cdh_cidToBid(cid, pwr_eBix_rt); oarp->Body = cdh_cidToBid(cid, pwr_eBix_rt);
......
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