ICellText rename
All checks were successful
Publish NuGet packages / publish (push) Successful in 26s
All checks were successful
Publish NuGet packages / publish (push) Successful in 26s
This commit is contained in:
@@ -94,7 +94,7 @@ internal sealed class ExcelCellText : ICellText
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public ICellText AddBreak()
|
||||
public ICellText Break()
|
||||
{
|
||||
// Добавляем символ переноса строки в последний существующий Run
|
||||
if (_runs != null && _runs.Count > 0)
|
||||
@@ -105,13 +105,13 @@ internal sealed class ExcelCellText : ICellText
|
||||
else
|
||||
{
|
||||
// Если нет ни одного Run, создаём новый с символом переноса
|
||||
AddRun("\n", null);
|
||||
Run("\n", null);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public ICellText AddRun(string text, RunFormat? format = null)
|
||||
public ICellText Run(string text, RunFormat? format = null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(text))
|
||||
return this;
|
||||
@@ -122,15 +122,15 @@ internal sealed class ExcelCellText : ICellText
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public ICellText AddRunBreak(string text, RunFormat? format = null)
|
||||
public ICellText RunBreak(string text, RunFormat? format = null)
|
||||
{
|
||||
AddRun(text, format);
|
||||
AddBreak();
|
||||
Run(text, format);
|
||||
Break();
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public ICellText AddSubRun(string text, RunFormat? format = null)
|
||||
public ICellText Sub(string text, RunFormat? format = null)
|
||||
{
|
||||
var subFormat = format is { } fmt
|
||||
? new RunFormat
|
||||
@@ -145,11 +145,11 @@ internal sealed class ExcelCellText : ICellText
|
||||
Vertical = VerticalTextRunAlignment.Subscript
|
||||
}
|
||||
: new RunFormat { Vertical = VerticalTextRunAlignment.Subscript };
|
||||
return AddRun(text, subFormat);
|
||||
return Run(text, subFormat);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public ICellText AddSupRun(string text, RunFormat? format = null)
|
||||
public ICellText Sup(string text, RunFormat? format = null)
|
||||
{
|
||||
var supFormat = format is { } fmt
|
||||
? new RunFormat
|
||||
@@ -164,7 +164,7 @@ internal sealed class ExcelCellText : ICellText
|
||||
Vertical = VerticalTextRunAlignment.Subscript
|
||||
}
|
||||
: new RunFormat { Vertical = VerticalTextRunAlignment.Superscript };
|
||||
return AddRun(text, supFormat);
|
||||
return Run(text, supFormat);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -186,14 +186,14 @@ internal sealed class ExcelCellText : ICellText
|
||||
if (!TryInsertRun(index, text, format))
|
||||
return false;
|
||||
// После вставленного run добавляем break на следующей позиции
|
||||
AddBreak();
|
||||
Break();
|
||||
// Сдвигаем? Просто добавляем break в конец – неверно. Break должен быть сразу после вставленного.
|
||||
// Но AddBreak добавляет в конец. Нужно вставить break на index+1.
|
||||
return TryInsertRun(index + 1, "\n", null);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool TryInsertSubRun(int index, string text, RunFormat? format = null)
|
||||
public bool TryInsertSub(int index, string text, RunFormat? format = null)
|
||||
{
|
||||
var subFormat = format is { } fmt
|
||||
? new RunFormat
|
||||
@@ -212,7 +212,7 @@ internal sealed class ExcelCellText : ICellText
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool TryInsertSupRun(int index, string text, RunFormat? format = null)
|
||||
public bool TryInsertSup(int index, string text, RunFormat? format = null)
|
||||
{
|
||||
var supFormat = format is { } fmt
|
||||
? new RunFormat
|
||||
|
||||
Reference in New Issue
Block a user