Skip to content

Commit 6776c95

Browse files
author
Nicholas Reed
committed
try to fix strings changed to std::string that still called non-existant chars member function
1 parent 0d5086e commit 6776c95

File tree

8 files changed

+64
-1138
lines changed

8 files changed

+64
-1138
lines changed

src/clprobe-ui/probe.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,7 +1042,7 @@ void Probe::seeSaveComplete(StepEntityEditor *see)
10421042

10431043
std::string seText;
10441044
see->GetStepEntity()->STEPwrite(seText);
1045-
entityInstanceList->ReplaceText(seText.chars(), index) ;
1045+
entityInstanceList->ReplaceText(seText.c_str(), index) ;
10461046

10471047
entityInstanceList->WriteCmdChar(SAVE_COMPLETE_STATE_CHAR,
10481048
SAVE_COMPLETE_STATE_COL, index); // write the state char
@@ -1068,7 +1068,7 @@ void Probe::seeSaveIncomplete(StepEntityEditor *see)
10681068

10691069
std::string seText;
10701070
see->GetStepEntity()->STEPwrite(seText);
1071-
entityInstanceList->ReplaceText(seText.chars(), index);
1071+
entityInstanceList->ReplaceText(seText.c_str(), index);
10721072

10731073
entityInstanceList->WriteCmdChar(SAVE_INCOMPLETE_STATE_CHAR,
10741074
SAVE_INCOMPLETE_STATE_COL, index); // write the state char
@@ -1143,7 +1143,7 @@ void Probe::seeReplicate(StepEntityEditor *see)
11431143
see = (StepEntityEditor *)dn->SEE();
11441144

11451145
seNew->STEPwrite(instanceInfo);
1146-
int index = entityInstanceList->Append( instanceInfo.chars() );
1146+
int index = entityInstanceList->Append( instanceInfo.c_str() );
11471147
mn->ArrayIndex(index);
11481148
entityInstanceList->WriteCmdChar(NEW_STATE_CHAR,
11491149
NEW_STATE_COL, index);
@@ -1490,7 +1490,7 @@ static const unsigned VertCenter = 14;
14901490
// write the new instance to the instance display list
14911491
std::string instanceInfo;
14921492
newEntity->STEPwrite(instanceInfo);
1493-
int index = entityInstanceList->Append( instanceInfo.chars() );
1493+
int index = entityInstanceList->Append( instanceInfo.c_str() );
14941494
mn->ArrayIndex(index);
14951495
entityInstanceList->WriteCmdChar(NEW_STATE_CHAR,
14961496
NEW_STATE_COL, index);
@@ -1711,7 +1711,7 @@ void Probe::WriteInstance(int index)
17111711
MgrNode *mn = instMgr -> GetMgrNode (index);
17121712

