Output formatting.

- NEU: Formatierung der Ausgabe mit Absatzvorlage.
This commit is contained in:
Daniel Kraus
2015-08-05 21:52:06 +02:00
parent d0bd7dd2a5
commit 2cefede3c0
5 changed files with 58 additions and 1 deletions

View File

@ -145,6 +145,8 @@ namespace zaaReloaded2.Formatter
current++;
}
}
CreateParagraphStyle();
_secondaryBuffer.ParagraphStyle = zaaReloaded2.Properties.Settings.Default.ParagraphStyleName;
_secondaryBuffer.Flush();
}
@ -206,6 +208,34 @@ namespace zaaReloaded2.Formatter
ProcessAllTimePoints(controlElement.FormatElements);
}
/// <summary>
/// Creates a zaaReloaded2 paragraph style in the document.
/// </summary>
public void CreateParagraphStyle()
{
if (Document != null)
{
Style style;
// Don't see a better way to check for the existence of a particular
// paragraph style than by using a try...catch construction.
try
{
style = Document.Styles[Properties.Settings.Default.ParagraphStyleName];
}
catch
{
style = Document.Styles.Add(Properties.Settings.Default.ParagraphStyleName);
style.Font.Size = 10; // pt
style.Font.Bold = 0;
style.Font.Italic = 0;
style.Font.Underline = 0;
style.ParagraphFormat.LeftIndent = 36; // pt
style.ParagraphFormat.FirstLineIndent = -36; // pt
style.ParagraphFormat.Alignment = WdParagraphAlignment.wdAlignParagraphJustify;
}
}
}
#endregion
#region Protected methods