예제 #1
0
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)));
}
예제 #2
0
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();
}
예제 #3
0
void TCopyParamList::Clear()
{
  for (intptr_t Index = 0; Index < GetCount(); ++Index)
  {
    delete GetCopyParam(Index);
    delete GetRule(Index);
  }
  FCopyParams->Clear();
  FRules->Clear();
  FNames->Clear();
}
예제 #4
0
//---------------------------------------------------------------------------
void TCopyParamList::Clear()
{
  for (intptr_t I = 0; I < GetCount(); I++)
  {
    delete GetCopyParam(I);
    delete GetRule(I);
  }
  FCopyParams->Clear();
  FRules->Clear();
  FNames->Clear();
}
예제 #5
0
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);
  }
}
예제 #6
0
//---------------------------------------------------------------------------
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;
  }
}