void GRaggedFloatTableData::RemoveElement ( const JIndex row, const JIndex col ) { JArray<JFloat>* dataCol = itsCols->NthElement(col); const JSize rowCount = dataCol->GetElementCount(); if (row <= rowCount) { dataCol->RemoveElement(row); } if (itsBroadcast) { Broadcast(GRaggedFloatTableData::ElementRemoved(row, col)); } if (GetMaxRowCount() == GetRowCount() - 2) { if (itsBroadcast) { Broadcast(JTableData::RowsRemoved(GetRowCount(), 1)); } RowsDeleted(1); } }
JBoolean CBCtagsUser::HasExuberantCtags() { if (itsHasExuberantCtagsFlag == kUntested) { itsHasExuberantCtagsFlag = kFailure; // this hack is required on Linux kernel 2.3.x (4/19/2000) j_sig_func* origHandler = signal(SIGCHLD, emptyHandler); pid_t pid; #if defined _J_SUNOS pid_t* ppid = NULL; #else pid_t* ppid = &pid; #endif int fromFD; JError err = JExecute(kCheckVersionCmd, ppid, kJIgnoreConnection, NULL, kJCreatePipe, &fromFD, kJTossOutput, NULL); if (err.OK()) { JString vers; JReadAll(fromFD, &vers); JArray<JIndexRange> matchList; if (versionPattern.Match(vers, &matchList)) { matchList.RemoveElement(1); const JSize count = matchList.GetElementCount(); JString s; for (JIndex i=1; i<=count; i++) { JUInt v = 0; const JIndexRange r = matchList.GetElement(i); if (!r.IsEmpty()) { s = vers.GetSubstring(r); while (!isdigit(s.GetFirstCharacter())) { s.RemoveSubstring(1, 1); } const JBoolean ok = s.ConvertToUInt(&v); assert( ok ); } if (v > kMinVersion[i-1] || (i == count && v == kMinVersion[i-1])) { itsHasExuberantCtagsFlag = kSuccess; break; } else if (v < kMinVersion[i-1]) { break; } } } } if (origHandler != SIG_ERR) { signal(SIGCHLD, origHandler); } } return JI2B( itsHasExuberantCtagsFlag == kSuccess ); }
void JPartition::AdjustCompartmentsAfterDragAll ( const JCoordinate coord ) { JIndex i; // compress compartments in front of itsDragIndex+1 if (coord < itsStartCoord) { JArray<JCoordinate> origSizes = *itsSizes; JArray<JCoordinate> minSizes = *itsMinSizes; JSize count = origSizes.GetElementCount(); for (i=count; i>itsDragIndex; i--) { origSizes.RemoveElement(i); minSizes.RemoveElement(i); } JArray<JCoordinate> newSizes; const JCoordinate reqSize = itsStartCoord - coord; JCoordinate newSpace; const JBoolean ok = CreateSpace(origSizes, minSizes, 0, reqSize, reqSize, &newSizes, &newSpace); assert( ok ); for (i=1; i<=itsDragIndex; i++) { itsSizes->SetElement(i, newSizes.GetElement(i)); } itsSizes->SetElement(itsDragIndex+1, itsSizes->GetElement(itsDragIndex+1) + reqSize); SetCompartmentSizes(); } // compress compartments after itsDragIndex else if (coord > itsStartCoord) { const JSize compartmentCount = GetCompartmentCount(); JArray<JCoordinate> origSizes = *itsSizes; JArray<JCoordinate> minSizes = *itsMinSizes; for (i=1; i<=itsDragIndex; i++) { origSizes.RemoveElement(1); minSizes.RemoveElement(1); } JArray<JCoordinate> newSizes; const JCoordinate reqSize = coord - itsStartCoord; JCoordinate newSpace; const JBoolean ok = CreateSpace(origSizes, minSizes, 0, reqSize, reqSize, &newSizes, &newSpace); assert( ok ); itsSizes->SetElement(itsDragIndex, itsSizes->GetElement(itsDragIndex) + reqSize); for (i=itsDragIndex+1; i<=compartmentCount; i++) { itsSizes->SetElement(i, newSizes.GetElement(i-itsDragIndex)); } SetCompartmentSizes(); } }