Unable to remove math node
Bug #1379453 reported by
Bowen Li
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Workcraft |
Fix Committed
|
Low
|
Stan |
Bug Description
Removing a visual component in a page cannot remove its corresponding math node.
using lp:~libowen96/workcraft/trunk-son-refactoring
- create some places in Petri net plug-in
- combine them into a page
- enter the page and remove one place
- use Tool -> Test tool -> Math level test to output all math places
The removed node still exist.
Related branches
lp:~sgaflv/workcraft/trunk-bug1379453
- Danil Sokolov: Disapprove
-
Diff: 18 lines (+6/-2)1 file modifiedWorkcraftCore/src/org/workcraft/dom/DefaultMathNodeRemover.java (+6/-2)
lp:~danilovesky/workcraft/trunk-bug-1395102
- Danil Sokolov: Approve
-
Diff: 779 lines (+282/-125)17 files modifiedCircuitPlugin/src/org/workcraft/plugins/circuit/CircuitComponent.java (+10/-0)
CircuitPlugin/src/org/workcraft/plugins/circuit/Contact.java (+20/-0)
CircuitPlugin/src/org/workcraft/plugins/circuit/Environment.java (+10/-0)
CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuit.java (+24/-1)
CircuitPlugin/src/org/workcraft/plugins/circuit/VisualContact.java (+18/-10)
CircuitPlugin/src/org/workcraft/plugins/circuit/tasks/CheckCircuitTask.java (+8/-4)
CircuitPlugin/src/org/workcraft/plugins/circuit/tools/STGGenerator.java (+135/-58)
WorkcraftCore/src/org/workcraft/Framework.java (+3/-2)
WorkcraftCore/src/org/workcraft/Info.java (+2/-2)
WorkcraftCore/src/org/workcraft/dom/DefaultMathNodeRemover.java (+35/-34)
WorkcraftCore/src/org/workcraft/gui/MainWindow.java (+8/-8)
WorkcraftCore/src/org/workcraft/gui/propertyeditor/FileCellEditor.java (+1/-1)
WorkcraftCore/src/org/workcraft/plugins/serialisation/xml/FileDeserialiser.java (+2/-1)
WorkcraftCore/src/org/workcraft/plugins/serialisation/xml/FileSerialiser.java (+3/-1)
WorkcraftCore/src/org/workcraft/workspace/WorkspaceEntry.java (+1/-1)
build_distr_linux.sh (+1/-1)
build_distr_windows.sh (+1/-1)
Changed in workcraft: | |
importance: | Undecided → Low |
status: | New → Confirmed |
assignee: | nobody → Stan (sgaflv) |
tags: | added: page son |
Changed in workcraft: | |
status: | Confirmed → Fix Committed |
To post a comment you must log in.
The methods inRef and decRef in DefaultMathNode Remover that were based on a reference counting are changed to track the sets of dependant nodes:
private void addReference( MathNode mathNode, DependentNode dependentNode) { DependentNode> refs = referenceTracke r.get(mathNode) ; DependentNode> (); acker.put( mathNode ,refs); add(dependentNo de);
if (mathNode != null) {
HashSet<
if (refs == null) {
refs = new HashSet<
referenceTr
}
refs.
}
}
private void removeReference (MathNode mathNode, DependentNode dependentNode) { DependentNode> refs = referenceTracke r.get(mathNode) ; remove( dependentNode) ; acker.remove( mathNode) ; getParent( ); Container) parent) .remove( mathNode) ;
if (mathNode != null) {
HashSet<
if (refs != null) {
refs.
}
if ((refs == null) || refs.isEmpty()) {
referenceTr
Node parent = mathNode.
if (parent instanceof Container) {
((
}
}
}
}