Runtime/Behavior Changes

Part import

Before 14.0, when a drawing's parts were loaded into the Reconfiguration tool, their owners were removed. In 14.0 this has changed to keeping the original owner. Because the Reconfiguration Tool is creating a drawing in the background and extracting the parts to the ReconfigSpace, the owner's dead space have also been replaced with the current ReconfigSpace.

This change was made because of the parts' need of providing a space, which they do by returning their owner's space. Without a space, the user might experience loss of information while doing things like exporting. Without a correct space, things like sorting the article view on adjusted values stop to work.

While working with parts in the Reconfiguration Tool, all parts can be relied on to have the current ReconfigSpace set as their space.

The following code was/is called after a list of parts are imported into the Reconfiguration Tool:

New:
/**
* Post processing part list.
*/
extend private void postProcessList(PartList list) {
    if (!list) return;
    for (p in list.parts) {
	if (list) for (p in list.parts) {
	   if (p.owner) {
	       // Replace the temporary space the parts got when created to the current ReconfigSpace.
	       // The parts need to have their space set to the current ReconfigSpace
	       // for the user to for example be able to sort on adjusted columns.
	       p.owner.space = reconfigCalcSpace();
	   }
	}
    }
    return list;
}

Removed:
/***********************************************************************
 * Post processing
 ***********************************************************************/

/**
 * Post process result parts.
 */
extend public void postProcessResultParts() {
    //ptrace(#newParts.count);
    for (p in newParts.parts) {
	postProcessOrderPart(p, null);
    }

    //ptrace(#reused.count);
    for (k, list in reused) for (row in list.rows) for (p in row.parts) {
	postProcessReusePart(p, null);
    }

    //ptrace(#excess.count);
    for (k, list in excess) for (row in list.rows) for (p in row.parts) {
	postProcessExcessPart(p, null);
    }
}


/**
 * Post process order part, with recursion.
 */
extend public void postProcessOrderPart(Part part, Space orderPartSpace) {
    //ptrace(#part);
    removeOwners(part);
}


/**
 * Post process reuse part, with recursion.
 */
extend public void postProcessReusePart(Part part, Space reusePartSpace) {
    //ptrace(#part);
    removeOwners(part);
}


/**
 * Post process excess part, with recursion.
 */
extend public void postProcessExcessPart(Part part, Space excessPartSpace) {
    //ptrace(#part);
    removeOwners(part);
}


/**
 * Remove owners.
 */
final public void removeOwners(Part part) {
    if (part) {
	// Remove owners in children
	for (c in part.children) if (c) removeOwners(c);

	// Remove in part
	part.data.setOwner(null);
	if ((Snapper{}) set = part.data.owners) set.clear();
    }
}