973c2be1 |
1 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
2 | // |
973c2be1 |
3 | // This file is part of Open CASCADE Technology software library. |
b311480e |
4 | // |
d5f74e42 |
5 | // This library is free software; you can redistribute it and/or modify it under |
6 | // the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
7 | // by the Free Software Foundation, with special exception defined in the file |
8 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
9 | // distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
10 | // |
973c2be1 |
11 | // Alternatively, this file may be used under the terms of Open CASCADE |
12 | // commercial license or contractual agreement. |
b311480e |
13 | |
7fd59977 |
14 | #include <IFSelect_EditForm.ixx> |
15 | #include <Interface_TypedValue.hxx> |
16 | #include <Interface_MSG.hxx> |
17 | #include <Message_Messenger.hxx> |
18 | #include <Message.hxx> |
ec357c5c |
19 | #include <TCollection_HAsciiString.hxx> |
20 | #include <TColStd_HSequenceOfHAsciiString.hxx> |
7fd59977 |
21 | |
b311480e |
22 | IFSelect_EditForm::IFSelect_EditForm |
7fd59977 |
23 | (const Handle(IFSelect_Editor)& editor, |
24 | const Standard_Boolean readonly, const Standard_Boolean undoable, |
25 | const Standard_CString label) |
26 | : thecomplete (Standard_True) , |
27 | theloaded (Standard_False) , |
28 | thekeepst (Standard_False) , |
29 | thelabel (label) , |
30 | thenums (0,1) , |
31 | theorigs (0, (undoable ? editor->NbValues() : 0) ) , |
32 | themodifs (0, (readonly ? 0 : editor->NbValues()) ) , |
33 | thestatus (0, (readonly ? 0 : editor->NbValues()) ) , |
34 | theeditor (editor) , |
35 | thetouched (0) { } |
36 | |
37 | IFSelect_EditForm::IFSelect_EditForm |
38 | (const Handle(IFSelect_Editor)& editor, |
39 | const TColStd_SequenceOfInteger& nums, |
40 | const Standard_Boolean readonly, const Standard_Boolean undoable, |
41 | const Standard_CString label) |
42 | : thecomplete (Standard_False) , |
43 | theloaded (Standard_False) , |
44 | thekeepst (Standard_False) , |
45 | thelabel (label) , |
46 | thenums (0,nums.Length()) , |
47 | theorigs (0, (undoable ? nums.Length() : 0) ) , |
48 | themodifs (0, (readonly ? 0 : nums.Length()) ) , |
49 | thestatus (0, (readonly ? 0 : nums.Length()) ) , |
50 | theeditor (editor) , |
51 | thetouched (0) |
52 | { |
53 | Standard_Integer i,nb = nums.Length(); |
54 | for (i = 1; i <= nb; i ++) thenums.SetValue (i,nums.Value(i)); |
55 | } |
56 | |
57 | Standard_Boolean& IFSelect_EditForm::EditKeepStatus () |
58 | { return thekeepst; } |
59 | |
60 | Standard_CString IFSelect_EditForm::Label () const |
61 | { return thelabel.ToCString(); } |
62 | |
63 | Standard_Boolean IFSelect_EditForm::IsLoaded () const |
64 | { return theloaded; } |
65 | |
66 | void IFSelect_EditForm::ClearData () |
67 | { theent.Nullify(); themodel.Nullify(); theloaded = Standard_False; } |
68 | |
69 | void IFSelect_EditForm::SetData |
70 | (const Handle(Standard_Transient)& ent, |
71 | const Handle(Interface_InterfaceModel)& model) |
72 | { theent = ent; themodel = model; } |
73 | |
74 | void IFSelect_EditForm::SetEntity |
75 | (const Handle(Standard_Transient)& ent) |
76 | { theent = ent; } |
77 | |
78 | void IFSelect_EditForm::SetModel |
79 | (const Handle(Interface_InterfaceModel)& model) |
80 | { themodel = model; } |
81 | |
82 | Handle(Standard_Transient) IFSelect_EditForm::Entity () const |
83 | { return theent; } |
84 | |
85 | Handle(Interface_InterfaceModel) IFSelect_EditForm::Model () const |
86 | { return themodel; } |
87 | |
88 | Handle(IFSelect_Editor) IFSelect_EditForm::Editor () const |
89 | { return theeditor; } |
90 | |
91 | Standard_Boolean IFSelect_EditForm::IsComplete () const |
92 | { return thecomplete; } |
93 | |
94 | Standard_Integer IFSelect_EditForm::NbValues |
95 | (const Standard_Boolean editable) const |
96 | { |
97 | if (!editable || thecomplete) return theeditor->NbValues(); |
98 | return thenums.Upper(); |
99 | } |
100 | |
101 | Standard_Integer IFSelect_EditForm::NumberFromRank |
102 | (const Standard_Integer rank) const |
103 | { |
104 | if (thecomplete) return rank; |
105 | if (rank < 1 || rank > thenums.Upper()) return 0; |
106 | return thenums.Value(rank); |
107 | } |
108 | |
109 | Standard_Integer IFSelect_EditForm::RankFromNumber |
110 | (const Standard_Integer num) const |
111 | { |
112 | if (thecomplete) return num; |
113 | Standard_Integer i, n = thenums.Upper(); |
114 | for (i = 1; i <= n; i ++) { |
115 | if (thenums.Value(i) == num) return i; |
116 | } |
117 | return 0; |
118 | } |
119 | |
120 | Standard_Integer IFSelect_EditForm::NameNumber |
121 | (const Standard_CString name) const |
122 | { |
123 | Standard_Integer res = theeditor->NameNumber(name); |
124 | if (thecomplete || res == 0) return res; |
125 | // Sinon, chercher res dans thenums |
126 | Standard_Integer i, nb = thenums.Length(); |
127 | for (i = 1; i <= nb; i ++) { |
128 | if (res == thenums.Value(i)) return res; |
129 | } |
130 | return -res; |
131 | } |
132 | |
133 | Standard_Integer IFSelect_EditForm::NameRank |
134 | (const Standard_CString name) const |
135 | { |
136 | Standard_Integer res = theeditor->NameNumber(name); |
137 | if (thecomplete || res == 0) return res; |
138 | // Sinon, chercher res dans thenums |
139 | Standard_Integer i, nb = thenums.Length(); |
140 | for (i = 1; i <= nb; i ++) { |
141 | if (res == thenums.Value(i)) return i; |
142 | } |
143 | return 0; |
144 | } |
145 | |
146 | |
147 | void IFSelect_EditForm::LoadDefault () |
148 | { |
149 | theloaded = Standard_True; |
150 | thetouched = 0; |
151 | Standard_Integer i,nb = theorigs.Upper(); |
152 | if (nb == 0) return; |
153 | for (i = 1; i <= nb; i ++) { |
154 | Standard_Integer num = NumberFromRank(i); |
155 | if (num == 0) continue; |
156 | Handle(TCollection_HAsciiString) str = theeditor->StringValue (this,num); |
157 | theorigs.SetValue (i,str); |
158 | } |
159 | } |
160 | |
161 | |
162 | Standard_Boolean IFSelect_EditForm::LoadData |
163 | (const Handle(Standard_Transient)& ent, |
164 | const Handle(Interface_InterfaceModel)& model) |
165 | { |
166 | thetouched = 0; |
167 | if (!theeditor->Load (this,ent,model)) return Standard_False; |
168 | SetData (ent,model); |
169 | theloaded = Standard_True; |
170 | return Standard_True; |
171 | } |
172 | |
173 | Standard_Boolean IFSelect_EditForm::LoadEntity |
174 | (const Handle(Standard_Transient)& ent) |
175 | { |
176 | thetouched = 0; |
177 | Handle(Interface_InterfaceModel) model; |
178 | if (!theeditor->Load (this,ent,model)) return Standard_False; |
179 | SetEntity (ent); |
180 | theloaded = Standard_True; |
181 | return Standard_True; |
182 | } |
183 | |
184 | Standard_Boolean IFSelect_EditForm::LoadModel |
185 | (const Handle(Interface_InterfaceModel)& model) |
186 | { |
187 | thetouched = 0; |
188 | Handle(Standard_Transient) ent; |
189 | if (!theeditor->Load (this,ent,model)) return Standard_False; |
190 | SetData (ent,model); |
191 | theloaded = Standard_True; |
192 | return Standard_True; |
193 | } |
194 | |
195 | Standard_Boolean IFSelect_EditForm::LoadData () |
196 | { |
197 | thetouched = 0; |
198 | Handle(Interface_InterfaceModel) model; |
199 | Handle(Standard_Transient) ent; |
200 | if (!theeditor->Load (this,ent,model)) return Standard_False; |
201 | theloaded = Standard_True; |
202 | return Standard_True; |
203 | } |
204 | |
205 | |
206 | // ######## VALUES ######## |
207 | |
208 | Handle(IFSelect_ListEditor) IFSelect_EditForm::ListEditor |
209 | (const Standard_Integer num) const |
210 | { |
211 | Standard_Integer n = RankFromNumber(num); |
212 | Handle(IFSelect_ListEditor) led; |
213 | if (n <= 0 || n > theorigs.Upper()) return led; |
214 | if (!theeditor->IsList(n)) return led; |
215 | led = theeditor->ListEditor (num); |
216 | Handle(TColStd_HSequenceOfHAsciiString) lis = theeditor->ListValue(this,num); |
217 | led->LoadModel (themodel); |
218 | led->LoadValues (lis); |
219 | return led; |
220 | } |
221 | |
222 | void IFSelect_EditForm::LoadValue |
223 | (const Standard_Integer num, const Handle(TCollection_HAsciiString)& val) |
224 | { |
225 | Standard_Integer n = RankFromNumber(num); |
226 | if (n <= 0 || n > theorigs.Upper()) return; |
227 | theorigs.SetValue (n,val); |
228 | } |
229 | |
230 | void IFSelect_EditForm::LoadList |
231 | (const Standard_Integer num, const Handle(TColStd_HSequenceOfHAsciiString)& list) |
232 | { |
233 | Standard_Integer n = RankFromNumber(num); |
234 | if (n <= 0 || n > theorigs.Upper()) return; |
235 | theorigs.SetValue (n,list); |
236 | } |
237 | |
238 | |
239 | Handle(TCollection_HAsciiString) IFSelect_EditForm::OriginalValue |
240 | (const Standard_Integer num) const |
241 | { |
242 | Standard_Integer n = RankFromNumber(num); |
243 | Handle(TCollection_HAsciiString) val; |
244 | if (theorigs.Upper() == 0) return theeditor->StringValue (this,num); |
245 | else return Handle(TCollection_HAsciiString)::DownCast(theorigs.Value(n)); |
246 | } |
247 | |
248 | Handle(TColStd_HSequenceOfHAsciiString) IFSelect_EditForm::OriginalList |
249 | (const Standard_Integer num) const |
250 | { |
251 | Standard_Integer n = RankFromNumber(num); |
252 | Handle(TColStd_HSequenceOfHAsciiString) list; |
253 | if (theorigs.Upper() == 0) return theeditor->ListValue (this,num); |
254 | else return Handle(TColStd_HSequenceOfHAsciiString)::DownCast(theorigs.Value(n)); |
255 | } |
256 | |
257 | Handle(TCollection_HAsciiString) IFSelect_EditForm::EditedValue |
258 | (const Standard_Integer num) const |
259 | { |
260 | if (themodifs.Upper() == 0) return OriginalValue(num); |
261 | if (!IsModified(num)) return OriginalValue(num); |
262 | Standard_Integer n = RankFromNumber(num); |
263 | return Handle(TCollection_HAsciiString)::DownCast(themodifs.Value(n)); |
264 | } |
265 | |
266 | Handle(TColStd_HSequenceOfHAsciiString) IFSelect_EditForm::EditedList |
267 | (const Standard_Integer num) const |
268 | { |
269 | if (themodifs.Upper() == 0) return OriginalList(num); |
270 | if (!IsModified(num)) return OriginalList(num); |
271 | Standard_Integer n = RankFromNumber(num); |
272 | return Handle(TColStd_HSequenceOfHAsciiString)::DownCast(themodifs.Value(n)); |
273 | } |
274 | |
275 | |
276 | Standard_Boolean IFSelect_EditForm::IsModified |
277 | (const Standard_Integer num) const |
278 | { |
279 | if (thestatus.Upper() == 0) return Standard_False; |
280 | Standard_Integer n = RankFromNumber(num); |
281 | return (thestatus.Value(n) != 0); |
282 | } |
283 | |
284 | Standard_Boolean IFSelect_EditForm::IsTouched |
285 | (const Standard_Integer num) const |
286 | { |
287 | if (thestatus.Upper() == 0) return Standard_False; |
288 | Standard_Integer n = RankFromNumber(num); |
289 | return (thestatus.Value(n) == 2); |
290 | } |
291 | |
292 | Standard_Boolean IFSelect_EditForm::Modify |
293 | (const Standard_Integer num, const Handle(TCollection_HAsciiString)& newval, |
294 | const Standard_Boolean enforce) |
295 | { |
296 | // Peut-on editer |
297 | thetouched = 0; |
298 | if (themodifs.Upper() == 0) return Standard_False; |
299 | Standard_Integer tnum = RankFromNumber(num); |
300 | if (tnum == 0) return Standard_False; |
301 | IFSelect_EditValue acc = theeditor->EditMode (num); |
302 | if (newval.IsNull() && acc != IFSelect_Optional) return Standard_False; |
303 | if (!enforce && (acc == IFSelect_EditProtected || acc == IFSelect_EditComputed)) return Standard_False; |
304 | |
305 | // Satisfies ? |
306 | Handle(Interface_TypedValue) typval = theeditor->TypedValue(num); |
307 | if (!typval->Satisfies(newval)) return Standard_False; |
308 | Interface_ParamType pty = typval->Type(); |
309 | if (pty == Interface_ParamIdent && !newval.IsNull()) { |
310 | if (themodel.IsNull()) return Standard_False; |
311 | if (themodel->NextNumberForLabel(newval->ToCString(),0,Standard_False) <= 0) |
312 | return Standard_False; |
313 | } |
314 | |
315 | // Update ? |
316 | if (!theeditor->Update(this,num,newval,enforce)) return Standard_False; |
317 | |
318 | thestatus.SetValue (tnum,1); |
319 | themodifs.SetValue (tnum,newval); |
320 | return Standard_True; |
321 | } |
322 | |
323 | Standard_Boolean IFSelect_EditForm::ModifyList |
324 | (const Standard_Integer num, const Handle(IFSelect_ListEditor)& edited, |
325 | const Standard_Boolean enforce) |
326 | { |
327 | // Faut-il prendre |
328 | if (edited.IsNull()) return Standard_False; |
329 | if (!edited->IsTouched()) return Standard_False; |
330 | Handle(TColStd_HSequenceOfHAsciiString) newlist = edited->EditedValues(); |
331 | |
332 | // Peut-on editer |
333 | thetouched = 0; |
334 | if (themodifs.Upper() == 0) return Standard_False; |
335 | Standard_Integer tnum = RankFromNumber(num); |
336 | if (tnum == 0) return Standard_False; |
337 | IFSelect_EditValue acc = theeditor->EditMode (num); |
338 | if (acc == IFSelect_EditRead || acc == IFSelect_EditDynamic) return Standard_False; |
339 | if (newlist.IsNull() && acc != IFSelect_Optional) return Standard_False; |
340 | if (!enforce && (acc == IFSelect_EditProtected || acc == IFSelect_EditComputed)) return Standard_False; |
341 | |
342 | // Update ? |
343 | if (!theeditor->UpdateList(this,num,newlist,enforce)) return Standard_False; |
344 | |
345 | thestatus.SetValue (tnum,1); |
346 | themodifs.SetValue (tnum,newlist); |
347 | return Standard_True; |
348 | } |
349 | |
350 | Standard_Boolean IFSelect_EditForm::ModifyListValue |
351 | (const Standard_Integer num, const Handle(TColStd_HSequenceOfHAsciiString)& list, |
352 | const Standard_Boolean enforce) |
353 | { |
354 | Handle(IFSelect_ListEditor) led = ListEditor (num); |
355 | if (led.IsNull()) return Standard_False; |
356 | if (!led->LoadEdited(list)) return Standard_False; |
357 | return ModifyList (num,led,enforce); |
358 | } |
359 | |
360 | |
361 | Standard_Boolean IFSelect_EditForm::Touch |
362 | (const Standard_Integer num, const Handle(TCollection_HAsciiString)& newval) |
363 | { |
364 | if (themodifs.Upper() == 0) return Standard_False; |
365 | Standard_Integer tnum = RankFromNumber(num); |
366 | if (tnum == 0) return Standard_False; |
367 | |
368 | thestatus.SetValue (tnum,2); |
369 | themodifs.SetValue (tnum,newval); |
370 | thetouched ++; |
371 | return Standard_True; |
372 | } |
373 | |
374 | Standard_Boolean IFSelect_EditForm::TouchList |
375 | (const Standard_Integer num, const Handle(TColStd_HSequenceOfHAsciiString)& newlist) |
376 | { |
377 | if (themodifs.Upper() == 0) return Standard_False; |
378 | Standard_Integer tnum = RankFromNumber(num); |
379 | if (tnum == 0) return Standard_False; |
380 | |
381 | thestatus.SetValue (tnum,2); |
382 | themodifs.SetValue (tnum,newlist); |
383 | thetouched ++; |
384 | return Standard_True; |
385 | } |
386 | |
387 | |
388 | void IFSelect_EditForm::ClearEdit (const Standard_Integer num) |
389 | { |
390 | Standard_Integer i, nb = thestatus.Upper(); |
391 | if (num == 0) { |
392 | for (i = 1; i <= nb; i ++) thestatus.SetValue (i,0); |
393 | } else { |
394 | Standard_Integer tnum = RankFromNumber(num); |
395 | if (tnum > 0 && num <= nb) thestatus.SetValue (tnum,0); |
396 | } |
397 | } |
398 | |
399 | |
400 | void IFSelect_EditForm::PrintDefs (const Handle(Message_Messenger)& S) const |
401 | { |
402 | Standard_Integer iv, nbv = NbValues(Standard_True); |
403 | S<<"***** EditForm, Label : "<<Label()<<endl; |
404 | if (IsComplete()) S<<"Complete, "<<nbv<<" Values"<<endl; |
405 | else { |
406 | S<<"Extraction on "<<nbv<<" Values : (extracted<-editor)"<<endl; |
407 | for (iv = 1; iv <= nbv; iv ++) S<<" "<<iv<<"<-"<<NumberFromRank(iv); |
408 | S<<endl; |
409 | } |
410 | S<<"*****"<<endl; |
411 | } |
412 | |
413 | |
414 | static void PrintList |
415 | (const Handle(TColStd_HSequenceOfHAsciiString)& list, |
416 | const Handle(Message_Messenger)& S, const Standard_Boolean alsolist) |
417 | { |
418 | if (list.IsNull()) { S<<"(NULL LIST)"<<endl; return; } |
419 | |
420 | Standard_Integer i,nb = list->Length(); |
421 | S<<"(List : "<<nb<<" Items)"<<endl; |
422 | if (!alsolist) return; |
423 | |
424 | for (i = 1; i <= nb; i ++) { |
425 | Handle(TCollection_HAsciiString) str = list->Value(i); |
426 | S<<" ["<<i<<"] "<< (str.IsNull() ? "(NULL)" : str->ToCString())<<endl; |
427 | } |
428 | } |
429 | |
430 | void IFSelect_EditForm::PrintValues |
431 | (const Handle(Message_Messenger)& S, const Standard_Integer what, |
432 | const Standard_Boolean names, const Standard_Boolean alsolist) const |
433 | { |
434 | Standard_Integer iv, nbv = NbValues(Standard_True); |
435 | S<< "****************************************************"<<endl; |
436 | S<<"***** "<<Label()<<Interface_MSG::Blanks(Label(),40)<<"*****"<<endl; |
437 | S<<"***** *****"<<endl; |
438 | if (!theloaded) |
439 | S<<"***** Values are NOT loaded *****"<<endl; |
440 | |
441 | else { |
442 | // Donnees sur lesquelles on a travaille |
443 | if (themodel.IsNull()) { |
444 | if (theent.IsNull()) S<<"***** No loaded data"; |
445 | else S<<"***** No loaded Model. Loaded object : type "<<theent->DynamicType()->Name(); |
446 | } else { |
447 | if (theent.IsNull()) S<<"***** No loaded entity"; |
448 | else { S<<"***** Loaded entity : "; themodel->PrintLabel (theent,S); } |
449 | } |
450 | } |
451 | S<<endl<<"****************************************************"<<endl<<endl; |
452 | |
453 | // Affichage des valeurs |
454 | Standard_Boolean nams = names; |
455 | Standard_Integer maxnam = theeditor->MaxNameLength (names ? 0 : -1); |
456 | if (maxnam == 0) { maxnam = theeditor->MaxNameLength (0); nams = Standard_True; } |
457 | Standard_Integer nbmod = 0; |
458 | if (what != 0) S<<"Mod N0 Name Value"<<endl; |
459 | else S<<" N0 Name Value"<<endl; |
460 | |
461 | for (iv = 1; iv <= nbv; iv ++) { |
462 | Standard_Integer jv = NumberFromRank(iv); |
463 | Standard_CString name = theeditor->Name(jv,!nams); |
464 | |
465 | // Original ou Final |
466 | if (what != 0) { |
467 | Handle(TCollection_HAsciiString) str; |
468 | if (IsModified(jv)) S<<"* "; |
469 | else S<<" "; |
470 | S <<Interface_MSG::Blanks(iv,3)<<iv<<" " |
471 | <<name<<Interface_MSG::Blanks(name,maxnam)<<" "; |
472 | |
473 | if (theeditor->IsList(jv)) { |
474 | Handle(TColStd_HSequenceOfHAsciiString) list; |
475 | if (what < 0) list = OriginalList (jv); |
476 | if (what > 0) list = EditedList (jv); |
477 | PrintList (list,S,alsolist); |
478 | continue; |
479 | } |
480 | |
481 | if (what < 0) str = OriginalValue (jv); |
482 | if (what > 0) str = EditedValue (jv); |
483 | |
484 | S << (str.IsNull() ? "(NULL)" : str->ToCString()) <<endl; |
485 | |
486 | // Modified only |
487 | } else { |
488 | if (!IsModified(jv)) continue; |
489 | nbmod ++; |
490 | if (theeditor->IsList(jv)) { |
491 | Handle(TColStd_HSequenceOfHAsciiString) list= OriginalList (jv); |
492 | S <<Interface_MSG::Blanks(iv,3)<<iv<<" " |
493 | <<name<<Interface_MSG::Blanks(name,maxnam)<<" ORIG:"; |
494 | PrintList (list,S,alsolist); |
495 | |
496 | list = EditedList (jv); |
497 | S<<Interface_MSG::Blanks("",maxnam+5)<<"MOD :"; |
498 | PrintList (list,S,alsolist); |
499 | |
500 | continue; |
501 | } |
502 | |
503 | Handle(TCollection_HAsciiString) str = OriginalValue (jv); |
504 | S <<Interface_MSG::Blanks(iv,3)<<iv<<" " |
505 | <<name<<Interface_MSG::Blanks(name,maxnam)<<" ORIG:" |
506 | << (str.IsNull() ? "(NULL)" : str->ToCString()) <<endl; |
507 | str = EditedValue (jv); |
508 | S<<Interface_MSG::Blanks("",maxnam+4)<<" MOD :"<< (str.IsNull() ? "(NULL)" : str->ToCString()) <<endl; |
509 | } |
510 | } |
511 | if (what == 0) S<<"On "<<nbv<<" Values, "<<nbmod<<" Modified"<<endl; |
512 | } |
513 | |
514 | |
515 | Standard_Boolean IFSelect_EditForm::Apply () |
516 | { |
517 | Standard_Boolean stat = ApplyData(theent,themodel); |
518 | if (stat && !thekeepst) ClearEdit(); |
519 | return stat; |
520 | } |
521 | |
522 | |
523 | Standard_Boolean IFSelect_EditForm::Recognize () const |
524 | { return theeditor->Recognize(this); } |
525 | |
526 | Standard_Boolean IFSelect_EditForm::ApplyData |
527 | (const Handle(Standard_Transient)& ent, |
528 | const Handle(Interface_InterfaceModel)& model) |
529 | { return theeditor->Apply (this,ent,model); } |
530 | |
531 | |
532 | Standard_Boolean IFSelect_EditForm::Undo () |
533 | { |
534 | if (thestatus.Upper() == 0 || theorigs.Upper() == 0) return Standard_False; |
535 | Standard_Integer i, nb = thestatus.Upper(); |
536 | for (i = 1; i <= nb; i ++) { |
537 | if (thestatus.Value (i) != 0) themodifs.SetValue (i,theorigs.Value(i)); |
538 | } |
539 | return Apply (); |
540 | } |