src/sap.ui.rta/src/sap/ui/rta/ControlTreeModifier.js
function (oParent, sName) {
			var aOldAggregationElements = [];
			var vAggregationElements;
			if (oParent) {
				vAggregationElements = JsControlTreeModifier.getAggregation.call(this, oParent, sName);
			}

			if (vAggregationElements && vAggregationElements instanceof Array) {
				aOldAggregationElements = vAggregationElements.slice();
			} else  if (vAggregationElements && vAggregationElements instanceof Object) {
				aOldAggregationElements[0] = vAggregationElements;
			}

			JsControlTreeModifier.removeAllAggregation(oParent, sName);

			if (aOldAggregationElements){
				aOldAggregationElements.forEach(function(oElement) {
					this._saveUndoOperation("insertAggregation", [oParent, sName, oElement]);
				}, this);
			}
		}
function (oParent, sName) {
			var aOldAggregationElements = [];
			var vAggregationElements;
			if (oParent) {
				vAggregationElements = JsControlTreeModifier.getAggregation.call(this, oParent, sName);
			}

			if (vAggregationElements && vAggregationElements instanceof Array) {
				aOldAggregationElements = vAggregationElements.slice();
			} else  if (vAggregationElements && vAggregationElements instanceof Object) {
				aOldAggregationElements[0] = vAggregationElements;
			}

			JsControlTreeModifier.removeAllAggregation(oParent, sName);

			if (aOldAggregationElements){
				aOldAggregationElements.forEach(function(oElement) {
					this._saveUndoOperation("insertAggregation", [oParent, sName, oElement]);
				}, this);
			}
		}
function ( oParent , sName ) { var aOldAggregationElements = [ ] ; var vAggregationElements ; if ( oParent ) { vAggregationElements = JsControlTreeModifier . getAggregation . call ( this , oParent , sName ) ; } if ( vAggregationElements && vAggregationElements instanceof Array ) { aOldAggregationElements = vAggregationElements . slice ( ) ; } else if ( vAggregationElements && vAggregationElements instanceof Object ) { aOldAggregationElements [ 0 ] = vAggregationElements ; } JsControlTreeModifier . removeAllAggregation ( oParent , sName ) ; if ( aOldAggregationElements ) { aOldAggregationElements . forEach ( function ( oElement ) { this . _saveUndoOperation ( "insertAggregation" , [ oParent , sName , oElement ] ) ; } , this ) ; } }
Removes all objects from an aggregation of the given control
Adds one insertAggregation per removed object as undo operations
@override
Removes all objects from an aggregation of the given control Adds one insertAggregation per removed object as undo operations