DBCoordinate *DBVPolyIF::Vertexes (const DBObjRecord *polyRec) const { DBInt vertex, i, line; DBObjRecord *lineRec, *nodeRec,*firstNodeRec; DBCoordinate *lcoords; vertex = 0; lineRec = FirstLine (polyRec); firstNodeRec = nodeRec = LineRightPoly (lineRec) == polyRec ? FromNode (lineRec) : ToNode (lineRec); for (line = 0;line < LineNum (polyRec);++line) { if (LineRightPoly (lineRec) == polyRec) { if (nodeRec != FromNode (lineRec)) { CoordsPTR [vertex++] = NodeCoord (nodeRec); if (nodeRec != firstNodeRec) CoordsPTR [vertex++] = NodeCoord (firstNodeRec); nodeRec = FromNode (lineRec); } CoordsPTR [vertex++] = NodeCoord (nodeRec); if (DBVLineIF::VertexNum(lineRec) > 0) { lcoords = DBVLineIF::Vertexes (lineRec); for (i = 0;i < DBVLineIF::VertexNum (lineRec);++i) CoordsPTR [vertex++] = lcoords [i]; } nodeRec = ToNode (lineRec); lineRec = LineNextLine (lineRec); } else { if (nodeRec != ToNode (lineRec)) { CoordsPTR [vertex++] = NodeCoord (nodeRec); if (nodeRec != firstNodeRec) CoordsPTR [vertex++] = NodeCoord (firstNodeRec); nodeRec = ToNode (lineRec); } CoordsPTR [vertex++] = NodeCoord (nodeRec); if (DBVLineIF::VertexNum (lineRec) > 0) { lcoords = (DBCoordinate *) (DBVLineIF::Vertexes (lineRec)); for (i = DBVLineIF::VertexNum (lineRec);i > 0;--i) CoordsPTR [vertex++] = lcoords [i - 1]; } nodeRec = FromNode (lineRec); lineRec = LinePrevLine (lineRec); } } CoordsPTR [vertex++] = NodeCoord (nodeRec); if (nodeRec != firstNodeRec) CoordsPTR [vertex++] = NodeCoord (firstNodeRec); if (VertexNum (polyRec) != vertex) CMmsgPrint (CMmsgAppError, "Warning in Polygon %d VertexNum [%d %d] in: %s %d",polyRec->RowID (), VertexNum (polyRec),vertex,__FILE__,__LINE__); return (CoordsPTR); }
void HTMLFieldSetElement::RemoveElement(nsGenericHTMLFormElement* aElement) { mDependentElements.RemoveElement(aElement); // If the element that we are removing aElement is a fieldset, then all the // invalid elements in aElement are also removed from this. HTMLFieldSetElement* fieldSet = FromNode(aElement); if (fieldSet) { for (int32_t i = 0; i < fieldSet->mInvalidElementsCount; i++) { UpdateValidity(true); } return; } // We need to update the validity of the fieldset. nsCOMPtr<nsIConstraintValidation> cvElmt = do_QueryObject(aElement); if (cvElmt && cvElmt->IsCandidateForConstraintValidation() && !cvElmt->IsValid()) { UpdateValidity(true); } #if DEBUG int32_t debugInvalidElementsCount = 0; for (uint32_t i = 0; i < mDependentElements.Length(); i++) { HTMLFieldSetElement* fieldSet = FromNode(mDependentElements[i]); if (fieldSet) { debugInvalidElementsCount += fieldSet->mInvalidElementsCount; continue; } nsCOMPtr<nsIConstraintValidation> cvElmt = do_QueryObject(mDependentElements[i]); if (cvElmt && cvElmt->IsCandidateForConstraintValidation() && !(cvElmt->IsValid())) { debugInvalidElementsCount += 1; } } MOZ_ASSERT(debugInvalidElementsCount == mInvalidElementsCount); #endif }