Checks if there is {@link TextFormatting} at the current index and applies the corresponding style.<br>
Advances the index by 2.
760703
protected void checkFormatting()
	{
		//previous character was formatting, keep format field set
		if (FontOptions.getFormatting(currentText, charIndex - 1) != null)
			return;
		format = FontOptions.getFormatting(currentText, charIndex);
		if (format == null)
			return;

		if (applyStyles)
			applyStyle(format);

		if (skipChars && !litteral)
		{
			globalIndex += 2;
			charIndex += 2;
			checkFormatting();
		}
	}
1155258
private static void applyStyle(TextView v, AttributeSet attrs, int defStyleAttr, int defStyleRes){
        String fontFamily = null;
        int typefaceIndex = -1;
        int styleIndex = -1;
        int shadowColor = 0;
        float dx = 0, dy = 0, r = 0;

        Drawable drawableLeft = null, drawableTop = null, drawableRight = null,
                drawableBottom = null, drawableStart = null, drawableEnd = null;
        boolean drawableDefined = false;
        boolean drawableRelativeDefined = false;

        /*
         * Look the appearance up without checking first if it exists because
         * almost every TextView has one and it greatly simplifies the logic
         * to be able to parse the appearance first and then let specific tags
         * for this View override it.
         */
        TypedArray a = v.getContext().obtainStyledAttributes(attrs, R.styleable.TextViewAppearance, defStyleAttr, defStyleRes);
        TypedArray appearance = null;
        int ap = a.getResourceId(R.styleable.TextViewAppearance_android_textAppearance, 0);
        a.recycle();

        if (ap != 0)
            appearance = v.getContext().obtainStyledAttributes(ap, R.styleable.TextAppearance);

        if (appearance != null) {
            int n = appearance.getIndexCount();
            for (int i = 0; i < n; i++) {
                int attr = appearance.getIndex(i);

                if (attr == R.styleable.TextAppearance_android_textColorHighlight) {
                    v.setHighlightColor(appearance.getColor(attr, 0));

                } else if (attr == R.styleable.TextAppearance_android_textColor) {
                    v.setTextColor(appearance.getColorStateList(attr));

                } else if (attr == R.styleable.TextAppearance_android_textColorHint) {
                    v.setHintTextColor(appearance.getColorStateList(attr));

                } else if (attr == R.styleable.TextAppearance_android_textColorLink) {
                    v.setLinkTextColor(appearance.getColorStateList(attr));

                } else if (attr == R.styleable.TextAppearance_android_textSize) {
                    v.setTextSize(TypedValue.COMPLEX_UNIT_PX, appearance.getDimensionPixelSize(attr, 0));

                } else if (attr == R.styleable.TextAppearance_android_typeface) {
                    typefaceIndex = appearance.getInt(attr, -1);

                } else if (attr == R.styleable.TextAppearance_android_fontFamily) {
                    fontFamily = appearance.getString(attr);

                } else if (attr == R.styleable.TextAppearance_tv_fontFamily) {
                    fontFamily = appearance.getString(attr);

                } else if (attr == R.styleable.TextAppearance_android_textStyle) {
                    styleIndex = appearance.getInt(attr, -1);

                } else if (attr == R.styleable.TextAppearance_android_textAllCaps) {
                    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH)
                        v.setAllCaps(appearance.getBoolean(attr, false));

                } else if (attr == R.styleable.TextAppearance_android_shadowColor) {
                    shadowColor = appearance.getInt(attr, 0);

                } else if (attr == R.styleable.TextAppearance_android_shadowDx) {
                    dx = appearance.getFloat(attr, 0);

                } else if (attr == R.styleable.TextAppearance_android_shadowDy) {
                    dy = appearance.getFloat(attr, 0);

                } else if (attr == R.styleable.TextAppearance_android_shadowRadius) {
                    r = appearance.getFloat(attr, 0);

                } else if (attr == R.styleable.TextAppearance_android_elegantTextHeight) {
                    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
                        v.setElegantTextHeight(appearance.getBoolean(attr, false));

                } else if (attr == R.styleable.TextAppearance_android_letterSpacing) {
                    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
                        v.setLetterSpacing(appearance.getFloat(attr, 0));

                } else if (attr == R.styleable.TextAppearance_android_fontFeatureSettings) {
                    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
                        v.setFontFeatureSettings(appearance.getString(attr));

                }
            }

            appearance.recycle();
        }

        a = v.getContext().obtainStyledAttributes(attrs, R.styleable.TextView, defStyleAttr, defStyleRes);

        int n = a.getIndexCount();
        for (int i = 0; i < n; i++) {
            int attr = a.getIndex(i);

            if (attr == R.styleable.TextView_android_drawableLeft) {
                drawableLeft = a.getDrawable(attr);
                drawableDefined = true;

            } else if (attr == R.styleable.TextView_android_drawableTop) {
                drawableTop = a.getDrawable(attr);
                drawableDefined = true;

            } else if (attr == R.styleable.TextView_android_drawableRight) {
                drawableRight = a.getDrawable(attr);
                drawableDefined = true;

            } else if (attr == R.styleable.TextView_android_drawableBottom) {
                drawableBottom = a.getDrawable(attr);
                drawableDefined = true;

            } else if (attr == R.styleable.TextView_android_drawableStart) {
                drawableStart = a.getDrawable(attr);
                drawableRelativeDefined = true;

            } else if (attr == R.styleable.TextView_android_drawableEnd) {
                drawableEnd = a.getDrawable(attr);
                drawableRelativeDefined = true;

            } else if (attr == R.styleable.TextView_android_drawablePadding) {
                v.setCompoundDrawablePadding(a.getDimensionPixelSize(attr, 0));

            } else if (attr == R.styleable.TextView_android_maxLines) {
                v.setMaxLines(a.getInt(attr, -1));

            } else if (attr == R.styleable.TextView_android_maxHeight) {
                v.setMaxHeight(a.getDimensionPixelSize(attr, -1));

            } else if (attr == R.styleable.TextView_android_lines) {
                v.setLines(a.getInt(attr, -1));

            } else if (attr == R.styleable.TextView_android_height) {
                v.setHeight(a.getDimensionPixelSize(attr, -1));

            } else if (attr == R.styleable.TextView_android_minLines) {
                v.setMinLines(a.getInt(attr, -1));

            } else if (attr == R.styleable.TextView_android_minHeight) {
                v.setMinHeight(a.getDimensionPixelSize(attr, -1));

            } else if (attr == R.styleable.TextView_android_maxEms) {
                v.setMaxEms(a.getInt(attr, -1));

            } else if (attr == R.styleable.TextView_android_maxWidth) {
                v.setMaxWidth(a.getDimensionPixelSize(attr, -1));

            } else if (attr == R.styleable.TextView_android_ems) {
                v.setEms(a.getInt(attr, -1));

            } else if (attr == R.styleable.TextView_android_width) {
                v.setWidth(a.getDimensionPixelSize(attr, -1));

            } else if (attr == R.styleable.TextView_android_minEms) {
                v.setMinEms(a.getInt(attr, -1));

            } else if (attr == R.styleable.TextView_android_minWidth) {
                v.setMinWidth(a.getDimensionPixelSize(attr, -1));

            } else if (attr == R.styleable.TextView_android_gravity) {
                v.setGravity(a.getInt(attr, -1));

            } else if (attr == R.styleable.TextView_android_scrollHorizontally) {
                v.setHorizontallyScrolling(a.getBoolean(attr, false));

            } else if (attr == R.styleable.TextView_android_includeFontPadding) {
                v.setIncludeFontPadding(a.getBoolean(attr, true));

            } else if (attr == R.styleable.TextView_android_cursorVisible) {
                v.setCursorVisible(a.getBoolean(attr, true));

            } else if (attr == R.styleable.TextView_android_textScaleX) {
                v.setTextScaleX(a.getFloat(attr, 1.0f));

            } else if (attr == R.styleable.TextView_android_shadowColor) {
                shadowColor = a.getInt(attr, 0);

            } else if (attr == R.styleable.TextView_android_shadowDx) {
                dx = a.getFloat(attr, 0);

            } else if (attr == R.styleable.TextView_android_shadowDy) {
                dy = a.getFloat(attr, 0);

            } else if (attr == R.styleable.TextView_android_shadowRadius) {
                r = a.getFloat(attr, 0);

            } else if (attr == R.styleable.TextView_android_textColorHighlight) {
                v.setHighlightColor(a.getColor(attr, 0));

            } else if (attr == R.styleable.TextView_android_textColor) {
                v.setTextColor(a.getColorStateList(attr));

            } else if (attr == R.styleable.TextView_android_textColorHint) {
                v.setHintTextColor(a.getColorStateList(attr));

            } else if (attr == R.styleable.TextView_android_textColorLink) {
                v.setLinkTextColor(a.getColorStateList(attr));

            } else if (attr == R.styleable.TextView_android_textSize) {
                v.setTextSize(TypedValue.COMPLEX_UNIT_PX, a.getDimensionPixelSize(attr, 0));

            } else if (attr == R.styleable.TextView_android_typeface) {
                typefaceIndex = a.getInt(attr, -1);

            } else if (attr == R.styleable.TextView_android_textStyle) {
                styleIndex = a.getInt(attr, -1);

            } else if (attr == R.styleable.TextView_android_fontFamily) {
                fontFamily = a.getString(attr);

            } else if (attr == R.styleable.TextView_tv_fontFamily) {
                fontFamily = a.getString(attr);

            } else if (attr == R.styleable.TextView_android_textAllCaps) {
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH)
                    v.setAllCaps(a.getBoolean(attr, false));

            } else if (attr == R.styleable.TextView_android_elegantTextHeight) {
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
                    v.setElegantTextHeight(a.getBoolean(attr, false));

            } else if (attr == R.styleable.TextView_android_letterSpacing) {
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
                    v.setLetterSpacing(a.getFloat(attr, 0));

            } else if (attr == R.styleable.TextView_android_fontFeatureSettings) {
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
                    v.setFontFeatureSettings(a.getString(attr));

            }
        }
        a.recycle();

        if (shadowColor != 0)
            v.setShadowLayer(r, dx, dy, shadowColor);

        if(drawableDefined) {
            Drawable[] drawables = v.getCompoundDrawables();
            if (drawableStart != null)
                drawables[0] = drawableStart;
            else if (drawableLeft != null)
                drawables[0] = drawableLeft;
            if (drawableTop != null)
                drawables[1] = drawableTop;
            if (drawableEnd != null)
                drawables[2] = drawableEnd;
            else if (drawableRight != null)
                drawables[2] = drawableRight;
            if (drawableBottom != null)
                drawables[3] = drawableBottom;
            v.setCompoundDrawablesWithIntrinsicBounds(drawables[0], drawables[1], drawables[2], drawables[3]);
        }

        if(drawableRelativeDefined && Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1){
            Drawable[] drawables = v.getCompoundDrawablesRelative();
            if (drawableStart != null)
                drawables[0] = drawableStart;
            if (drawableEnd != null)
                drawables[2] = drawableEnd;
            v.setCompoundDrawablesRelativeWithIntrinsicBounds(drawables[0], drawables[1], drawables[2], drawables[3]);
        }

        Typeface tf = null;
        if (fontFamily != null) {
            tf = TypefaceUtil.load(v.getContext(), fontFamily, styleIndex);
            if (tf != null)
                v.setTypeface(tf);
        }
        if(tf != null) {
            switch (typefaceIndex) {
                case 1:
                    tf = Typeface.SANS_SERIF;
                    break;
                case 2:
                    tf = Typeface.SERIF;
                    break;
                case 3:
                    tf = Typeface.MONOSPACE;
                    break;
            }
            v.setTypeface(tf, styleIndex);
        }

        if(v instanceof AutoCompleteTextView)
            applyStyle((AutoCompleteTextView)v, attrs, defStyleAttr, defStyleRes);
    }
