Skip to content

Commit b0ab956

Browse files
committed
Bug fix - Indent value overflow #43
1 parent be317ef commit b0ab956

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

NoteHighlightAddin/AddIn.cs

+7
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
using System.Web;
2727
using GenerateHighlightContent;
2828
using System.Configuration;
29+
using System.Globalization;
2930

3031
#pragma warning disable CS3003 // Type is not CLS-compliant
3132

@@ -267,6 +268,12 @@ private void InsertHighLightCodeToCurrentSide(string fileName, string pageXml, H
267268
var page = InsertHighLightCode(htmlContent, position, parameters, outline, (new GenerateHighLight()).Config, selectedTextFormated, IsSelectedTextInline(pageXml));
268269
page.Root.SetAttributeValue("ID", existingPageId);
269270

271+
//Bug fix - remove overflow value for Indents
272+
foreach (var el in page.Descendants(ns + "Indent").Where(n => double.Parse(n.Attribute("indent").Value, new CultureInfo(page.Root.Attribute("lang").Value)) > 1000000))
273+
{
274+
el.Attribute("indent").Value = "0";
275+
}
276+
270277
OneNoteApplication.UpdatePageContent(page.ToString(), DateTime.MinValue);
271278
}
272279
}

0 commit comments

Comments
 (0)