Skip to content

Commit 8397f0c

Browse files
committed
Updated Alignment and Indentations Features
1 parent 41a65e1 commit 8397f0c

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

FileFormat.Words/OpenXML.Words.cs

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ private void SetIndentation(WP.ParagraphProperties paragraphProperties, FF.Inden
253253

254254
if (ffIndentation.Hanging > 0)
255255
{
256-
indentation.Hanging = (ffIndentation.FirstLine * 1440).ToString();
256+
indentation.Hanging = (ffIndentation.Hanging * 1440).ToString();
257257
}
258258

259259
paragraphProperties.Append(indentation);
@@ -560,13 +560,23 @@ internal FF.Paragraph LoadParagraph(WP.Paragraph wpPara, int id)
560560
ffP.Alignment = MapJustificationToAlignment(justificationElement.Val);
561561
}
562562
var Indentation = paraProps.Elements<WP.Indentation>().FirstOrDefault();
563-
if (Indentation != null)
563+
if (Indentation.Left != null)
564+
{
565+
ffP.Indentation.Left = int.Parse(Indentation.Left);
566+
}
567+
if (Indentation.Right != null)
564568
{
565-
ffP.Indentation.Left = int.Parse(Indentation.Left);
566569
ffP.Indentation.Right = int.Parse(Indentation.Right);
570+
}
571+
if (Indentation.Hanging != null)
572+
{
567573
ffP.Indentation.Hanging = int.Parse(Indentation.Hanging);
574+
}
575+
if (Indentation.FirstLine != null)
576+
{
568577
ffP.Indentation.FirstLine = int.Parse(Indentation.FirstLine);
569578
}
579+
570580
var runs = wpPara.Elements<WP.Run>();
571581

572582
foreach (var wpR in runs)
@@ -598,6 +608,11 @@ internal FF.Paragraph LoadParagraph(WP.Paragraph wpPara, int id)
598608
}
599609
}
600610

611+
private bool IsBulletStyle(string styleId)
612+
{
613+
return styleId == "BulletStyle";
614+
}
615+
601616
private string MapJustificationToAlignment(WP.JustificationValues justificationValue)
602617
{
603618
switch (justificationValue)

0 commit comments

Comments
 (0)