Commit 0dfe9277 authored by Ilya.Kirillov's avatar Ilya.Kirillov Committed by Alexander.Trofimov

Исправлен баг с некопированием колонтитулов во время слияния документов (баг 30408).

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@64891 954022d7-b5bf-4e40-9824-e11837661b57
parent 6452170e
...@@ -14256,7 +14256,7 @@ CDocument.prototype.Get_MailMergedDocument = function(_nStartIndex, _nEndIndex) ...@@ -14256,7 +14256,7 @@ CDocument.prototype.Get_MailMergedDocument = function(_nStartIndex, _nEndIndex)
for (var Index = nStartIndex; Index <= nEndIndex; Index++) for (var Index = nStartIndex; Index <= nEndIndex; Index++)
{ {
// Подменяем ссылку на менедре полей, чтобы скопированные поля регистрировались в новом классе // Подменяем ссылку на менеджер полей, чтобы скопированные поля регистрировались в новом классе
this.FieldsManager = LogicDocument.FieldsManager; this.FieldsManager = LogicDocument.FieldsManager;
var NewNumbering = this.Numbering.Copy_All_AbstractNums(); var NewNumbering = this.Numbering.Copy_All_AbstractNums();
LogicDocument.Numbering.Append_AbstractNums(NewNumbering.AbstractNums); LogicDocument.Numbering.Append_AbstractNums(NewNumbering.AbstractNums);
...@@ -14266,17 +14266,28 @@ CDocument.prototype.Get_MailMergedDocument = function(_nStartIndex, _nEndIndex) ...@@ -14266,17 +14266,28 @@ CDocument.prototype.Get_MailMergedDocument = function(_nStartIndex, _nEndIndex)
for (var ContentIndex = 0; ContentIndex < ContentCount; ContentIndex++) for (var ContentIndex = 0; ContentIndex < ContentCount; ContentIndex++)
{ {
LogicDocument.Content[OverallIndex++] = this.Content[ContentIndex].Copy(LogicDocument, this.DrawingDocument); LogicDocument.Content[OverallIndex++] = this.Content[ContentIndex].Copy(LogicDocument, this.DrawingDocument);
}
LogicDocument.FieldsManager.Replace_MailMergeFields(this.MailMergeMap[Index]); if (type_Paragraph === this.Content[ContentIndex].Get_Type())
{
var ParaSectPr = this.Content[ContentIndex].Get_SectionPr();
if (ParaSectPr)
{
var NewParaSectPr = new CSectionPr();
NewParaSectPr.Copy(ParaSectPr, true);
LogicDocument.Content[OverallIndex - 1].Set_SectionPr(NewParaSectPr, false);
}
}
}
// Добавляем дополнительный параграф с окончанием секции // Добавляем дополнительный параграф с окончанием секции
var SectionPara = new Paragraph(this.DrawingDocument, this, 0, 0, 0, 0, 0); var SectionPara = new Paragraph(this.DrawingDocument, this, 0, 0, 0, 0, 0);
var SectPr = new CSectionPr(); var SectPr = new CSectionPr();
SectPr.Copy(this.SectPr); SectPr.Copy(this.SectPr, true);
SectPr.Set_Type(section_type_NextPage); SectPr.Set_Type(section_type_NextPage);
SectionPara.Set_SectionPr(SectPr, false); SectionPara.Set_SectionPr(SectPr, false);
LogicDocument.Content[OverallIndex++] = SectionPara; LogicDocument.Content[OverallIndex++] = SectionPara;
LogicDocument.FieldsManager.Replace_MailMergeFields(this.MailMergeMap[Index]);
} }
this.CopyNumberingMap = null; this.CopyNumberingMap = null;
......
...@@ -60,7 +60,7 @@ CSectionPr.prototype = ...@@ -60,7 +60,7 @@ CSectionPr.prototype =
return this.Id; return this.Id;
}, },
Copy : function(Other) Copy : function(Other, CopyHdrFtr)
{ {
// Тип // Тип
this.Set_Type( Other.Type ); this.Set_Type( Other.Type );
...@@ -82,12 +82,47 @@ CSectionPr.prototype = ...@@ -82,12 +82,47 @@ CSectionPr.prototype =
this.Set_Borders_ZOrder( Other.Borders.ZOrder ); this.Set_Borders_ZOrder( Other.Borders.ZOrder );
// Колонтитулы // Колонтитулы
this.Set_Header_First( Other.HeaderFirst ); if (true === CopyHdrFtr)
this.Set_Header_Even( Other.HeaderEven ); {
this.Set_Header_Default( Other.HeaderDefault ); if (Other.HeaderFirst)
this.Set_Footer_First( Other.FooterFirst ); this.Set_Header_First(Other.HeaderFirst.Copy());
this.Set_Footer_Even( Other.FooterEven ); else
this.Set_Footer_Default( Other.FooterDefault ); this.Set_Header_First(null);
if (Other.HeaderEven)
this.Set_Header_Even(Other.HeaderEven.Copy());
else
this.Set_Header_Even(null);
if (Other.HeaderDefault)
this.Set_Header_Default(Other.HeaderDefault.Copy());
else
this.Set_Header_Default(null);
if (Other.FooterFirst)
this.Set_Footer_First(Other.FooterFirst.Copy());
else
this.Set_Footer_First(null);
if (Other.FooterEven)
this.Set_Footer_Even(Other.FooterEven.Copy());
else
this.Set_Footer_Even(null);
if (Other.FooterDefault)
this.Set_Footer_Default(Other.FooterDefault.Copy());
else
this.Set_Footer_Default(null);
}
else
{
this.Set_Header_First(Other.HeaderFirst);
this.Set_Header_Even(Other.HeaderEven);
this.Set_Header_Default(Other.HeaderDefault);
this.Set_Footer_First(Other.FooterFirst);
this.Set_Footer_Even(Other.FooterEven);
this.Set_Footer_Default(Other.FooterDefault);
}
this.Set_PageNum_Start( Other.PageNumType.Start ); this.Set_PageNum_Start( Other.PageNumType.Start );
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment