Commit 47007d53 authored by claes's avatar claes

Change in n.attributesAll

parent fe2f4239
......@@ -145,12 +145,12 @@ wb_attribute::wb_attribute(pwr_tStatus sts, wb_orep* orep, const char *bname, co
if ( bname) {
bd = cd->bdrep( &m_sts, bname);
if ( oddSts()) {
m_adrep = bd->adrep( &m_sts, n.attributesAll());
m_adrep = bd->adrep( &m_sts, n.attributesAllTrue());
m_bix = bd->bix();
}
}
else {
m_adrep = cd->adrep( &m_sts, n.attributesAll());
m_adrep = cd->adrep( &m_sts, n.attributesAllTrue());
m_bix = pwr_eBix_rt;
}
if ( oddSts()) {
......@@ -237,13 +237,13 @@ wb_attribute::wb_attribute(const wb_attribute& pa, int idx, const char *aname) :
if (evenSts()) { delete cd; return;}
}
m_adrep = bd->adrep(&m_sts, n.attributesAll());
m_adrep = bd->adrep(&m_sts, n.attributesAllTrue());
if (evenSts()) {
// Try devbody
bd = cd->bdrep(&m_sts, pwr_eBix_dev);
if (evenSts()) { delete cd; return;}
m_adrep = bd->adrep(&m_sts, n.attributesAll());
m_adrep = bd->adrep(&m_sts, n.attributesAllTrue());
if (evenSts()) { delete cd; delete bd; return;}
}
m_adrep->ref();
......
......@@ -801,6 +801,14 @@ ldh_GetAttrRefTid(ldh_tSession session, pwr_sAttrRef *arp, pwr_tTid *tid)
{
wb_session *sp = (wb_session *)session;
if ( arp->Flags.b.Object) {
wb_object o = sp->object(arp->Objid);
if (!o) return o.sts();
*tid = o.cid();
return o.sts();
}
wb_attribute a = sp->attribute(arp);
if (!a) return a.sts();
*tid = a.tid();
......@@ -1346,7 +1354,7 @@ ldh_AttrRefToName(ldh_tSession session, pwr_sAttrRef *arp, int nametype, char **
wb_name n = a.longName();
strcpy( str, a.name());
strcat( str, ".");
strcat( str, n.attribute());
strcat( str, n.attributesAll());
*aname = str;
*size = strlen(str);
break;
......
......@@ -261,7 +261,7 @@ int wb_merep::getAttrInfoRec( wb_attrname *attr, pwr_eBix bix, pwr_tCid cid, siz
wb_bdrep *bd = 0;
if ( bix == 0) {
// Search in all bodies
adrep = cd->adrep( &sts, attr->attributesAll(level));
adrep = cd->adrep( &sts, attr->attributesAllTrue(level));
if ( EVEN(sts)) { delete cd; return 0;}
}
else {
......@@ -269,7 +269,7 @@ int wb_merep::getAttrInfoRec( wb_attrname *attr, pwr_eBix bix, pwr_tCid cid, siz
bd = cd->bdrep( &sts, bix);
if ( EVEN(sts)) { delete cd; return 0;}
adrep = bd->adrep( &sts, attr->attributesAll(level));
adrep = bd->adrep( &sts, attr->attributesAllTrue(level));
if ( EVEN(sts)) { delete cd; delete bd; return 0;}
}
......
......@@ -11,11 +11,14 @@
#include "wb_ldh.h"
#include "wb_merep.h"
#include "wb_attribute.h"
#include "wb_dblock.h"
void wb_vrepdb::unref()
{
if (--m_nRef == 0)
if (--m_nRef == 0) {
wb_dblock::dbunlock(m_fileName);
delete this;
}
}
wb_vrep *wb_vrepdb::ref()
......@@ -29,6 +32,7 @@ wb_vrepdb::wb_vrepdb(wb_erep *erep, const char *fileName) :
m_erep(erep), m_nRef(0), m_ohead(), m_oid_th(0)
{
strcpy(m_fileName, fileName);
wb_dblock::dblock( m_fileName);
m_db = new wb_db();
m_db->open(fileName);
......@@ -44,6 +48,7 @@ wb_vrepdb::wb_vrepdb(wb_erep *erep, pwr_tVid vid, pwr_tCid cid, const char *volu
m_erep(erep), m_nRef(0), m_ohead(), m_oid_th(0)
{
strcpy(m_fileName, fileName);
wb_dblock::dblock( m_fileName);
m_db = new wb_db();
m_db->create(vid, cid, volumeName, fileName);
......@@ -1277,7 +1282,7 @@ bool wb_vrepdb::exportTreeHelper(wb_treeimport &i, pwr_tOid oid, bool isRoot)
printf("wb_vrepdbs::exportTreeObject, db.get: %d\n", rc);
}
pwr_mClassDef flags; flags.m = 0; // Fix !!!
pwr_mClassDef flags = m_ohead.flags(); // flags.m = 0; // Fix !!!
if (isRoot) {
i.importTreeObject(m_merep, m_ohead.oid(), m_ohead.cid(), pwr_cNOid, pwr_cNOid, m_ohead.name(), flags,
m_ohead.rbSize(), m_ohead.dbSize(), rbody, dbody);
......
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