bool TCopyParamList::CompareItem(intptr_t Index, const TCopyParamType * CopyParam, const TCopyParamRule * Rule) const { return ((*GetCopyParam(Index)) == *CopyParam) && ((GetRule(Index) == nullptr) ? (Rule == nullptr) : ((Rule != nullptr) && (*GetRule(Index)) == (*Rule))); }
void TCopyParamList::Delete(intptr_t Index) { DebugAssert((Index >= 0) && (Index < GetCount())); FNames->Delete(Index); delete GetCopyParam(Index); FCopyParams->Delete(Index); delete GetRule(Index); FRules->Delete(Index); Modify(); }
void TCopyParamList::Clear() { for (intptr_t Index = 0; Index < GetCount(); ++Index) { delete GetCopyParam(Index); delete GetRule(Index); } FCopyParams->Clear(); FRules->Clear(); FNames->Clear(); }
//--------------------------------------------------------------------------- void TCopyParamList::Clear() { for (intptr_t I = 0; I < GetCount(); I++) { delete GetCopyParam(I); delete GetRule(I); } FCopyParams->Clear(); FRules->Clear(); FNames->Clear(); }
void TCopyParamList::Change(intptr_t Index, const UnicodeString & Name, TCopyParamType * CopyParam, TCopyParamRule * Rule) { if ((Name != GetName(Index)) || !CompareItem(Index, CopyParam, Rule)) { FNames->SetString(Index, Name); delete GetCopyParam(Index); FCopyParams->SetItem(Index, CopyParam); delete GetRule(Index); FRules->SetItem(Index, Rule); Modify(); } else { SAFE_DESTROY(CopyParam); SAFE_DESTROY(Rule); } }
//--------------------------------------------------------------------------- void TCopyParamList::Change(intptr_t Index, const UnicodeString & Name, TCopyParamType * CopyParam, TCopyParamRule * Rule) { if ((Name != GetName(Index)) || !CompareItem(Index, CopyParam, Rule)) { FNames->SetString(Index, Name); delete GetCopyParam(Index); FCopyParams->SetItem(Index, reinterpret_cast<TObject *>(CopyParam)); delete GetRule(Index); FRules->SetItem(Index, reinterpret_cast<TObject *>(Rule)); Modify(); } else { delete CopyParam; delete Rule; } }