Skip to content

Commit c009761

Browse files
authored
Added fix for #2240 (#2245)
1 parent c5da781 commit c009761

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

src/EPPlus/Style/HeaderFooterTextFormat/ExcelHeaderFooterTextCollection.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,8 +645,9 @@ internal void ReadHeaderFooterFormat(string hfText)
645645
if (hfText[i] == '+' || hfText[i] == '-')
646646
{
647647
temp.PageNumberSuffix += hfText[i];
648+
i++;
648649
}
649-
i++;
650+
650651
while (char.IsDigit( hfText[i]))
651652
{
652653
temp.PageNumberSuffix += hfText[i];

src/EPPlusTest/Issues/WorksheetIssues.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,5 +1049,15 @@ public void issue2191()
10491049

10501050
Assert.AreEqual("B2", dbv.Address);
10511051
}
1052+
[TestMethod]
1053+
public void i2240()
1054+
{
1055+
using (var package = OpenTemplatePackage("i2240.xlsx"))
1056+
{
1057+
var theText = package.Workbook.Worksheets.First().HeaderFooter.OddFooter.LeftAlignedText;
1058+
1059+
SaveAndCleanup(package);
1060+
}
1061+
}
10521062
}
10531063
}

0 commit comments

Comments
 (0)