Commit a2237ffd authored by claes's avatar claes

*** empty log message ***

parent aba29ae0
......@@ -133,7 +133,7 @@ void *wnav_help_insert_cb( void *ctx, navh_eItemType item_type, char *text1,
if ( strcmp( link, "") != 0) {
char fname[200];
if ( (strstr( link, ".htm") == 0) || (strstr( link, ".pdf") == 0)) {
if ( (strstr( link, ".htm") != 0) || (strstr( link, ".pdf") != 0)) {
strcpy( fname, link);
}
else {
......@@ -181,7 +181,7 @@ void *wnav_help_insert_cb( void *ctx, navh_eItemType item_type, char *text1,
{
char fname[200];
if ( strcmp( link, "") != 0) {
if ( (strstr( link, ".htm") == 0) || (strstr( link, ".pdf") == 0)) {
if ( (strstr( link, ".htm") != 0) || (strstr( link, ".pdf") != 0)) {
strcpy( fname, link);
}
else {
......
......@@ -12,12 +12,7 @@ Volume wb pwr_eClass_WorkBenchVolume 254.254.254.254
EndVolume
SObject wb:
Object layout $PlantHier
EndObject
EndSObject
SObject wb:layout
Object Lists $DocHier
Object Lists $PlantHier
Object ListConfig ListConfig
EndObject
Object ChannelList ListDescriptor
......
......@@ -3,3 +3,4 @@ pwrb 0.0.0.2
nmps 0.0.1.1
tlog 0.0.1.2
ssab 0.0.1.3
wb 254.254.254.254
\ No newline at end of file
......@@ -353,7 +353,7 @@ pwr_eBix wb_attribute::bix() const
{
check();
if (m_flags & PWR_MASK_SUBCLASS)
if (!m_adrep || m_flags & PWR_MASK_SUBCLASS)
return m_bix;
return m_adrep->bix();
......
......@@ -811,6 +811,8 @@ static void foe_destroy(
if ( foectx->set_focus_disabled)
XtRemoveTimeOut( foectx->focus_timerid);
foectx->grectx->window_object->hw.foectx = 0;
/* Delete controled modules */
gre_del( foectx->grectx);
pal_del( foectx->node_palctx);
......
......@@ -11,6 +11,7 @@ This module contains the API-routines to the Local Data Handler, LDH. */
#include <time.h>
#include <assert.h>
#include <stdarg.h>
#include <fstream.h>
#ifdef OS_VMS
#include <descrip.h>
#include <libdef.h>
......@@ -24,6 +25,7 @@ This module contains the API-routines to the Local Data Handler, LDH. */
#include "pwr_class.h"
#include "wb_ldh_msg.h"
#include "co_cdh.h"
#include "co_dcli.h"
#include "pwr_vararg.h"
#include "co_ver.h"
#include "rt_gdh.h"
......@@ -37,6 +39,7 @@ This module contains the API-routines to the Local Data Handler, LDH. */
#include "wb_volume.h"
#include "wb_error.h"
#include "wb_vrepmem.h"
#include "wb_print_wbl.h"
#include "pwr_baseclasses.h"
#include <X11/Intrinsic.h>
......@@ -363,7 +366,7 @@ ldh_CreateObject(ldh_tSession session, pwr_tOid *oid, char *name, pwr_tCid cid,
wb_object d_o = wb_object();
wb_destination d = wb_destination( doid, dest);
wb_object o = sp->createObject(cdef, d, n);
if (!o) return o.sts();
if (!o) return sp->sts();
*oid = o.oid();
return o.sts();
......@@ -372,7 +375,7 @@ ldh_CreateObject(ldh_tSession session, pwr_tOid *oid, char *name, pwr_tCid cid,
wb_object d_o = sp->object(doid);
wb_destination d = d_o.destination(dest);
wb_object o = sp->createObject(cdef, d, n);
if (!o) return o.sts();
if (!o) return sp->sts();
*oid = o.oid();
return o.sts();
......@@ -409,7 +412,8 @@ ldh_DeleteObject(ldh_tSession session, pwr_tOid oid)
wb_object o = sp->object(oid);
if (!o) return o.sts();
return sp->deleteObject(o);
sp->deleteObject(o);
return sp->sts();
}
pwr_tStatus
......@@ -895,7 +899,8 @@ ldh_MoveObject(ldh_tSession session, pwr_tOid oid, pwr_tOid doid, ldh_eDest dest
if (!o) return o.sts();
wb_destination d = d_o.destination(dest);
return sp->moveObject(o, d);
sp->moveObject(o, d);
return sp->sts();
}
pwr_tStatus
......@@ -917,10 +922,8 @@ pwr_tStatus
ldh_NameToObjid(ldh_tSession session, pwr_tOid *oid, char *name)
{
wb_session *sp = (wb_session *)session;
wb_name n = wb_name(name);
if ( n.evenSts()) return n.sts();
wb_object o = sp->object(n);
wb_object o = sp->object(name);
if (!o) return o.sts();
*oid = o.oid();
......@@ -1237,8 +1240,8 @@ pwr_tStatus
ldh_SetObjectBody(ldh_tSession session, pwr_tOid oid, char *bname, char *value, int size)
{
wb_session *sp = (wb_session *)session;
wb_object o = sp->object(oid);
wb_attribute a = sp->attribute(o, bname);
wb_attribute a = sp->attribute( oid, bname);
if ( !a) return a.sts();
try {
sp->writeAttribute(a, value);
......@@ -1441,6 +1444,52 @@ ldh_Paste(ldh_tSession session, pwr_tOid doid, ldh_eDest dest, int keepoid, char
pwr_tStatus
ldh_CreateLoadFile(ldh_tSession session)
{
return LDH__NYI;
wb_session *sp = (wb_session*)session;
try {
sp->createSnapshot( 0);
}
catch (wb_error& e) {
return e.sts();
}
return sp->sts();
}
pwr_tStatus
ldh_WbDump (
ldh_tSession session,
char *objname,
char *dumpfile
)
{
wb_session *sp = (wb_session*)session;
char fname[200];
dcli_translate_filename( fname, dumpfile);
ofstream fp( fname);
if ( !fp) return LDH__FILEOPEN;
try {
wb_print_wbl wprint( fp);
if ( !objname)
wprint.printVolume( *sp);
else {
wb_object o = sp->object( objname);
wprint.printHierarchy( *sp, o);
}
}
catch ( wb_error& e) {
return e.sts();
}
return LDH__SUCCESS;
}
#endif
......@@ -954,6 +954,13 @@ ldh_CreateLoadFile(
ldh_tSession session
);
pwr_tStatus
ldh_WbDump(
ldh_tSesContext ldhses,
char *objname,
char *dumpfile
);
#ifdef __cplusplus
}
#endif
......
......@@ -68,13 +68,32 @@ wb_object wb_session::createObject(wb_cdef cdef, wb_destination d, wb_name name)
if (isReadonly())
throw wb_error_str("ReadOnlySession");
wb_object parent;
switch ( d.code()) {
case ldh_eDest_IntoFirst:
case ldh_eDest_IntoLast:
parent = object( d.oid());
break;
case ldh_eDest_After:
case ldh_eDest_Before:
parent = object( d.oid()).parent();
break;
default:
throw wb_error(LDH__NODEST);
}
m_sts = triggAnteCreate( parent, cdef.cid());
if ( evenSts()) return wb_object();
m_sts = triggAnteAdopt( parent, cdef.cid());
if ( evenSts()) return wb_object();
orep = m_vrep->createObject(&m_sts, cdef, d, name);
wb_object o = wb_object(m_sts, orep);
ldh_sEvent *ep = m_srep->eventStart( o.oid(), ldh_eEvent_ObjectCreated);
m_srep->eventNewFamily( ep, o);
// sts = triggPostCreate( orep);
// sts = triggPostAdopt( father, orep);
triggPostCreate( o);
triggPostAdopt( parent, o);
m_srep->eventSend( ep);
return o;
}
......@@ -86,13 +105,35 @@ wb_object wb_session::copyObject(wb_object o, wb_destination d, wb_name name)
if (isReadonly())
throw wb_error_str("ReadOnlySession");
wb_object parent;
switch ( d.code()) {
case ldh_eDest_IntoFirst:
case ldh_eDest_IntoLast:
parent = object( d.oid());
break;
case ldh_eDest_After:
case ldh_eDest_Before:
parent = object( d.oid()).parent();
break;
default:
throw wb_error(LDH__NODEST);
}
m_sts = triggAnteCreate( parent, o.cid());
if ( evenSts()) return wb_object();
m_sts = triggAnteAdopt( parent, o.cid());
if ( evenSts()) return wb_object();
orep = m_vrep->copyObject(&m_sts, (wb_orep*)o, d, name);
ldh_sEvent *ep = m_srep->eventStart( orep->oid(), ldh_eEvent_ObjectCreated);
m_srep->eventNewFamily( ep, o);
wb_object onew = wb_object(m_sts, orep);
ldh_sEvent *ep = m_srep->eventStart( onew.oid(), ldh_eEvent_ObjectCreated);
m_srep->eventNewFamily( ep, onew);
triggPostCreate( onew);
triggPostAdopt( parent, onew);
m_srep->eventSend( ep);
return wb_object(m_sts, orep);
return onew;
}
bool wb_session::moveObject(wb_object o, wb_destination d)
......@@ -100,15 +141,41 @@ bool wb_session::moveObject(wb_object o, wb_destination d)
if (isReadonly())
throw wb_error_str("ReadOnlySession");
wb_object parent;
switch ( d.code()) {
case ldh_eDest_IntoFirst:
case ldh_eDest_IntoLast:
parent = object( d.oid());
break;
case ldh_eDest_After:
case ldh_eDest_Before:
parent = object( d.oid()).parent();
break;
default:
throw wb_error(LDH__NODEST);
}
wb_object old_parent = o.parent();
m_sts = triggAnteMove( o, parent);
if ( evenSts()) return false;
m_sts = triggAnteUnadopt( old_parent, o);
if ( evenSts()) return false;
m_sts = triggAnteAdopt( parent, o.cid());
if ( evenSts()) return false;
ldh_sEvent *ep = m_srep->eventStart( o.oid(), ldh_eEvent_ObjectMoved);
m_srep->eventOldFamily( ep, o);
bool sts = m_vrep->moveObject(&m_sts, (wb_orep*)o, d);
bool rsts = m_vrep->moveObject(&m_sts, (wb_orep*)o, d);
triggPostMove( o);
triggPostUnadopt( old_parent, o);
triggPostAdopt( parent, o);
m_srep->eventNewFamily( ep, o);
m_srep->eventSend( ep);
return sts;
return rsts;
}
......@@ -129,19 +196,27 @@ bool wb_session::deleteObject(wb_object o)
if (isReadonly())
throw wb_error_str("ReadOnlySession");
return m_vrep->deleteObject(&m_sts, (wb_orep*)o);
/*
if (!o.isLocal())
return LDH__OTHERVOLUME;
if (o.hasChild())
return LDH__HAS_CHILD;
if (!isLocal( o)) {
m_sts = LDH__OTHERVOLUME;
return false;
}
if ( o.first()) {
m_sts = LDH__HAS_CHILD;
return false;
}
o.triggAnteUnadopt();
o.unaAdopt();
o.triggPostUnadopt();
*/
pwr_tStatus sts;
wb_object parent = o.parent();
sts = triggAnteUnadopt( parent, o);
ldh_sEvent *ep = m_srep->eventStart( o.oid(), ldh_eEvent_ObjectDeleted);
m_srep->eventOldFamily( ep, o);
sts = triggPostUnadopt( parent, o);
bool rsts = m_vrep->deleteObject(&m_sts, (wb_orep*)o);
m_srep->eventSend( ep);
return rsts;
}
bool wb_session::deleteFamily(wb_object o)
......@@ -149,7 +224,23 @@ bool wb_session::deleteFamily(wb_object o)
if (isReadonly())
throw wb_error_str("ReadOnlySession");
return m_vrep->deleteFamily(&m_sts, (wb_orep*)o);
if (!isLocal( o)) {
m_sts = LDH__OTHERVOLUME;
return false;
}
pwr_tStatus sts;
wb_object parent = o.parent();
sts = triggAnteUnadopt( parent, o);
ldh_sEvent *ep = m_srep->eventStart( o.oid(), ldh_eEvent_ObjectDeleted);
m_srep->eventOldFamily( ep, o);
sts = triggPostUnadopt( parent, o);
bool rsts = m_vrep->deleteFamily(&m_sts, (wb_orep*)o);
m_srep->eventSend( ep);
return rsts;
}
bool wb_session::writeAttribute(wb_attribute &a, void *p, size_t size)
......@@ -302,7 +393,44 @@ bool wb_session::pasteOset( pwr_tOid doid, ldh_eDest dest,
m_sts = LDH__PASTESELF;
return false;
}
mem->exportPaste( *m_vrep, doid, dest, keepoid);
// Trigg ante adopt
wb_object parent;
switch ( dest) {
case ldh_eDest_IntoFirst:
case ldh_eDest_IntoLast:
parent = object( doid);
break;
case ldh_eDest_After:
case ldh_eDest_Before:
parent = object( doid).parent();
break;
default:
throw wb_error(LDH__NODEST);
}
if ( parent) {
pwr_tStatus sts;
wb_orep *orep = mem->object( &sts);
while( ODD(sts)) {
orep->ref();
m_sts = triggAnteAdopt( parent, orep->cid());
if ( evenSts()) return false;
wb_orep *prev = orep;
orep = orep->after( &sts);
prev->unref();
}
}
pwr_tOid *olist;
mem->exportPaste( *m_vrep, doid, dest, keepoid, &olist);
if ( parent) {
for ( pwr_tOid *oidp = olist; cdh_ObjidIsNotNull(*oidp); oidp++) {
wb_object o = object(*oidp);
triggPostAdopt( parent, o);
}
}
free( olist);
if ( dest == ldh_eDest_After || dest == ldh_eDest_Before)
doid = pwr_cNOid;
......
......@@ -32,9 +32,10 @@ public:
size_t rbSize, size_t dbSize, void *rbody, void *dbody) = 0;
virtual bool importPaste() = 0;
virtual bool importPasteObject(pwr_tOid destination, ldh_eDest destcode, bool keepoid,
pwr_tOid oid, pwr_tCid cid, pwr_tOid poid,
pwr_tOid boid, const char *name,
size_t rbSize, size_t dbSize, void *rbody, void *dbody) = 0;
pwr_tOid oid, pwr_tCid cid, pwr_tOid poid,
pwr_tOid boid, const char *name,
size_t rbSize, size_t dbSize, void *rbody, void *dbody,
pwr_tOid *roid) = 0;
bool importTranslationTableInsert( pwr_tOix from, pwr_tOix to);
void importTranslationTableClear();
pwr_tOix importTranslate( pwr_tOix oix);
......
......@@ -44,7 +44,6 @@
#include "co_time.h"
#include "co_dcli.h"
#include "wb_ldh.h"
#include "wb_ldhdump.h"
#include "wb_ldh_msg.h"
#include "wb_foe_msg.h"
#include "wb_vldh_msg.h"
......@@ -3229,94 +3228,6 @@ pwr_tStatus utl_show_volumes(
return FOE__SUCCESS;
}
/*************************************************************************
*
* Name: utl_show_objects_hier_class_name()
*
* Type int
*
* Type Parameter IOGF Description
* ldh_tSesContext ldhses I ldh session.
* char * hiername I Name of a object in the hierarchy.
* char * class I Name of the class.
*
*
* Description: Prints all objects of a specified class that is found
* below a specific object in the hierarchy.
*
**************************************************************************/
int utl_wb_dump(
ldh_tSesContext ldhses,
int i_flag,
int n_flag,
int h_flag,
int r_flag,
int indchr_arg,
char *objname,
char *dumpfile,
char *volume
)
{
int sts, i;
char vol_str[UTL_INPUTLIST_MAX + 1][80];
pwr_tVolumeId volume_vect[UTL_INPUTLIST_MAX + 1];
pwr_tVolumeId *volume_p;
pwr_tClassId vol_class;
pwr_tVolumeId vol_id;
int nr;
if ( !h_flag && !r_flag)
{
if ( volume != NULL)
{
/* Parse the volumestr */
nr = utl_parse( volume, ", ", "", (char *)vol_str,
sizeof( vol_str) / sizeof( vol_str[0]), sizeof( vol_str[0]));
if ( (nr == 0) || ( nr > UTL_INPUTLIST_MAX))
return FOE__PARSYNT;
for ( i = 0; i < nr; i++)
{
sts = ldh_VolumeNameToId( ldh_SessionToWB( ldhses), vol_str[i],
&volume_vect[i]);
if ( EVEN(sts)) return sts;
}
volume_vect[nr] = 0;
volume_p = volume_vect;
}
else
{
/* Get all volumes that is not class and wb volumes */
i = 0;
sts = ldh_GetVolumeList( ldh_SessionToWB( ldhses), &vol_id);
while ( ODD(sts) )
{
sts = ldh_GetVolumeClass( ldh_SessionToWB( ldhses), vol_id,
&vol_class);
if (EVEN(sts)) return sts;
if ( vol_class != pwr_eClass_ClassVolume)
{
volume_vect[i] = vol_id;
i++;
if ( i > UTL_INPUTLIST_MAX)
return FOE__PARSYNT;
}
sts = ldh_GetNextVolume( ldh_SessionToWB( ldhses), vol_id, &vol_id);
}
volume_vect[i] = 0;
volume_p = volume_vect;
}
}
else
volume_p = NULL;
sts = ldh_ldhdump( ldhses, i_flag, n_flag, h_flag, r_flag, indchr_arg,
objname, dumpfile, volume_p);
return sts;
}
/*************************************************************************
*
......
......@@ -487,18 +487,6 @@ pwr_tStatus utl_show_volumes(
int allvolumes
);
int utl_wb_dump(
ldh_tSesContext ldhses,
int i_flag,
int n_flag,
int h_flag,
int r_flag,
int indchr_arg,
char *objname,
char *dumpfile,
char *volume
);
int utl_revert (
ldh_tSesContext ldhses,
int confirm
......
This diff is collapsed.
......@@ -81,16 +81,16 @@ public:
bool exportTree( wb_volume &import, pwr_tOid oid);
pwr_tStatus syntaxCheck( int *errorcount, int *warningcount);
pwr_tStatus syntaxCheckObject( wb_orep *orep, int *errorcount, int *warningcount);
pwr_tStatus triggSyntaxCheck( wb_orep *orep, int *errorcount, int *warningcount);
pwr_tStatus triggAnteAdopt( wb_orep *orep, pwr_tCid cid);
pwr_tStatus triggAnteCreate( wb_orep *father, pwr_tCid cid);
pwr_tStatus triggAnteMove( wb_orep *orep, wb_orep *father);
pwr_tStatus triggAnteUnadopt( wb_orep *father, wb_orep *orep);
pwr_tStatus triggPostAdopt( wb_orep *father, wb_orep *orep);
pwr_tStatus triggPostCreate( wb_orep *orep);
pwr_tStatus triggPostMove( wb_orep *orep);
pwr_tStatus triggPostUnadopt( wb_orep *father, wb_orep *orep);
pwr_tStatus syntaxCheckObject( wb_object& o, int *errorcount, int *warningcount);
pwr_tStatus triggSyntaxCheck( wb_object& o, int *errorcount, int *warningcount);
pwr_tStatus triggAnteAdopt( wb_object& o, pwr_tCid cid);
pwr_tStatus triggAnteCreate( wb_object& father, pwr_tCid cid);
pwr_tStatus triggAnteMove( wb_object& o, wb_object& father);
pwr_tStatus triggAnteUnadopt( wb_object& father, wb_object& o);
pwr_tStatus triggPostAdopt( wb_object& father, wb_object& o);
pwr_tStatus triggPostCreate( wb_object& o);
pwr_tStatus triggPostMove( wb_object& o);
pwr_tStatus triggPostUnadopt( wb_object& father, wb_object& o);
};
#endif
......
......@@ -131,7 +131,8 @@ public:
bool keepoid, pwr_tOid oid,
pwr_tCid cid, pwr_tOid poid,
pwr_tOid boid, const char *name,
size_t rbSize, size_t dbSize, void *rbody, void *dbody)
size_t rbSize, size_t dbSize, void *rbody, void *dbody,
pwr_tOid *roid)
{ return false;}
#if 0
......
......@@ -141,7 +141,8 @@ public:
bool keepoid, pwr_tOid oid,
pwr_tCid cid, pwr_tOid poid,
pwr_tOid boid, const char *name,
size_t rbSize, size_t dbSize, void *rbody, void *dbody)
size_t rbSize, size_t dbSize, void *rbody, void *dbody,
pwr_tOid *roid)
{ return false;}
virtual bool accessSupported( ldh_eAccess access) { return access == ldh_eAccess_ReadOnly; }
......
......@@ -581,6 +581,8 @@ wb_orep *wb_vrepmem::createObject(pwr_tStatus *sts, wb_cdef cdef, wb_destination
switch ( code) {
case ldh_eDest_IntoFirst:
memo->fws = dest->fch;
if ( dest->fch)
dest->fch->bws = memo;
dest->fch = memo;
memo->fth = dest;
break;
......@@ -598,6 +600,8 @@ wb_orep *wb_vrepmem::createObject(pwr_tStatus *sts, wb_cdef cdef, wb_destination
case ldh_eDest_After:
memo->fws = dest->fws;
memo->bws = dest;
if ( dest->fws)
dest->fws->bws = memo;
dest->fws = memo;
memo->fth = dest->fth;
break;
......@@ -682,6 +686,8 @@ wb_orep *wb_vrepmem::copyObject(pwr_tStatus *sts, const wb_orep *orep, wb_destin
switch ( code) {
case ldh_eDest_IntoFirst:
memo->fws = dest->fch;
if ( dest->fch)
dest->fch->bws = memo;
dest->fch = memo;
memo->fth = dest;
break;
......@@ -699,6 +705,8 @@ wb_orep *wb_vrepmem::copyObject(pwr_tStatus *sts, const wb_orep *orep, wb_destin
case ldh_eDest_After:
memo->fws = dest->fws;
memo->bws = dest;
if ( dest->fws)
dest->fws->bws = memo;
dest->fws = memo;
memo->fth = dest->fth;
break;
......@@ -766,6 +774,8 @@ bool wb_vrepmem::moveObject(pwr_tStatus *sts, wb_orep *orep, wb_destination &d)
switch ( code) {
case ldh_eDest_IntoFirst:
memo->fws = dest->fch;
if ( dest->fch)
dest->fch->bws = memo;
dest->fch = memo;
memo->fth = dest;
break;
......@@ -783,6 +793,8 @@ bool wb_vrepmem::moveObject(pwr_tStatus *sts, wb_orep *orep, wb_destination &d)
case ldh_eDest_After:
memo->fws = dest->fws;
memo->bws = dest;
if ( dest->fws)
dest->fws->bws = memo;
dest->fws = memo;
memo->fth = dest->fth;
break;
......@@ -1143,7 +1155,8 @@ bool wb_vrepmem::importPasteObject(pwr_tOid destination, ldh_eDest destcode,
bool keepoid, pwr_tOid oid,
pwr_tCid cid, pwr_tOid poid,
pwr_tOid boid, const char *name,
size_t rbSize, size_t dbSize, void *rbody, void *dbody)
size_t rbSize, size_t dbSize, void *rbody, void *dbody,
pwr_tOid *roid)
{
mem_object *memo = new mem_object();
strcpy( memo->m_name, name);
......@@ -1256,6 +1269,7 @@ bool wb_vrepmem::importPasteObject(pwr_tOid destination, ldh_eDest destcode,
registerObject( memo->m_oid.oix, memo);
importTranslationTableInsert( oid.oix, memo->m_oid.oix);
*roid = memo->m_oid;
return true;
}
......@@ -1277,10 +1291,17 @@ bool wb_vrepmem::exportTree(wb_treeimport &i, pwr_tOid oid)
}
bool wb_vrepmem::exportPaste(wb_treeimport &i, pwr_tOid destination, ldh_eDest destcode,
bool keepoid)
bool keepoid, pwr_tOid **rootlist)
{
// Count number of topobjects
int top_cnt = 0;
for ( mem_object *top = root_object; top; top = top->fws)
top_cnt++;
*rootlist = (pwr_tOid *) calloc( top_cnt + 1, sizeof(pwr_tOid));
if ( root_object) {
root_object->exportPaste( i, destination, true, destcode, keepoid);
root_object->exportPaste( i, destination, true, destcode, keepoid, *rootlist);
i.importPaste();
}
return true;
......
......@@ -56,19 +56,22 @@ class mem_object
return true;
}
bool exportPaste( wb_treeimport &i, pwr_tOid destination, bool isRoot, ldh_eDest destcode,
bool keepoid) {
bool exportPaste( wb_treeimport &i, pwr_tOid destination, bool isRoot,
ldh_eDest destcode, bool keepoid, pwr_tOid *rootlist) {
pwr_tOid fthoid = (fth && !isRoot) ? fth->m_oid : pwr_cNOid;
pwr_tOid bwsoid = (bws && !isRoot) ? bws->m_oid : pwr_cNOid;
pwr_tOid oid;
i.importPasteObject( destination, destcode, keepoid, m_oid, m_cid, fthoid, bwsoid,
name(), rbody_size, dbody_size, rbody, dbody);
name(), rbody_size, dbody_size, rbody, dbody, &oid);
if ( rootlist)
*rootlist++ = oid;
if ( fch)
fch->exportPaste( i, destination, false, destcode, keepoid);
fch->exportPaste( i, destination, false, destcode, keepoid, 0);
if ( fws)
fws->exportPaste( i, destination, false, destcode, keepoid);
fws->exportPaste( i, destination, false, destcode, keepoid, rootlist);
return true;
}
......@@ -226,7 +229,8 @@ public:
virtual bool exportDbody(wb_import &i);
virtual bool exportMeta(wb_import &i);
virtual bool exportTree(wb_treeimport &i, pwr_tOid oid);
bool exportPaste(wb_treeimport &i, pwr_tOid destination, ldh_eDest destcode, bool keepoid);
bool exportPaste(wb_treeimport &i, pwr_tOid destination, ldh_eDest destcode, bool keepoid,
pwr_tOid **rootlist);
virtual bool importTreeObject(wb_merep *merep, pwr_tOid oid, pwr_tCid cid, pwr_tOid poid,
pwr_tOid boid, const char *name,
size_t rbSize, size_t dbSize, void *rbody, void *dbody);
......@@ -235,7 +239,8 @@ public:
bool keepoid, pwr_tOid oid,
pwr_tCid cid, pwr_tOid poid,
pwr_tOid boid, const char *name,
size_t rbSize, size_t dbSize, void *rbody, void *dbody);
size_t rbSize, size_t dbSize, void *rbody, void *dbody,
pwr_tOid *roid);
virtual bool importPaste();
bool updateObject( wb_orep *o, bool keepref);
bool updateSubClass( wb_adrep *subattr, char *body, bool keepref);
......
......@@ -194,7 +194,8 @@ public:
bool keepoid, pwr_tOid oid,
pwr_tCid cid, pwr_tOid poid,
pwr_tOid boid, const char *name,
size_t rbSize, size_t dbSize, void *rbody, void *dbody)
size_t rbSize, size_t dbSize, void *rbody, void *dbody,
pwr_tOid *roid)
{ return false;}
virtual bool accessSupported( ldh_eAccess access) { return access == ldh_eAccess_ReadOnly;}
};
......
......@@ -1760,6 +1760,8 @@ static int wnav_brow_cb( FlowCtx *ctx, flow_tEvent event)
&objid,
0, classid, ((WItemObject *)item)->objid,
destcode);
if (EVEN(sts))
wnav->message('E', wnav_get_message(sts));
break;
default:
;
......@@ -1769,6 +1771,8 @@ static int wnav_brow_cb( FlowCtx *ctx, flow_tEvent event)
// Create toplevel object
sts = ldh_CreateObject( wnav->ldhses, &objid,
0, classid, pwr_cNObjid, ldh_eDest_IntoLast);
if (EVEN(sts))
wnav->message('E', wnav_get_message(sts));
}
}
else
......@@ -1789,8 +1793,10 @@ static int wnav_brow_cb( FlowCtx *ctx, flow_tEvent event)
{
sts = ldh_MoveObject( wnav->ldhses, sel_list->Objid,
item->objid, destcode);
if ( EVEN(sts)) return sts;
if ( EVEN(sts)) {
wnav->message('E', wnav_get_message(sts));
return sts;
}
// Unselect moved object
if ( wnav->global_unselect_objid_cb)
(wnav->global_unselect_objid_cb)( wnav->parent_ctx, sel_list->Objid);
......
This diff is collapsed.
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