public IRichTextInfo GetCellRichTextInfo() { _currentRichText = new RichTextInfo(_currentCell, GetStyle, _currentRow.RowNumber, _currentColumn); GetCellStyle().WrapText = true; _currentCellHasBeenModified = true; return(_currentRichText); }
private void FinalizeCell() { if (_currentRow != null && !_currentCellHasBeenModified && (_currentStyle == null || !_currentStyle.HasBeenModified)) { _currentRow.ClearCell(_currentColumn); } else { bool foundEastAsianChar = false; if (_currentRichText != null) { _currentRichText.Commit(_currentStyle); foundEastAsianChar = _currentRichText.FoundRotatedEastAsianChar; _currentRichText = null; } else if (_currentCell != null && _currentCell.ValueType == Cell.CellValueType.Text && _currentCell.Value != null) { string text = _currentCell.Value.ToString(); if (text.Length > 0) { StringBuilder stringBuilder = new StringBuilder(text.Length); ExcelGeneratorStringUtil.ConvertWhitespaceAppendString(text, stringBuilder, _checkForRotatedEastAsianChars, out foundEastAsianChar); _currentCell.Value = stringBuilder.ToString(); } } if (foundEastAsianChar) { _currentStyle.Orientation = Orientation.Vertical; } if (_currentCell != null) { if (_currentStyle != null && (_currentCell.ValueType == Cell.CellValueType.Text || _currentCell.ValueType == Cell.CellValueType.Blank || _currentCell.ValueType == Cell.CellValueType.Error)) { _currentStyle.NumberFormat = null; } _currentCell.Style = _currentStyle; } _currentStyle = null; } _checkForRotatedEastAsianChars = false; }