@method

create WrappedRange from paraBookmark

@param {Object} bookmark
@param {Node[]} paras
@return {WrappedRange}
187637
function (bookmark, paras) {
                var so = bookmark.s.offset;
                var eo = bookmark.e.offset;
                var sc = dom.fromOffsetPath(list.head(paras), bookmark.s.path);
                var ec = dom.fromOffsetPath(list.last(paras), bookmark.e.path);

                return new WrappedRange(sc, so, ec, eo);
            }
182560
function getNextRange(ranges, anchor) {
	for (let i = 0; i < ranges.length; i++) {
		if (anchor.isEqual(ranges[i])) {
			// NB may return `undefined`, which is totally fine and means that
			// we should move to next element
			return ranges[i + 1];
		}
	}

	// Keep ranges which are not on the left of given selection
	ranges = ranges.filter(r => anchor.end.isLessThanOrEqual(r.start));

	return ranges[0];
}
363389
function(codePoints) {
		var index = -1;
		var length = codePoints.length;
		var max = length - 1;
		var result = [];
		var isStart = true;
		var tmp;
		var previous = 0;
		while (++index < length) {
			tmp = codePoints[index];
			if (isStart) {
				result.push(tmp);
				previous = tmp;
				isStart = false;
			} else {
				if (tmp == previous + 1) {
					if (index != max) {
						previous = tmp;
						continue;
					} else {
						isStart = true;
						result.push(tmp + 1);
					}
				} else {
					// End the previous range and start a new one.
					result.push(previous + 1, tmp);
					previous = tmp;
				}
			}
		}
		if (!isStart) {
			result.push(tmp + 1);
		}
		return result;
	}
213399
function getNextItemRange(model, anchor, getItemRanges) {
	// Find HTML node for next selection
	let node = nodeForPoint(model, anchor.start, 'next');
	let range;

	// We might need to narrow down node context to find best token match
	while (node && !range) {
		range = getNextRange(getItemRanges(node), anchor);
		node = node.firstChild || nextSibling(node);
	}

	return range;
}
105114
function(content, ranges, ch, noRepeat) {
			if (ranges.length) {
				var offset = 0, fragments = [];
				ranges.forEach(function(r) {
					var repl = noRepeat ? ch : this.repeatString(ch, r[1] - r[0]);
					fragments.push(content.substring(offset, r[0]), repl);
					offset = r[1];
				}, this);

				content = fragments.join('') + content.substring(offset);
			}

			return content;
		}
128634
function( normalized ) {
			var bookmarks = [];

			for ( var i = 0; i < this.length; i++ )
				bookmarks.push( this[ i ].createBookmark2( normalized ) );

			return bookmarks;
		}
531687
function prepareRangeToDataInsertion( that ) {
			var range = that.range,
				mergeCandidates = that.mergeCandidates,
				node, marker, path, startPath, endPath, previous, bm;

			// If range starts in inline element then insert a marker, so empty
			// inline elements won't be removed while range.deleteContents
			// and we will be able to move range back into this element.
			// E.g. 'aa<b>[bb</b>]cc' -> (after deleting) 'aa<b><span/></b>cc'
			if ( that.type == 'text' && range.shrink( CKEDITOR.SHRINK_ELEMENT, true, false ) ) {
				marker = CKEDITOR.dom.element.createFromHtml( '<span>&nbsp;</span>', range.document );
				range.insertNode( marker );
				range.setStartAfter( marker );
			}

			// By using path we can recover in which element was startContainer
			// before deleting contents.
			// Start and endPathElements will be used to squash selected blocks, after removing
			// selection contents. See rule 5.
			startPath = new CKEDITOR.dom.elementPath( range.startContainer );
			that.endPath = endPath = new CKEDITOR.dom.elementPath( range.endContainer );

			if ( !range.collapsed ) {
				// Anticipate the possibly empty block at the end of range after deletion.
				node = endPath.block || endPath.blockLimit;
				var ancestor = range.getCommonAncestor();
				if ( node && !( node.equals( ancestor ) || node.contains( ancestor ) ) && range.checkEndOfBlock() ) {
					that.zombies.push( node );
				}

				range.deleteContents();
			}

			// Rule 4.
			// Move range into the previous block.
			while (
				( previous = getRangePrevious( range ) ) && checkIfElement( previous ) && previous.isBlockBoundary() &&
				// Check if previousNode was parent of range's startContainer before deleteContents.
				startPath.contains( previous )
			)
				range.moveToPosition( previous, CKEDITOR.POSITION_BEFORE_END );

			// Rule 5.
			mergeAncestorElementsOfSelectionEnds( range, that.blockLimit, startPath, endPath );

			// Rule 1.
			if ( marker ) {
				// If marker was created then move collapsed range into its place.
				range.setEndBefore( marker );
				range.collapse();
				marker.remove();
			}

			// Split inline elements so HTML will be inserted with its own styles.
			path = range.startPath();
			if ( ( node = path.contains( isInline, false, 1 ) ) ) {
				range.splitElement( node );
				that.inlineStylesRoot = node;
				that.inlineStylesPeak = path.lastElement;
			}

			// Record inline merging candidates for later cleanup in place.
			bm = range.createBookmark();

			// 1. Inline siblings.
			node = bm.startNode.getPrevious( isNotEmpty );
			node && checkIfElement( node ) && isInline( node ) && mergeCandidates.push( node );
			node = bm.startNode.getNext( isNotEmpty );
			node && checkIfElement( node ) && isInline( node ) && mergeCandidates.push( node );

			// 2. Inline parents.
			node = bm.startNode;
			while ( ( node = node.getParent() ) && isInline( node ) )
				mergeCandidates.push( node );

			range.moveToBookmark( bm );
		}
