private DocumentSelection transformSelection(DocumentSelection selection,
List<DocOp> pretransformedUnackedClientOps,
List<DocOp> pretransformedQueuedClientOps) {
PositionTransformer basePositionTransformer =
new PositionTransformer(selection.getBasePosition().getLineNumber(), selection
.getBasePosition().getColumn());
PositionTransformer cursorPositionTransformer =
new PositionTransformer(selection.getCursorPosition().getLineNumber(), selection
.getCursorPosition().getColumn());
for (DocOp op : pretransformedUnackedClientOps) {
basePositionTransformer.transform(op);
cursorPositionTransformer.transform(op);
}
for (DocOp op : pretransformedQueuedClientOps) {
basePositionTransformer.transform(op);
cursorPositionTransformer.transform(op);
}
return DocumentSelectionImpl.make().setBasePosition(makeFilePosition(basePositionTransformer))
.setCursorPosition(makeFilePosition(cursorPositionTransformer))
.setUserId(selection.getUserId());