17131713
mn->GetSTEPentity()->STEPwrite(instanceInfo);
1714-
entityInstanceList->Append( instanceInfo.chars() );
1714+
entityInstanceList->Append( instanceInfo.c_str() );
17151715
switch(mn->CurrState())
17161716
{
17171717
/*
@@ -2006,7 +2006,7 @@ void Probe::CreateInstanceCmd()
20062006
see = (StepEntityEditor *)dn->SEE();
20072007

20082008
se->STEPwrite(instanceInfo);
2009-
int index = entityInstanceList->Append( instanceInfo.chars() );
2009+
int index = entityInstanceList->Append( instanceInfo.c_str() );
20102010
mn->ArrayIndex(index);
20112011
entityInstanceList->WriteCmdChar(NEW_STATE_CHAR,
20122012
NEW_STATE_COL, index);
@@ -3079,7 +3079,7 @@ void Probe::sedlReplicate(MgrNode *existMN, int index)
30793079
StepEntityEditor *see = (StepEntityEditor *)dn->SEE();
30803080

30813081
seNew->STEPwrite(instanceInfo);
3082-
int newIndex = entityInstanceList->Append( instanceInfo.chars() );
3082+
int newIndex = entityInstanceList->Append( instanceInfo.c_str() );
30833083
mn->ArrayIndex(newIndex);
30843084
entityInstanceList->WriteCmdChar(NEW_STATE_CHAR,
30853085
NEW_STATE_COL, newIndex);

src/clprobe-ui/stepentdescriptor.cc

Lines changed: 1 addition & 145 deletions
Original file line numberDiff line numberDiff line change
@@ -50,38 +50,6 @@ extern struct Hash_Table *TypeDictionary;
5050

5151
extern Probe *dp;
5252

53-
/*
54-
StepEntityDescriptor *GetStepEntityDescriptor(char *e)
55-
{
56-
57-
// EntityDescriptor & entDesc =
58-
// (EntityDescriptor *)HASHfind(EntityDictionary, StrToUpper(e));
59-
// return new StepEntityDescriptor(entDesc);
60-
}
61-
*/
62-
63-
/*
64-
Interactor *InsertInteractor (Interactor * i, Interactor * i2, Alignment align)
65-
{
66-
extern World* dp_world;
67-
68-
Frame* framedInteractor = new Frame(i, 2);
69-
Coord x, y;
70-
71-
// if(i2->IsMapped()){
72-
i2->Align(BottomCenter, i->GetShape()->width, i->GetShape()->height, x, y);
73-
i2->GetRelative(x, y, dp_world);
74-
dp_world->InsertTransient(framedInteractor, i2, x, y, align);
75-
// } else {
76-
// x = y = 0;
77-
// dp_world->InsertTransient(framedInteractor, i2, x, y, align);
78-
// }
79-
return(framedInteractor);
80-
}
81-
82-
//////////////////////////////////
83-
84-
*/
8553
void RemoveInteractor (Interactor* i, Interactor *i2)
8654
{
8755
Frame* framedInteractor = (Frame*) i->Parent();
@@ -91,8 +59,6 @@ void RemoveInteractor (Interactor* i, Interactor *i2)
9159
delete framedInteractor;
9260
}
9361

94-
//////////////////////////////////////////////////////////////////////////
95-
9662
Interactor* AddRightScroller (Interactor* grid)
9763
{
9864
return new HBox (
@@ -161,7 +127,6 @@ void EntityDescriptorBlock::Init(const EntityDescriptor *e, ButtonState *typeMes
161127
// determine the height of the box as the highest of the attribute
162128
// box or subtype box.
163129
int entryCount = max(attrCount, subtypeCount);
164-
//////////////////
165130

166131
std::string str;
167132
char endchar;
@@ -180,57 +145,15 @@ void EntityDescriptorBlock::Init(const EntityDescriptor *e, ButtonState *typeMes
180145
str.Append('<');
181146
endchar = '>';
182147
}
183-
/* // for when inverse information is included
184-
else if( ad->Inverse() == OPLOG(LTrue) )
185-
{
186-
str.Append('(');
187-
endchar = ')';
188-
}
189-
*/
190148
std::string tmp;
191149
str.Append( ad->AttrExprDefStr(tmp) );
192-
/* // built by hand
193-
str.Append( ad->Name() );
194-
str.Append( " : " );
195-
if( ad->Optional() == OPLOG(LTrue) )
196-
{
197-
str.Append("OPTIONAL ");
198-
}
199-
str.Append( attrPtr->AttrDesc()->DomainType()->AttrTypeName() );
200-
*/
201150
str.Append( endchar );
202151

203-
////////////////////
204-
attrListBrowser->Append(str.chars());
205-
206-
/*
207-
attrDefinition = str.chars();
208-
const char *attrDefPtr = attrDefinition;
209-
210-
char attrStr[maxAttrLen + 1];
211-
attrStr[0] = 0;
212-
213-
strncpy(attrStr, attrDefPtr, maxAttrLen);
214-
attrStr[maxAttrLen] = 0;
215-
attrListBrowser->Append(attrStr);
216-
217-
// if the attr def was longer than maxAttrLen continue the definition
218-
// on lines following starting 5 spaces in.
219-
attrDefPtr = &attrDefPtr[maxAttrLen];
220-
while(strlen(attrDefPtr) > 0)
221-
{
222-
memset(attrStr, ' ', 5);
223-
memset(attrStr + 5, 0, maxAttrLen - 4);
224-
strncat(attrStr, attrDefPtr, maxAttrLen - 5);
225-
attrListBrowser->Append(attrStr);
226-
attrDefPtr = &attrDefPtr[strlen(attrStr) - 5];
227-
}
228-
*/
152+
attrListBrowser->Append(str.c_str());
229153

230154
attrPtr = (AttrDescLinkNode *)attrPtr->NextNode();
231155
}
232156

233-
//////////////
234157
subtypeListBrowser = new StringBrowser(subtypeBS, entryCount, maxSubtypeLen);
235158
EntityDescLinkNode *subtypePtr =
236159
(EntityDescLinkNode *)subtypeList->GetHead();
@@ -243,9 +166,6 @@ void EntityDescriptorBlock::Init(const EntityDescriptor *e, ButtonState *typeMes
243166

244167
Interactor *EntityDescriptorBlock::Body()
245168
{
246-
// Message *attrsAndSubtypesTitle = new Message("attributes & subtypes");
247-
// Message *attrsTitle = new Message("attributes");
248-
// Message *subtypesTitle = new Message("subtypes");
249169
attrSubtypeBox = new HBox(
250170
AddRightScroller(attrListBrowser),
251171
new VBorder,
@@ -264,16 +184,13 @@ Interactor *EntityDescriptorBlock::Body()
264184
bodyBox = new VBox(
265185
new HBox(
266186
name,
267-
// new HGlue(round(.02*inch), round(.02*inch), 0),
268-
// attrsAndSubtypesTitle,
269187
new HBox(
270188
new HGlue(round(.5*inch), round(.5*inch), hfil),
271189
schemaMessage,
272190
new HGlue(round(.2*inch), round(.2*inch), 0),
273191
openCloseBut
274192
),
275193
new HGlue(round(.02*inch), round(.02*inch), 0)
276-
// new HGlue(round(.5*inch), round(.5*inch), hfil)
277194
),
278195
new HBorder,
279196
attrSubtypeBox
@@ -346,26 +263,18 @@ void EntityDescriptorBlock::Update()
346263
attrPtr = (AttrDescLinkNode *)attrPtr->NextNode();
347264
}
348265
std::string tmp;
349-
// attrStr = attrPtr->AttrDesc()->AttrExprDefStr(tmp);
350-
351-
// attrStr = TypeString(attrPtr->AttrDesc());
352266
std::string tmp2;
353267
strncpy(attrStr,
354268
attrPtr->AttrDesc()->DomainType()->TypeString(tmp2),
355269
BUFSIZ);
356270
attrStr[BUFSIZ-1] = 0;
357271

358-
// AttrDescriptorList *attrDescList = ed->ExplicitAttr();
359-
// AttrDescriptor *attrDesc = attrDescList->GetHead();
360-
361-
// char * attrStr = attrListBrowser->String(index);
362272
typeMsg->SetValue((char *)attrStr);
363273
cout << "Selected attr: '" << attrStr << "'\n";
364274
}
365275
}
366276

367277
openCloseBS->GetValue(val);
368-
// openCloseBS->SetValue(0);
369278
if(val != lastCloseVal)
370279
{
371280
if(val == 1)
@@ -383,8 +292,6 @@ void EntityDescriptorBlock::Update()
383292
lastCloseVal = val;
384293
}
385294

386-
///////////////////////////////////////////////////////////////////////////////
387-
388295
EntityDescBlockNode *
389296
EntityDescBlockList::PrependNode (EntityDescriptorBlock * edb)
390297
{
@@ -399,23 +306,6 @@ EntityDescBlockList::PrependNode (EntityDescriptorBlock * edb)
399306
return node;
400307
}
401308

402-
///////////////////////////////////////////////////////////////////////////////
403-
404-
/*
405-
StepEntityDescriptor::StepEntityDescriptor()
406-
{
407-
edbList = new EntityDescBlockList;
408-
Scene::Insert(new HBorder(2));
409-
entDesc = 0;
410-
411-
closeBS = new ButtonState(0);
412-
closeBS->Attach(this);
413-
close = new PushButton("close", closeBS, 1);
414-
entDesc = ed;
415-
416-
}
417-
*/
418-
419309
char *
420310
StepEntityDescriptor::LongestAttrInBlock(const EntityDescriptor *entity)
421311
{
@@ -439,13 +329,6 @@ StepEntityDescriptor::LongestAttrInBlock(const EntityDescriptor *entity)
439329
{
440330
attrLen = attrLen + 2;
441331
}
442-
/*
443-
// for when inverse information is else included
444-
else if( attrPtr->AttrDesc()->Inverse() == OPLOG(LTrue) )
445-
{
446-
attrLen = attrLen + 2;
447-
}
448-
*/
449332

450333
if(attrLen > longestLen)
451334
{
@@ -495,7 +378,6 @@ StepEntityDescriptor::FindLongestAttribute()
495378
}
496379
return longestAttrStr;
497380
}
498-
//////////////////
499381

500382
char *
501383
StepEntityDescriptor::LongestSubtNameInBlock(const EntityDescriptor *entity)
@@ -558,7 +440,6 @@ StepEntityDescriptor::FindLongestSubtName()
558440
}
559441
return longestSubtypeStr;
560442
}
561-
//////////////////
562443

563444
StepEntityDescriptor::StepEntityDescriptor(const EntityDescriptor *ed)
564445
{
@@ -580,8 +461,6 @@ StepEntityDescriptor::StepEntityDescriptor(const EntityDescriptor *ed)
580461
)
581462
);
582463

583-
584-
///////////////
585464
int maxAttrLen = strlen(FindLongestAttribute());
586465
int len = 5;
587466
maxAttrLen = max(maxAttrLen, len);
@@ -592,7 +471,6 @@ StepEntityDescriptor::StepEntityDescriptor(const EntityDescriptor *ed)
592471
strDispBS = new ButtonState(0);
593472
strDispBS->Attach(this);
594473
strDisp = new StringDisplay(strDispBS, " ");
595-
//////////////
596474
edbList->PrependNode(new EntityDescriptorBlock(ed, strDispBS, maxAttrLen,
597475
maxSubtypeLen));
598476

@@ -628,14 +506,6 @@ StepEntityDescriptor::StepEntityDescriptor(const EntityDescriptor *ed)
628506
);
629507
}
630508

