Use UndoRecord.

- VERBESSERT: Formatierung erscheint nur noch als 1 Undo-Schritt.
This commit is contained in:
Daniel Kraus 2015-08-17 19:41:07 +02:00
parent 8d24a669ac
commit 94ebf5508b
1 changed files with 7 additions and 1 deletions

View File

@ -121,7 +121,6 @@ namespace zaaReloaded2.Formatter
{
if (!CanRun) throw new NoLaboratoryDataException("No laboratory data to format.");
CreateStyles();
int current = 0;
while (current < Settings.Elements.Count)
{
@ -146,7 +145,14 @@ namespace zaaReloaded2.Formatter
current++;
}
}
// Write everything to the Word document
Globals.ThisAddIn.Application.UndoRecord.StartCustomRecord(
String.Format("Laborformatierung ({0})", Properties.Settings.Default.AddinName)
);
CreateStyles();
_secondaryBuffer.Flush();
Globals.ThisAddIn.Application.UndoRecord.EndCustomRecord();
}
/// <summary>