foreach
(var section
in
this
.document.Sections)
{
bool
shouldInsert =
false
;
foreach
(var block
in
section.Blocks.ToList())
{
var paragraph = block
as
Paragraph;
if
(paragraph !=
null
&& paragraph.ListId > -1)
{
shouldInsert =
true
;
}
else
if
(shouldInsert)
{
var paragraphToInsert =
new
Paragraph(
this
.document);
paragraphToInsert.Spacing.LineSpacing = 1;
paragraphToInsert.Spacing.LineSpacingType = HeightType.Exact;
paragraphToInsert.Spacing.SpacingAfter = 0;
block.BlockContainer.Blocks.Insert(section.Blocks.IndexOf(block), paragraphToInsert);
shouldInsert =
false
;
}
}
}