1095885
private void _advance(int count) {
        if (buf != null) {
            bufPos += count;
            if (bufPos == buf.length) {
                buf = null;
            }
        } else {
            pos.setIndex(pos.getIndex() + count);
            if (pos.getIndex() > text.length()) {
                pos.setIndex(text.length());
            }
        }
    }
1016828
public void updateStyleElement(Document document, Element style) {
    StringBuilder buf = new StringBuilder();
    serialize(buf);
    Text cont = document.createTextNode(buf.toString());
    while (style.hasChildNodes()) {
      style.removeChild(style.getFirstChild());
    }
    style.appendChild(cont);
  }
378945
@Override
    public boolean hasNext(int startPosition, int contentLength) {
        //("-------------: " + startPosition + ", " + contentLength + ", " + this.position);
        if (startPosition >= 0 && contentLength >= 0) {
            return (this.position) < (startPosition + contentLength);
        }
        return (this.position + 1) < this.content.length;
    }
1248314
protected boolean verifyStringMatch(String text) {
		if (text == null) {
			return false;
		}
		if (!this.caseSensitive) {
			text = text.toLowerCase();
		}
		return text.equals(this.expectedString);
	}
243342
@Override
    public boolean hasNext() {
        if (answerIterator.hasNext()) return true;

        while (conjIterator.hasNext()) {
            answerIterator = conjunctionIterator(conjIterator.next(), tx);
            if (answerIterator.hasNext()) return true;
        }
        return false;
    }
