nsresult TypeInState::RemovePropFromClearedList(nsIAtom *aProp, const nsString &aAttr) { PRInt32 index; if (FindPropInList(aProp, aAttr, nsnull, mClearedArray, index)) { delete mClearedArray[index]; mClearedArray.RemoveElementAt(index); } return NS_OK; }
void TypeInState::RemovePropFromSetList(nsIAtom* aProp, const nsAString& aAttr) { int32_t index; if (!aProp) { // clear _all_ props for(uint32_t i = 0, n = mSetArray.Length(); i < n; i++) { delete mSetArray[i]; } mSetArray.Clear(); mRelativeFontSize=0; } else if (FindPropInList(aProp, aAttr, nullptr, mSetArray, index)) { delete mSetArray[index]; mSetArray.RemoveElementAt(index); } }
nsresult TypeInState::RemovePropFromSetList(nsIAtom *aProp, const nsString &aAttr) { PRInt32 index; if (!aProp) { // clear _all_ props for(PRUint32 i = 0, n = mSetArray.Length(); i < n; i++) { delete mSetArray[i]; } mSetArray.Clear(); mRelativeFontSize=0; } else if (FindPropInList(aProp, aAttr, nsnull, mSetArray, index)) { delete mSetArray[index]; mSetArray.RemoveElementAt(index); } return NS_OK; }
void CEditProjectMgr::BuildClassDefPropList( ClassDef *pClass, CMoArray<PropDef*> &propList) { int i, chainLen; DWORD j, propIndex, curPropIndex; ClassDef *pCurClass; CMoArray<ClassDef*> classChain; PropDef *pProp, *pAlreadyThere; CMoArray<PropDef*> unhiddenProps, hiddenProps; propList.Term(); propList.SetCacheSize(128); hiddenProps.SetCacheSize(128); unhiddenProps.SetCacheSize(128); // Unwind the chain. chainLen = 0; pCurClass = pClass; while(pCurClass) { pCurClass = pCurClass->m_ParentClass; ++chainLen; } classChain.SetSize(chainLen); --chainLen; pCurClass = pClass; while(pCurClass) { classChain[chainLen] = pCurClass; pCurClass = pCurClass->m_ParentClass; --chainLen; } // Now go up the chain and add properties. for(i=0; i < classChain; i++) { pCurClass = classChain[i]; for(j=0; j < pCurClass->m_nProps; j++) { pProp = &pCurClass->m_Props[j]; pAlreadyThere = FindPropInList(propList, pProp->m_PropName, &propIndex); if(pAlreadyThere) { propList.Remove(propIndex); } propList.Append(pProp); } } // Move hidden properties to the end of the list. for(i=0; i < propList; i++) { if((propList[i]->m_PropFlags & PF_HIDDEN) || ((propList[i]->m_PropFlags & PF_GROUPMASK) && !(propList[i]->m_PropFlags & PF_GROUPOWNER))) { hiddenProps.Append(propList[i]); } else { unhiddenProps.Append(propList[i]); } } curPropIndex = 0; for(i=0; i < unhiddenProps; i++) propList[curPropIndex++] = unhiddenProps[i]; for(i=0; i < hiddenProps; i++) propList[curPropIndex++] = hiddenProps[i]; }