1243175
function() {
					if ( !this._.highlightRange )
						return;

					var bookmark = this._.highlightRange.createBookmark();
					highlightStyle.removeFromRange( this._.highlightRange, editor );
					this._.highlightRange.moveToBookmark( bookmark );
					this.updateFromDomRange( this._.highlightRange );
					this._.highlightRange = null;
				}
821198
function getRangesFromCSSNode(node) {
	let ranges;

	if (node.type === 'rule') {
		ranges = [ getRange(node.selectorToken) ].concat(node.parsedSelector.map(getRange));
	} else if (node.type === 'at-rule') {
		const nameEndToken = node.expressionToken || node.nameToken;
		ranges = [
			new Range(node.nameToken.start, nameEndToken.end),
			getRange(node.nameToken),
			getRange(node.expressionToken)
		];
		node.parsedExpression.forEach(token => {
			ranges.push(getRange(token));
			iterateCSSToken(token, t => {
				if (t.type === 'argument') {
					ranges.push(getRange(t));
				}
			});
		});
	} else if (node.type === 'property') {
		ranges = [
			getRange(node),
			getRange(node.nameToken),
			getRange(node.valueToken)
		];
		node.parsedValue.forEach(value => {
			// parsed value contains a comma-separated list of sub-values,
			// each of them, it turn, may contain space-separated parts
			ranges.push(getRange(value));

			for (let i = 0, il = value.size, token; i < il; i++) {
				token = value.item(i);
				if (token.type === 'url') {
					ranges.push(getRange(token), getRange(token.item(0)));
				} else if (token.type !== 'whitespace' && token !== 'comment') {
					ranges.push(getRange(token));

					iterateCSSToken(token, t => {
						if (t.type === 'argument') {
							ranges.push(getRange(t));
						}
					});
				}
			}
		});
	}

	return ranges ? uniqueRanges(ranges.filter(Boolean)) : [];
}
1127028
public FieldList setHandle(Object bookmark, int iHandleType) throws DBException
    {
        if ((iHandleType == DBConstants.BOOKMARK_HANDLE) && (bookmark instanceof String))     // It is okay to pass in a string, but convert it first!
            if ((this.getRecord().getCounterField() != null) || (this.getRecord().getKeyArea(DBConstants.MAIN_KEY_AREA).getKeyFields() > 1))
        {   // As a convenience convert a string bookmark to the proper bookmark
            try   {
            	bookmark = Converter.stripNonNumber(bookmark.toString());
                bookmark = new Integer((String)bookmark);
            } catch (NumberFormatException ex)  {
                bookmark = new StrBuffer((String)bookmark);
            }
        }
        if ((this.getRecord().getEditMode() == Constants.EDIT_IN_PROGRESS)
            || (this.getRecord().getEditMode() == Constants.EDIT_CURRENT))
        {
            Object oldBookmark = this.getHandle(iHandleType);
            if (bookmark != null) if (bookmark.equals(oldBookmark)) if (!this.getRecord().isModified(false))
                return this.getRecord();        // This is already your current record!
        }

        m_objectID = null;      // No current record
        m_dataSource = null;
        if (iHandleType == DBConstants.FULL_OBJECT_HANDLE)
        {
            if (!(bookmark instanceof String))
                return null;
            int iIndex = ((String)bookmark).lastIndexOf(HANDLE_SEPARATOR);
            if ((iIndex == -1) || (iIndex == ((String)bookmark).length() - 1))
                return null;
            String strRecord = ((String)bookmark).substring(0, iIndex);
            int iRecordIndex = strRecord.lastIndexOf(HANDLE_SEPARATOR, iIndex - 1);
            int iDBIndex = strRecord.lastIndexOf(HANDLE_SEPARATOR, iRecordIndex - 1);
            if (!strRecord.substring(iRecordIndex + 1, iIndex).equalsIgnoreCase(this.getRecord().getTableNames(false)))
                if (!strRecord.substring(iDBIndex + 1, iRecordIndex).equalsIgnoreCase(this.getDatabase().getDatabaseName(false)))
                    return null;    // Not the correct record or database
            bookmark = ((String)bookmark).substring(iIndex + 1);
            iHandleType = DBConstants.OBJECT_ID_HANDLE;
        }
        m_bIsOpen = false;
        boolean bSuccess = this.doSetHandle(bookmark, iHandleType);
        m_bIsOpen = true;
        if (bSuccess)
        {
            m_iRecordStatus = DBConstants.RECORD_NORMAL;
            this.getRecord().setEditMode(Constants.EDIT_CURRENT);
            Object[] rgobjEnabledFields = null;
            try {
                rgobjEnabledFields = this.getRecord().setEnableFieldListeners(false);
                this.dataToFields(this.getRecord());
            } catch (DBException ex)    {
                throw ex;
            } finally {
                this.getRecord().setEnableFieldListeners(rgobjEnabledFields);
            }
            this.getRecord().handleValidRecord(); // Display Fields
            return this.getRecord();
        }
        else
        {
            m_iRecordStatus = DBConstants.RECORD_INVALID | DBConstants.RECORD_AT_BOF | DBConstants.RECORD_AT_EOF;
            this.getRecord().handleNewRecord();     //? Display Fields (Should leave record in an indeterminate state!)
            this.getRecord().setEditMode(Constants.EDIT_NONE);  // Unknown status
            return null;
        }
    }
