табличные замены с параметром

This commit is contained in:
melekhin
2026-09-10 16:04:53 +07:00
parent 70a19ad738
commit ebec7f724c
4 changed files with 257 additions and 7 deletions
+37 -2
View File
@@ -479,13 +479,48 @@ internal sealed class WordWriter : WordReader, IWordWriter
}
}
// ============================================================
// Динамические замены на таблицу с извлечением параметра из "$key|$"
// ============================================================
public void ReplaceToTable(string oldValue, Action<string, ITable> buildTable)
{
throw new NotImplementedException();
ThrowIfDisposed();
if (string.IsNullOrEmpty(oldValue))
throw new ArgumentException("Old value cannot be null or empty", nameof(oldValue));
if (buildTable is null) return;
#if DEBUG
Debug.WriteLine($"[DEBUG] [WordProcessor.ReplaceToTable(dynamic)] START: '{oldValue}'");
#endif
lock (_syncLock)
{
DynamicReplaceToTableExt.ReplaceParagraphsContainingTextToTableDynamic(_body, oldValue, buildTable);
_isModified = true;
}
}
public void ReplaceToTable(string oldValue, FontProps baseFont, Action<string, ITable> buildTable)
{
throw new NotImplementedException();
ThrowIfDisposed();
if (string.IsNullOrEmpty(oldValue))
throw new ArgumentException("Old value cannot be null or empty", nameof(oldValue));
if (buildTable is null) return;
#if DEBUG
Debug.WriteLine($"[DEBUG] [WordProcessor.ReplaceToTable(dynamic,font)] START: '{oldValue}'");
#endif
lock (_syncLock)
{
DynamicReplaceToTableExt.ReplaceParagraphsContainingTextToTableDynamic(_body, oldValue, buildTable, baseFont);
_isModified = true;
}
}
#endregion