소스 검색

Fixed a bug in InsertParagraph that introduced a new empty paragraph at the very beginning of a document when inserting at 0.

master
fitdev@hotmail.com 10 년 전
부모
커밋
86fb85725d
1개의 변경된 파일15개의 추가작업 그리고 8개의 파일을 삭제
  1. 15
    8
      DocX/Container.cs

+ 15
- 8
DocX/Container.cs 파일 보기

@@ -669,14 +669,21 @@ namespace Novacode
if (firstPar != null)
{
XElement[] splitParagraph = HelperFunctions.SplitParagraph(firstPar, index - firstPar.startIndex);
firstPar.Xml.ReplaceWith
(
splitParagraph[0],
newParagraph.Xml,
splitParagraph[1]
);
var splitindex = index - firstPar.startIndex;
if (splitindex <= 0)
{
firstPar.Xml.ReplaceWith(newParagraph.Xml, firstPar.Xml);
}
else {
XElement[] splitParagraph = HelperFunctions.SplitParagraph(firstPar, splitindex);
firstPar.Xml.ReplaceWith
(
splitParagraph[0],
newParagraph.Xml,
splitParagraph[1]
);
}
}
else

Loading…
취소
저장