소스 검색

Fix for:

Inserting a chart in a template throws exception "Message='rId10' ID conflicts with the ID of an existing relationship for the specified source."

provided by mmirabito.
master
MadBoy_cp 12 년 전
부모
커밋
023338a877
1개의 변경된 파일8개의 추가작업 그리고 8개의 파일을 삭제
  1. 8
    8
      DocX/DocX.cs

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

@@ -2748,14 +2748,14 @@ namespace Novacode
private string GetNextFreeRelationshipID()
{
string id =
(
from r in mainPart.GetRelationships()
select r.Id
).Max();
// The convension for ids is rid01, rid02, etc
string newId = id.Replace("rId", "");
int id = (
from r in mainPart.GetRelationships()
where r.Id.Substring(0, 3).Equals("rId")
select int.Parse(r.Id.Substring(3))
).DefaultIfEmpty().Max();
// The conventiom for ids is rid01, rid02, etc
string newId = id.ToString();
int result;
if (int.TryParse(newId, out result))
return ("rId" + (result + 1));

Loading…
취소
저장