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