File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -115,9 +115,7 @@ creates one using the [AddNewPart\<T\>()](https://msdn.microsoft.com/en-us/libra
115115 document .MainDocumentPart .WordprocessingCommentsPart .Comments ;
116116 if (comments .HasChildren )
117117 {
118- id = comments .Descendants <Comment >().Select (e => e .Id .Value ).Max ();
119- var i = Int32 .Parse (id );
120- id = (++ i ).ToString ();
118+ id = (comments .Descendants <Comment >().Select (e => int .Parse (e .Id .Value )).Max () + 1 ).ToString ();
121119 }
122120 }
123121 else
@@ -280,9 +278,7 @@ Following is the complete sample code in both C\# and Visual Basic.
280278 if (comments .HasChildren )
281279 {
282280 // Obtain an unused ID.
283- id = comments .Descendants <Comment >().Select (e => e .Id .Value ).Max ();
284- var i = Int32 .Parse (id );
285- id = (++ i ).ToString ();
281+ id = (comments .Descendants <Comment >().Select (e => int .Parse (e .Id .Value )).Max () + 1 ).ToString ();
286282 }
287283 }
288284 else
You can’t perform that action at this time.
0 commit comments