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
c68d706c
Commit
c68d706c
authored
Sep 20, 2007
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Classeditor: if attribute or type renamed, change in class definition is made
parent
b5c89192
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
96 additions
and
22 deletions
+96
-22
wb/lib/wb/src/wb_adrep.cpp
wb/lib/wb/src/wb_adrep.cpp
+6
-1
wb/lib/wb/src/wb_adrep.h
wb/lib/wb/src/wb_adrep.h
+2
-1
wb/lib/wb/src/wb_tdrep.cpp
wb/lib/wb/src/wb_tdrep.cpp
+10
-6
wb/lib/wb/src/wb_tdrep.h
wb/lib/wb/src/wb_tdrep.h
+4
-3
wb/lib/wb/src/wb_vrepmem.cpp
wb/lib/wb/src/wb_vrepmem.cpp
+71
-10
wb/lib/wb/src/wb_vrepmem.h
wb/lib/wb/src/wb_vrepmem.h
+3
-1
No files found.
wb/lib/wb/src/wb_adrep.cpp
View file @
c68d706c
/*
* Proview $Id: wb_adrep.cpp,v 1.
19 2005-10-07 05:57:2
8 claes Exp $
* Proview $Id: wb_adrep.cpp,v 1.
20 2007-09-20 15:09:1
8 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -341,3 +341,8 @@ void *wb_adrep::body( void *p)
return
m_orep
->
vrep
()
->
readBody
(
&
sts
,
m_orep
,
pwr_eBix_sys
,
p
);
}
bool
wb_adrep
::
renameAttribute
(
pwr_tStatus
*
sts
,
wb_name
&
name
)
{
return
m_orep
->
vrep
()
->
renameObject
(
sts
,
m_orep
,
name
);
}
wb/lib/wb/src/wb_adrep.h
View file @
c68d706c
/*
* Proview $Id: wb_adrep.h,v 1.1
8 2005-09-06 10:43:30
claes Exp $
* Proview $Id: wb_adrep.h,v 1.1
9 2007-09-20 15:09:18
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -90,6 +90,7 @@ public:
const
char
*
subName
()
const
;
wb_name
longName
();
void
*
body
(
void
*
p
=
0
);
bool
renameAttribute
(
pwr_tStatus
*
sts
,
wb_name
&
name
);
wb_vrep
*
vrep
()
const
;
};
...
...
wb/lib/wb/src/wb_tdrep.cpp
View file @
c68d706c
/*
* Proview $Id: wb_tdrep.cpp,v 1.
9 2005-09-06 10:43:32
claes Exp $
* Proview $Id: wb_tdrep.cpp,v 1.
10 2007-09-20 15:09:18
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -46,7 +46,7 @@ wb_tdrep::wb_tdrep() : m_nRef(0), m_orep(0), m_sts(LDH__NOCLASS)
wb_tdrep
::
wb_tdrep
(
wb_mvrep
*
mvrep
,
pwr_tTid
tid
)
:
m_nRef
(
0
)
{
pwr_tOid
oid
=
cdh_TypeIdToObjid
(
tid
);
m_orep
=
(
wb_orepdbs
*
)
mvrep
->
object
(
&
m_sts
,
oid
);
m_orep
=
mvrep
->
object
(
&
m_sts
,
oid
);
if
(
EVEN
(
m_sts
))
throw
wb_error
(
m_sts
);
m_orep
->
ref
();
...
...
@@ -60,7 +60,7 @@ wb_tdrep::wb_tdrep( wb_mvrep *mvrep, wb_name name) : m_nRef(0)
strcpy
(
str
,
"Type-"
);
strcat
(
str
,
name
.
object
());
wb_name
n
=
wb_name
(
str
);
m_orep
=
(
wb_orepdbs
*
)
mvrep
->
object
(
&
m_sts
,
n
);
m_orep
=
mvrep
->
object
(
&
m_sts
,
n
);
if
(
EVEN
(
m_sts
))
throw
wb_error
(
m_sts
);
m_orep
->
ref
();
...
...
@@ -71,7 +71,7 @@ wb_tdrep::wb_tdrep( wb_mvrep *mvrep, wb_name name) : m_nRef(0)
wb_tdrep
::
wb_tdrep
(
wb_mvrep
*
mvrep
,
const
wb_adrep
&
a
)
:
m_nRef
(
0
)
{
pwr_tOid
oid
=
cdh_TypeIdToObjid
(
a
.
type
());
m_orep
=
(
wb_orepdbs
*
)
mvrep
->
object
(
&
m_sts
,
oid
);
m_orep
=
mvrep
->
object
(
&
m_sts
,
oid
);
if
(
EVEN
(
m_sts
))
throw
wb_error
(
m_sts
);
m_orep
->
ref
();
...
...
@@ -105,7 +105,7 @@ void wb_tdrep::init()
{
pwr_sTypeDef
body
;
m_orep
->
m_vrep
->
readBody
(
&
sts
,
m_orep
,
pwr_eBix_sys
,
(
void
*
)
&
body
);
m_orep
->
vrep
()
->
readBody
(
&
sts
,
m_orep
,
pwr_eBix_sys
,
(
void
*
)
&
body
);
if
(
EVEN
(
sts
))
throw
wb_error
(
sts
);
m_size
=
body
.
Size
;
...
...
@@ -118,7 +118,7 @@ void wb_tdrep::init()
{
pwr_sTypeDef
body
;
m_orep
->
m_vrep
->
readBody
(
&
sts
,
m_orep
,
pwr_eBix_sys
,
(
void
*
)
&
body
);
m_orep
->
vrep
()
->
readBody
(
&
sts
,
m_orep
,
pwr_eBix_sys
,
(
void
*
)
&
body
);
if
(
EVEN
(
sts
))
throw
wb_error
(
sts
);
m_size
=
body
.
Size
;
...
...
@@ -142,3 +142,7 @@ wb_name wb_tdrep::longName()
return
m_orep
->
longName
();
}
bool
wb_tdrep
::
renameType
(
pwr_tStatus
*
sts
,
wb_name
&
name
)
{
return
m_orep
->
vrep
()
->
renameObject
(
sts
,
m_orep
,
name
);
}
wb/lib/wb/src/wb_tdrep.h
View file @
c68d706c
/*
* Proview $Id: wb_tdrep.h,v 1.
8 2005-09-06 10:43:32
claes Exp $
* Proview $Id: wb_tdrep.h,v 1.
9 2007-09-20 15:09:18
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -26,13 +26,13 @@
class
wb_adrep
;
class
wb_mrepdbs
;
class
wb_orep
dbs
;
class
wb_orep
;
class
wb_mvrep
;
class
wb_tdrep
{
int
m_nRef
;
wb_orep
dbs
*
m_orep
;
wb_orep
*
m_orep
;
int
m_sts
;
pwr_eType
m_type
;
...
...
@@ -58,6 +58,7 @@ public:
const
char
*
name
()
const
;
wb_name
longName
();
bool
renameType
(
pwr_tStatus
*
sts
,
wb_name
&
name
);
pwr_tStatus
sts
()
{
return
m_sts
;}
...
...
wb/lib/wb/src/wb_vrepmem.cpp
View file @
c68d706c
/*
* Proview $Id: wb_vrepmem.cpp,v 1.2
4 2007-09-19 15:18:34
claes Exp $
* Proview $Id: wb_vrepmem.cpp,v 1.2
5 2007-09-20 15:09:18
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -1171,15 +1171,8 @@ bool wb_vrepmem::renameObject(pwr_tStatus *sts, wb_orep *orep, wb_name &name)
return
LDH__NAMALREXI
;
}
if
(
m_classeditor
&&
memo
->
m_cid
==
pwr_eClass_ClassDef
)
{
pwr_tCid
cid
=
cdh_ClassObjidToId
(
memo
->
m_oid
);
wb_cdrep
*
cdrep
=
m_merep
->
cdrep
(
sts
,
cid
);
if
(
cdrep
)
{
cdrep
->
renameClass
(
sts
,
name
);
printf
(
"cdrep: %s
\n
"
,
cdrep
->
name
());
}
}
if
(
m_classeditor
)
classeditorRenameObject
(
memo
,
old_name
,
name
);
memo
->
m_ohtime
=
time
;
...
...
@@ -1934,6 +1927,74 @@ bool wb_vrepmem::abort(pwr_tStatus *sts)
}
void
wb_vrepmem
::
classeditorRenameObject
(
mem_object
*
memo
,
char
*
oldname
,
wb_name
&
name
)
{
pwr_tStatus
sts
;
switch
(
memo
->
m_cid
)
{
case
pwr_eClass_ClassDef
:
{
pwr_tCid
cid
=
cdh_ClassObjidToId
(
memo
->
m_oid
);
try
{
wb_cdrep
*
cdrep
=
m_merep
->
cdrep
(
&
sts
,
cid
);
if
(
cdrep
)
{
cdrep
->
renameClass
(
&
sts
,
name
);
delete
cdrep
;
}
}
catch
(
wb_error
&
e
)
{
}
break
;
}
case
pwr_eClass_Param
:
case
pwr_eClass_Intern
:
case
pwr_eClass_Input
:
case
pwr_eClass_Output
:
case
pwr_eClass_ObjXRef
:
case
pwr_eClass_AttrXRef
:
case
pwr_eClass_Buffer
:
{
if
(
!
memo
->
fth
||
!
memo
->
fth
->
fth
)
break
;
pwr_tCid
cid
=
cdh_ClassObjidToId
(
memo
->
fth
->
fth
->
m_oid
);
try
{
wb_cdrep
*
cdrep
=
m_merep
->
cdrep
(
&
sts
,
cid
);
if
(
!
cdrep
)
break
;
wb_bdrep
*
bdrep
=
cdrep
->
bdrep
(
&
sts
,
memo
->
fth
->
m_name
);
delete
cdrep
;
if
(
!
bdrep
)
break
;
wb_adrep
*
adrep
=
bdrep
->
adrep
(
&
sts
,
oldname
);
delete
bdrep
;
if
(
!
adrep
)
break
;
adrep
->
renameAttribute
(
&
sts
,
name
);
delete
adrep
;
}
catch
(
wb_error
&
e
)
{
}
break
;
}
case
pwr_eClass_TypeDef
:
{
pwr_tTid
tid
=
cdh_TypeObjidToId
(
memo
->
m_oid
);
try
{
wb_tdrep
*
tdrep
=
m_merep
->
tdrep
(
&
sts
,
tid
);
if
(
tdrep
)
{
tdrep
->
renameType
(
&
sts
,
name
);
delete
tdrep
;
}
}
catch
(
wb_error
&
e
)
{
}
break
;
}
default:
;
}
}
bool
wb_vrepmem
::
classeditorCheck
(
ldh_eDest
dest_code
,
mem_object
*
dest
,
pwr_tCid
cid
,
pwr_tOix
*
oix
,
char
*
name
,
pwr_tStatus
*
sts
,
bool
import_paste
)
...
...
wb/lib/wb/src/wb_vrepmem.h
View file @
c68d706c
/*
* Proview $Id: wb_vrepmem.h,v 1.
19 2007-09-19 15:18:34
claes Exp $
* Proview $Id: wb_vrepmem.h,v 1.
20 2007-09-20 15:09:18
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -374,6 +374,8 @@ public:
bool
classeditorCheckMove
(
mem_object
*
memo
,
ldh_eDest
dest_code
,
mem_object
*
dest
,
pwr_tStatus
*
sts
);
void
classeditorCommit
();
void
classeditorRenameObject
(
mem_object
*
memo
,
char
*
oldname
,
wb_name
&
name
);
private:
bool
nameCheck
(
mem_object
*
memo
);
...
...
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