Prevent crash on running NextColumn element.
- FEHLERBEHEBUNG: Kein Absturz mehr, wenn zwei Spalten formatiert werden.
This commit is contained in:
parent
6e969dacd9
commit
644c9a513b
@ -121,6 +121,14 @@ namespace zaaReloaded2.Formatter
|
||||
{
|
||||
if (!CanRun) throw new NoLaboratoryDataException("No laboratory data to format.");
|
||||
|
||||
// Create undo record and styles prior to iterating over the elements
|
||||
// because a column switching element might trigger output to the
|
||||
// document.
|
||||
Globals.ThisAddIn.Application.UndoRecord.StartCustomRecord(
|
||||
String.Format("Laborformatierung ({0})", Properties.Settings.Default.AddinName)
|
||||
);
|
||||
CreateStyles();
|
||||
|
||||
int current = 0;
|
||||
while (current < Settings.Elements.Count)
|
||||
{
|
||||
@ -146,11 +154,6 @@ namespace zaaReloaded2.Formatter
|
||||
}
|
||||
}
|
||||
|
||||
// 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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user