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

View File

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