mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-12-06 03:51:36 +00:00
Added whole documents to the Translation, Grammar & Spelling, and Rewrite & Improve assistants (#1179)
Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
This commit is contained in:
1 parent
f7666861f1
commit
918572c158
150 files changed
+12850
-302
No files matched your search
@@ -0,0 +1,27 @@
|
||||
using DocumentFormat.OpenXml;
|
||||
|
||||
namespace AIStudio.Tools.OpenXml;
|
||||
|
||||
internal static class OpenXmlElementExtensions
|
||||
{
|
||||
/// <param name="element">The element.</param>
|
||||
/// <typeparam name="T">The type of the element.</typeparam>
|
||||
extension<T>(T element) where T : OpenXmlElement
|
||||
{
|
||||
/// <summary>
|
||||
/// Takes the element out of its parent, if it has one, so that it can move to another place.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Moving keeps everything within the element, e.g., a text box with the new words of its own paragraphs,
|
||||
/// which a copy made before those were written would lack.
|
||||
/// </remarks>
|
||||
/// <returns>The element, without a parent.</returns>
|
||||
public T Detached()
|
||||
{
|
||||
if (element.Parent is not null)
|
||||
element.Remove();
|
||||
|
||||
return element;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user