@classmethod
def __ensureCursorBeforeAnchor(cls, cursor):
    """
        Given a cursor, modify it such that the cursor.position() is before or
        at cursor.anchor() and not the other way around.
        
        Returns: anchorBeforeCursor, i.e. whether originally the anchor was
        before the cursor
        """
    start = cursor.selectionStart()
    end = cursor.selectionEnd()
    anchorBeforeCursor = cursor.anchor() < cursor.position()
    cls.__setCursorPositionAndAnchor(cursor, start, end)
    return anchorBeforeCursor