522606
private void updateGhostStyle() {

        if (CmsStringUtil.isEmpty(m_realValue)) {
            if (CmsStringUtil.isEmpty(m_ghostValue)) {
                updateTextArea(m_realValue);
                return;
            }
            if (!m_focus) {
                setGhostStyleEnabled(true);
                updateTextArea(m_ghostValue);
            } else {
                // don't show ghost mode while focused
                setGhostStyleEnabled(false);
            }
        } else {
            setGhostStyleEnabled(false);
            updateTextArea(m_realValue);
        }
    }
170526
private boolean isAboveNext(Context current)
	{
		Context c = current.outer;

		while (c != null)
		{
			if (c == current.threadState.nextctxt)
			{
				return true;
			}
			c = c.outer;
		}

		return false;
	}
508596
@Override
    public void beforeTextChanged(CharSequence s, int start, int count, int after) {
        for (int i = 0; i < mWatchers.size(); i++) {
            int key = mWatchers.keyAt(i);
            if(mEnabledKeys.get(key)) {
                mWatchers.valueAt(i).beforeTextChanged(s, start, count, after);
            }
        }
    }
668246
private static boolean isFormatCandidate(final String message) {
        char c;
        int n = message.length();
        while (n-- != 0) {
            c = message.charAt(n);
            if (c == '}' || c == '\'') {
                return true;
            }
        }
        return false;
    }