631-
/*
632-
StepEntityDescriptor::StepEntityDescriptor(Interactor *i) : (i)
633-
{
634-
edbList = new EntityDescBlockList;
635-
Scene::Insert(new HBorder(2));
636-
}
637-
*/
638-
639509
void StepEntityDescriptor::Insert(Interactor *i)
640510
{
641511
Scene::Insert(i);
@@ -657,12 +527,9 @@ void StepEntityDescriptor::Update()
657527
if (val == 1)
658528
{
659529
dp->RemoveSED(this);
660-
// RemoveInteractor (this, this);
661530
cout << "close entity display" << "\n";
662531
}
663532
char *strVal = 0;
664-
// strDispBS->GetValue(strVal); // this no longer works with Sun
665-
// C++ => error. Must assign as below DAS
666533
void * tmpVoidPtr = 0;
667534
strDispBS->GetValue(tmpVoidPtr);
668535
strVal = (char *) tmpVoidPtr;
@@ -672,18 +539,7 @@ void StepEntityDescriptor::Update()
672539
strDisp->Message(strVal);
673540
}
674541

675-
// boolean i.e. true = 1 and false = 0
676542
boolean StepEntityDescriptor::IsMapped()
677543
{
678544
return (canvas != nil && canvas->status() == Canvas::mapped);
679-
/*
680-
if(canvas)
681-
{
682-
// this doesn't work
683-
int bool = canvas->window()->is_mapped();
684-
return bool;
685-
}
686-
else
687-
return false;
688-
*/
689545
}

0 commit comments

Comments
 (0)