1038506
function () {
            var me = this;
            return new Range(me.document).setStart(me.startContainer, me.startOffset).setEnd(me.endContainer, me.endOffset);

        }
895718
public Object setupBookmark(int iAreaDesc)
    {
        if (this.getKeyFields() == 1)   // Special case - single unique key;
            return this.getField(iAreaDesc).getData();
        BaseBuffer buffer = new org.jbundle.thin.base.db.buff.str.StrBuffer(null);
        this.setupKeyBuffer(buffer, iAreaDesc);
        return buffer;
    }
103421
function getrange(key, start, end, req) {
  var val = this.getKey(key, req);
  if(!val) return '';
  start = parseInt(start);
  end = parseInt(end);
  if(start < 0) start = val.length + start;
  if(end < 0) end = val.length + end;
  // TODO: buffer compat
  return (val + '').substr(start, end + 1);
}
879311
function lrange(key, start, stop, req) {
  var val = this.getKey(key, req);
  if(val === undefined) return null;
  return val.lrange(start, stop);
}
288879
function iterRanges(min, max, padding) {
  let index = min;

  return {
    reset: () => { index = min; },
    next: () => {
      if (index <= max) {
        let value = index;
        if (padding) {
          value = padNumber(index, padding);
        }
        index += 1;

        return {
          value,
          done: false,
        };
      }
      return { done: true };
    },
  };
}
451241
function createRange(fromRight) {
  return function(start, end, step) {
    if (step && typeof step != 'number' && _isIterateeCall(start, end, step)) {
      end = step = undefined;
    }
    // Ensure the sign of `-0` is preserved.
    start = toFinite_1(start);
    if (end === undefined) {
      end = start;
      start = 0;
    } else {
      end = toFinite_1(end);
    }
    step = step === undefined ? (start < end ? 1 : -1) : toFinite_1(step);
    return _baseRange(start, end, step, fromRight);
  };
}
195235
public FieldList setHandle(Object bookmark, int iHandleType) throws DBException
    {
        FieldList record = super.setHandle(bookmark, iHandleType);
        Iterator<BaseTable> iterator = this.getTables();
        while (iterator.hasNext())
        {
            BaseTable table = iterator.next();
            if ((table != null) && (table != this.getNextTable()))
                this.syncTables(table, this.getRecord());
        }
        return record;
    }