Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
381339e5
Commit
381339e5
authored
Mar 19, 2008
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Internal references wasn't updated correctly at cast
parent
a6c399bf
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
76 additions
and
11 deletions
+76
-11
wb/lib/wb/src/wb_cdef.cpp
wb/lib/wb/src/wb_cdef.cpp
+8
-1
wb/lib/wb/src/wb_cdef.h
wb/lib/wb/src/wb_cdef.h
+3
-1
wb/lib/wb/src/wb_cdrep.cpp
wb/lib/wb/src/wb_cdrep.cpp
+59
-5
wb/lib/wb/src/wb_cdrep.h
wb/lib/wb/src/wb_cdrep.h
+4
-2
wb/lib/wb/src/wb_session.cpp
wb/lib/wb/src/wb_session.cpp
+2
-2
No files found.
wb/lib/wb/src/wb_cdef.cpp
View file @
381339e5
/*
* Proview $Id: wb_cdef.cpp,v 1.1
6 2007-09-19 15:12:16
claes Exp $
* Proview $Id: wb_cdef.cpp,v 1.1
7 2008-03-19 07:31:09
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -22,6 +22,7 @@
#include "wb_cdef.h"
#include "wb_cdrep.h"
#include "wb_object.h"
#include "wb_attribute.h"
wb_cdef
::
wb_cdef
()
:
wb_status
(
LDH__NOCLASS
),
m_cdrep
(
0
)
{
...
...
@@ -167,6 +168,12 @@ void wb_cdef::templateBody( pwr_tStatus *sts, pwr_eBix bix, void *p, pwr_tOid oi
m_cdrep
->
templateBody
(
sts
,
bix
,
p
,
oid
);
}
void
wb_cdef
::
attrTemplateBody
(
pwr_tStatus
*
sts
,
pwr_eBix
bix
,
void
*
p
,
wb_attribute
&
a
)
{
check
();
m_cdrep
->
attrTemplateBody
(
sts
,
bix
,
p
,
a
);
}
size_t
wb_cdef
::
size
(
pwr_eBix
bix
)
{
check
();
...
...
wb/lib/wb/src/wb_cdef.h
View file @
381339e5
/*
* Proview $Id: wb_cdef.h,v 1.1
6 2005-09-06 10:43:31
claes Exp $
* Proview $Id: wb_cdef.h,v 1.1
7 2008-03-19 07:31:09
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -30,6 +30,7 @@ class wb_cdrep;
class
wb_mvrep
;
class
wb_object
;
class
wb_orep
;
class
wb_attribute
;
class
wb_cdef
:
public
wb_status
{
...
...
@@ -65,6 +66,7 @@ public:
wb_bdef
bdef
(
wb_name
bname
);
void
templateBody
(
pwr_tStatus
*
sts
,
pwr_eBix
bix
,
void
*
p
,
pwr_tOid
oid
);
void
attrTemplateBody
(
pwr_tStatus
*
sts
,
pwr_eBix
bix
,
void
*
p
,
wb_attribute
&
a
);
wb_object
classBody
(
const
char
*
bname
);
wb_cdef
super
();
...
...
wb/lib/wb/src/wb_cdrep.cpp
View file @
381339e5
/*
* Proview $Id: wb_cdrep.cpp,v 1.3
4 2007-11-06 16:56:23
claes Exp $
* Proview $Id: wb_cdrep.cpp,v 1.3
5 2008-03-19 07:31:09
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -27,6 +27,7 @@
#include "wb_orepdbs.h"
#include "wb_bdrep.h"
#include "wb_adrep.h"
#include "wb_attribute.h"
extern
"C"
{
#include "rt_conv.h"
}
...
...
@@ -267,6 +268,57 @@ void wb_cdrep::templateBody( pwr_tStatus *sts, pwr_eBix bix, void *p, pwr_tOid o
orep
->
unref
();
}
void
wb_cdrep
::
attrTemplateBody
(
pwr_tStatus
*
sts
,
pwr_eBix
bix
,
void
*
p
,
wb_attribute
&
a
)
{
pwr_tStatus
status
;
pwr_tAttrRef
aref
;
aref
=
a
.
aref
();
if
(
aref
.
Flags
.
b
.
Object
)
{
templateBody
(
sts
,
bix
,
p
,
a
.
aoid
());
return
;
}
// Search for template in localWb
wb_vrep
*
localwb
=
m_orep
->
vrep
()
->
erep
()
->
volume
(
&
status
,
ldh_cWBVolLocal
);
if
(
ODD
(
status
))
{
char
name
[
120
];
sprintf
(
name
,
"Templates-%s"
,
m_orep
->
name
());
wb_name
n
=
wb_name
(
name
);
wb_orep
*
templ
=
localwb
->
object
(
&
status
,
n
);
if
(
ODD
(
status
)
&&
templ
->
cid
()
==
cid
())
{
templ
->
ref
();
localwb
->
readBody
(
&
status
,
templ
,
bix
,
p
);
if
(
ODD
(
status
))
{
if
(
cdh_ObjidIsNotNull
(
a
.
aoid
()))
updateTemplateSubClass
(
a
.
adrep
(),
(
char
*
)
p
,
a
.
aoid
(),
templ
->
oid
(),
aref
.
Offset
);
*
sts
=
LDH__SUCCESS
;
templ
->
unref
();
return
;
}
templ
->
unref
();
}
}
// Get objid for template object
pwr_tOid
oid
;
int
cix
=
cdh_oixToCix
(
m_orep
->
oid
().
oix
);
oid
.
vid
=
m_orep
->
oid
().
vid
;
oid
.
oix
=
cdh_cixToOix
(
cix
,
pwr_eBix_template
,
0
);
wb_orep
*
orep
=
m_orep
->
vrep
()
->
object
(
sts
,
oid
);
if
(
EVEN
(
*
sts
))
return
;
m_orep
->
vrep
()
->
readBody
(
sts
,
orep
,
bix
,
p
);
if
(
cdh_ObjidIsNotNull
(
oid
))
{
updateTemplateSubClass
(
a
.
adrep
(),
(
char
*
)
p
,
a
.
aoid
(),
oid
,
aref
.
Offset
);
}
// Delete
orep
->
ref
();
orep
->
unref
();
}
pwr_mClassDef
wb_cdrep
::
flags
()
{
pwr_sClassDef
*
classdef
;
...
...
@@ -818,7 +870,7 @@ void wb_cdrep::convertObject( wb_merep *merep, void *rbody, void *dbody,
void
wb_cdrep
::
updateTemplateSubClass
(
wb_adrep
*
subattr
,
char
*
body
,
pwr_tOid
oid
,
pwr_tOid
toid
)
pwr_tOid
toid
,
int
aoffs
)
{
pwr_tStatus
sts
;
pwr_tCid
cid
=
subattr
->
subClass
();
...
...
@@ -835,7 +887,7 @@ void wb_cdrep::updateTemplateSubClass( wb_adrep *subattr, char *body, pwr_tOid o
int
elements
=
adrep
->
isArray
()
?
adrep
->
nElement
()
:
1
;
if
(
adrep
->
isClass
())
{
updateTemplateSubClass
(
adrep
,
body
+
i
*
subattr
->
size
()
/
subattr_elements
+
adrep
->
offset
(),
oid
,
toid
);
oid
,
toid
,
aoffs
);
}
else
{
switch
(
adrep
->
type
())
{
...
...
@@ -853,8 +905,10 @@ void wb_cdrep::updateTemplateSubClass( wb_adrep *subattr, char *body, pwr_tOid o
pwr_sAttrRef
*
arp
=
(
pwr_sAttrRef
*
)(
body
+
i
*
subattr
->
size
()
/
subattr_elements
+
adrep
->
offset
());
for
(
int
j
=
0
;
j
<
elements
;
j
++
)
{
if
(
cdh_ObjidIsEqual
(
arp
->
Objid
,
toid
))
if
(
cdh_ObjidIsEqual
(
arp
->
Objid
,
toid
))
{
arp
->
Objid
=
oid
;
arp
->
Offset
+=
aoffs
;
}
arp
++
;
}
break
;
...
...
@@ -885,7 +939,7 @@ void wb_cdrep::updateTemplate( pwr_eBix bix, void *b, pwr_tOid oid, pwr_tOid toi
while
(
ODD
(
sts
))
{
int
elements
=
adrep
->
isArray
()
?
adrep
->
nElement
()
:
1
;
if
(
adrep
->
isClass
())
{
updateTemplateSubClass
(
adrep
,
body
+
adrep
->
offset
(),
oid
,
toid
);
updateTemplateSubClass
(
adrep
,
body
+
adrep
->
offset
(),
oid
,
toid
,
0
);
}
else
{
switch
(
adrep
->
type
())
{
...
...
wb/lib/wb/src/wb_cdrep.h
View file @
381339e5
/*
* Proview $Id: wb_cdrep.h,v 1.2
2 2006-05-24 15:00:41
claes Exp $
* Proview $Id: wb_cdrep.h,v 1.2
3 2008-03-19 07:31:09
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -31,6 +31,7 @@ class wb_mvrep;
class
wb_orep
;
class
wb_orepdbs
;
class
wb_merep
;
class
wb_attribute
;
class
wb_cdrep
{
...
...
@@ -69,6 +70,7 @@ public:
wb_cdrep
*
super
(
pwr_tStatus
*
sts
);
void
templateBody
(
pwr_tStatus
*
sts
,
pwr_eBix
bix
,
void
*
p
,
pwr_tOid
oid
);
void
attrTemplateBody
(
pwr_tStatus
*
sts
,
pwr_eBix
bix
,
void
*
p
,
wb_attribute
&
a
);
void
dbCallBack
(
pwr_tStatus
*
sts
,
ldh_eDbCallBack
cb
,
char
**
methodName
,
pwr_sDbCallBack
**
o
);
wb_orep
*
menu
(
pwr_tStatus
*
sts
,
void
**
o
);
...
...
@@ -85,7 +87,7 @@ public:
void
**
cnv_rbody
,
void
**
cnv_dbody
);
void
updateTemplateSubClass
(
wb_adrep
*
subattr
,
char
*
body
,
pwr_tOid
oid
,
pwr_tOid
toid
);
pwr_tOid
toid
,
int
aoffs
);
void
updateTemplate
(
pwr_eBix
bix
,
void
*
b
,
pwr_tOid
oid
,
pwr_tOid
toid
);
pwr_tStatus
sts
()
{
return
m_sts
;}
ldh_eVolRep
vtype
()
const
;
...
...
wb/lib/wb/src/wb_session.cpp
View file @
381339e5
/*
* Proview $Id: wb_session.cpp,v 1.2
5 2008-02-27 06:31:57
claes Exp $
* Proview $Id: wb_session.cpp,v 1.2
6 2008-03-19 07:31:09
claes Exp $
* Copyright (C) 2005 SSAB Oxelösund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -971,7 +971,7 @@ bool wb_session::castAttribute( pwr_sAttrRef *arp, pwr_tCid cid)
}
void
*
body
=
calloc
(
1
,
c
.
size
(
pwr_eBix_rt
));
c
.
templateBody
(
&
m_sts
,
pwr_eBix_rt
,
body
,
arp
->
Objid
);
c
.
attrTemplateBody
(
&
m_sts
,
pwr_eBix_rt
,
body
,
a
);
try
{
writeAttribute
(
a
,
body
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment