SVN r1083

SVN-Revision: r1083
This commit is contained in:
tdx
2025-12-23 03:08:46 +00:00
parent edf1481bdd
commit e6483dc91e
+12 -7
View File
@@ -71,9 +71,11 @@ namespace Lskj.AutoCreatWord
bool hasMainTemp = false;
try
{
Section firstSection = null;
if (!string.IsNullOrEmpty(mainTempPath) && File.Exists(mainTempPath))
{
Section mainSection = new Section(document);
firstSection = mainSection;
//mainSection.PageSetup.DifferentFirstPageHeaderFooter = false;
document.Sections.Add(mainSection);
hasMainTemp = true;
@@ -183,13 +185,16 @@ namespace Lskj.AutoCreatWord
document.LastSection.PageSetup.PageSize = section.PageSetup.PageSize;
document.LastSection.PageSetup.Margins = section.PageSetup.Margins;
}
Section mainSection = document.LastSection;
Section lastSection = document.LastSection;
if (!moduleId.Equals("yw", StringComparison.OrdinalIgnoreCase))
{
//CpoyHeaderFooter(section, mainSection, HeaderFooterType.FooterEven);
//CpoyHeaderFooter(section, mainSection, HeaderFooterType.FooterOdd);
//CpoyHeaderFooter(section, mainSection, HeaderFooterType.HeaderEven);
//CpoyHeaderFooter(section, mainSection, HeaderFooterType.HeaderOdd);
if (firstSection != null)
{
CpoyHeaderFooter(firstSection, section, HeaderFooterType.FooterEven);
CpoyHeaderFooter(firstSection, section, HeaderFooterType.FooterOdd);
CpoyHeaderFooter(firstSection, section, HeaderFooterType.HeaderEven);
CpoyHeaderFooter(firstSection, section, HeaderFooterType.HeaderOdd);
}
}
bool isCopying = false;
foreach (DocumentObject obj in section.Body.ChildObjects)
@@ -207,7 +212,7 @@ namespace Lskj.AutoCreatWord
{
DocumentObject documentObject = obj.Clone();
//将内容添加到可替换模板
mainSection.Body.ChildObjects.Add(documentObject);
lastSection.Body.ChildObjects.Add(documentObject);
}
}
}
@@ -1670,7 +1675,7 @@ namespace Lskj.AutoCreatWord
HeaderFooter headerFooter = sourceSection.HeadersFooters[headerFooterType];
if (headerFooter != null && headerFooter.ChildObjects != null && headerFooter.ChildObjects.Count > 0)
{
targetSection.HeadersFooters[headerFooterType].LinkToPrevious = false;
//targetSection.HeadersFooters[headerFooterType].LinkToPrevious = false;
targetSection.HeadersFooters[headerFooterType].ChildObjects.Clear();
foreach (DocumentObject obj in headerFooter.ChildObjects)
{