private boolean currentWhiteSpaceIsReadOnly() {
   if (myCurrentSpaceProperty != null && myCurrentSpaceProperty.isReadOnly()) {
     return true;
   } else {
     if (myAffectedRanges == null) return false;
     return myAffectedRanges.isWhitespaceReadOnly(myCurrentWhiteSpace.getTextRange());
   }
 }
  private LeafBlockWrapper doProcessSimpleBlock(
      final Block rootBlock,
      @Nullable final CompositeBlockWrapper parent,
      final boolean readOnly,
      final int index,
      @Nullable Block parentBlock) {
    if (!INLINE_TABS_ENABLED && !myCurrentWhiteSpace.containsLineFeeds()) {
      myCurrentWhiteSpace.setForceSkipTabulationsUsage(true);
    }
    final LeafBlockWrapper info =
        new LeafBlockWrapper(
            rootBlock, parent, myCurrentWhiteSpace, myModel, myOptions, myPreviousBlock, readOnly);
    if (index == 0) {
      info.arrangeParentTextRange();
    }

    switch (myFormatterTagHandler.getFormatterTag(rootBlock)) {
      case ON:
        myInsideFormatRestrictingTag = false;
        break;
      case OFF:
        myInsideFormatRestrictingTag = true;
        break;
      case NONE:
        break;
    }

    TextRange textRange = rootBlock.getTextRange();
    if (textRange.getLength() == 0) {
      assertInvalidRanges(
          textRange.getStartOffset(), textRange.getEndOffset(), myModel, "empty block");
    }
    if (myPreviousBlock != null) {
      myPreviousBlock.setNextBlock(info);
    }
    if (myFirstTokenBlock == null) {
      myFirstTokenBlock = info;
    }
    myLastTokenBlock = info;
    if (currentWhiteSpaceIsReadOnly()) {
      myCurrentWhiteSpace.setReadOnly(true);
    }
    if (myCurrentSpaceProperty != null) {
      myCurrentWhiteSpace.setIsSafe(myCurrentSpaceProperty.isSafe());
      myCurrentWhiteSpace.setKeepFirstColumn(myCurrentSpaceProperty.shouldKeepFirstColumn());
    }

    if (info.isEndOfCodeBlock()) {
      myCurrentWhiteSpace.setBeforeCodeBlockEnd(true);
    }

    info.setSpaceProperty(myCurrentSpaceProperty);
    myCurrentWhiteSpace = new WhiteSpace(textRange.getEndOffset(), false);
    if (myInsideFormatRestrictingTag) myCurrentWhiteSpace.setReadOnly(true);
    myPreviousBlock = info;

    if (myPositionOfInterest != -1
        && (textRange.contains(myPositionOfInterest)
            || textRange.getEndOffset() == myPositionOfInterest)) {
      myResult.put(info, rootBlock);
      if (parent != null) myResult.put(parent, parentBlock);
    }
    return info;
  }