387650
public boolean hasNext() {
		if(cachedNext != null) return true;
		while(itr.hasNext()) {
			S o = itr.next();
			T adapted = adapter.adapt(o);
			if(adapted != null) {
				cachedNext = adapted;
				return true;
			}
		}
		return false;
	}
764541
function styleStrike(sq) {
  if (sq.hasFormat('S')) {
    sq.changeFormat(null, {tag: 'S'});
  } else if (!sq.hasFormat('a') && !sq.hasFormat('PRE')) {
    if (sq.hasFormat('code')) {
      sq.changeFormat(null, {tag: 'code'});
    }
    sq.strikethrough();
  }
}
779753
function selected2format()
			{
				formatFieldSwitch(true);
				
				formatbar.find("a").click(function()
				{
					$("*",this).click(function(e)
					{
						e.preventDefault();
						return false;
					});
					
					formatLabelView($(this).text());
					
					var formatValue = $(this).attr(vars.css + "-formatval"); // the type of format value
					
					// convert to selected format
					selectionSet("formatBlock",'<'+formatValue+'>');
					
					formatFieldSwitch(false);
				});
			}
1164241
@Override
    protected void handleTransliterate(Replaceable text,
            Position offsets, boolean isIncremental) {
        // start and limit of the input range
        int start = offsets.start;
        int limit = offsets.limit;
        if(start >= limit) {
            return;
        }

        /*
         * Normalize as short chunks at a time as possible even in
         * bulk mode, so that styled text is minimally disrupted.
         * In incremental mode, a chunk that ends with offsets.limit
         * must not be normalized.
         *
         * If it was known that the input text is not styled, then
         * a bulk mode normalization could be used.
         * (For details, see the comment in the C++ version.)
         */
        StringBuilder segment = new StringBuilder();
        StringBuilder normalized = new StringBuilder();
        int c = text.char32At(start);
        do {
            int prev = start;
            // Skip at least one character so we make progress.
            // c holds the character at start.
            segment.setLength(0);
            do {
                segment.appendCodePoint(c);
                start += Character.charCount(c);
            } while(start < limit && !norm2.hasBoundaryBefore(c = text.char32At(start)));
            if(start == limit && isIncremental && !norm2.hasBoundaryAfter(c)) {
                // stop in incremental mode when we reach the input limit
                // in case there are additional characters that could change the
                // normalization result
                start=prev;
                break;
            }
            norm2.normalize(segment, normalized);
            if(!Normalizer2Impl.UTF16Plus.equal(segment, normalized)) {
                // replace the input chunk with its normalized form
                text.replace(prev, start, normalized.toString());

                // update all necessary indexes accordingly
                int delta = normalized.length() - (start - prev);
                start += delta;
                limit += delta;
            }
        } while(start < limit);

        offsets.start = start;
        offsets.contextLimit += limit - offsets.limit;
        offsets.limit = limit;
    }
1177410
public Boolean isInputFormat(ProvFormat format) {
        ProvFormatType t = provTypeMap.get(format);
        return (t.equals(ProvFormatType.INPUT) || 
                t.equals(ProvFormatType.INPUTOUTPUT));
    }
784950
private boolean isStyle(String style) {
		for (int i = 0; i < style.length(); ++i) {
			char c = style.charAt(i);
			if (!Character.isWhitespace(c)) {
				return (c == '<');
			}
		}
		return false;
	}