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

Повторено поведение Word в плане копирования колонтитулов при объединении секций (баг 28325).

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@64708 954022d7-b5bf-4e40-9824-e11837661b57
parent 6b4e9f13
...@@ -10960,7 +10960,7 @@ CDocument.prototype = ...@@ -10960,7 +10960,7 @@ CDocument.prototype =
this.Internal_Content_Add(this.Content.length, new Paragraph( this.DrawingDocument, this, 0, 0, 0, 0, 0 ) ); this.Internal_Content_Add(this.Content.length, new Paragraph( this.DrawingDocument, this, 0, 0, 0, 0, 0 ) );
// Обновим информацию о секциях // Обновим информацию о секциях
this.SectionsInfo.Update_OnRemove( Position, Count ); this.SectionsInfo.Update_OnRemove(Position, Count, true);
// Проверим последний параграф // Проверим последний параграф
this.Check_SectionLastParagraph(); this.Check_SectionLastParagraph();
...@@ -15273,7 +15273,7 @@ CDocumentSectionsInfo.prototype = ...@@ -15273,7 +15273,7 @@ CDocumentSectionsInfo.prototype =
} }
}, },
Update_OnRemove : function(Pos, Count) Update_OnRemove : function(Pos, Count, bCheckHdrFtr)
{ {
var Len = this.Elements.length; var Len = this.Elements.length;
...@@ -15281,13 +15281,33 @@ CDocumentSectionsInfo.prototype = ...@@ -15281,13 +15281,33 @@ CDocumentSectionsInfo.prototype =
{ {
var CurPos = this.Elements[Index].Index; var CurPos = this.Elements[Index].Index;
if ( CurPos >= Pos && CurPos < Pos + Count ) if (CurPos >= Pos && CurPos < Pos + Count)
{ {
this.Elements.splice( Index, 1 ); // Копируем поведение Word: Если у следующей секции не задан вообще ни один колонтитул,
// тогда копируем ссылки на колонтитулы из удаляемой секции. Если задан хоть один колонтитул,
// тогда этого не делаем.
if (true === bCheckHdrFtr && Index < Len - 1)
{
var CurrSectPr = this.Elements[Index].SectPr;
var NextSectPr = this.Elements[Index + 1].SectPr;
if (true === NextSectPr.Is_AllHdrFtrNull() && true !== CurrSectPr.Is_AllHdrFtrNull())
{
NextSectPr.Set_Header_First(CurrSectPr.Get_Header_First());
NextSectPr.Set_Header_Even(CurrSectPr.Get_Header_Even());
NextSectPr.Set_Header_Default(CurrSectPr.Get_Header_Default());
NextSectPr.Set_Footer_First(CurrSectPr.Get_Footer_First());
NextSectPr.Set_Footer_Even(CurrSectPr.Get_Footer_Even());
NextSectPr.Set_Footer_Default(CurrSectPr.Get_Footer_Default());
}
}
this.Elements.splice(Index, 1);
Len--; Len--;
Index--; Index--;
} }
else if ( CurPos >= Pos + Count ) else if (CurPos >= Pos + Count)
this.Elements[Index].Index -= Count; this.Elements[Index].Index -= Count;
} }
} }
......
...@@ -94,12 +94,25 @@ CSectionPr.prototype = ...@@ -94,12 +94,25 @@ CSectionPr.prototype =
Clear_AllHdrFtr : function() Clear_AllHdrFtr : function()
{ {
this.Set_Header_First( null ); this.Set_Header_First(null);
this.Set_Header_Even( null ); this.Set_Header_Even(null);
this.Set_Header_Default( null ); this.Set_Header_Default(null);
this.Set_Footer_First( null ); this.Set_Footer_First(null);
this.Set_Footer_Even( null ); this.Set_Footer_Even(null);
this.Set_Footer_Default( null ); this.Set_Footer_Default(null);
},
Is_AllHdrFtrNull : function()
{
if (null !== this.FooterFirst
|| null !== this.HeaderFirst
|| null !== this.FooterDefault
|| null !== this.HeaderDefault
|| null !== this.FooterEven
|| null !== this.HeaderEven)
return false;
return true;
}, },
Compare_PageSize : function(OtherSectionPr) Compare_PageSize : function(OtherSectionPr)
...@@ -1557,7 +1570,7 @@ CSectionPr.prototype = ...@@ -1557,7 +1570,7 @@ CSectionPr.prototype =
this.PageNumType.Read_FromBinary( Reader ); this.PageNumType.Read_FromBinary( Reader );
this.Columns.Read_FromBinary(Reader); this.Columns.Read_FromBinary(Reader);
} }
} };
function CSectionPageSize() function CSectionPageSize()
{ {
...@@ -1637,7 +1650,7 @@ CSectionPageMargins.prototype = ...@@ -1637,7 +1650,7 @@ CSectionPageMargins.prototype =
this.Header = Reader.GetDouble(); this.Header = Reader.GetDouble();
this.Footer = Reader.GetDouble(); this.Footer = Reader.GetDouble();
} }
} };
function CSectionBorders() function CSectionBorders()
{ {
...@@ -1691,7 +1704,7 @@ CSectionBorders.prototype = ...@@ -1691,7 +1704,7 @@ CSectionBorders.prototype =
this.OffsetFrom = Reader.GetByte(); this.OffsetFrom = Reader.GetByte();
this.ZOrder = Reader.GetByte(); this.ZOrder = Reader.GetByte();
} }
} };
function CSectionPageNumType() function CSectionPageNumType()
{ {
...@@ -1713,7 +1726,7 @@ CSectionPageNumType.prototype = ...@@ -1713,7 +1726,7 @@ CSectionPageNumType.prototype =
this.Start = Reader.GetLong(); this.Start = Reader.GetLong();
} }
} };
function CSectionPageNumInfo(FP, CP, bFirst, bEven, PageNum) function CSectionPageNumInfo(FP, CP, bFirst, bEven, PageNum)
...@@ -1735,7 +1748,7 @@ CSectionPageNumInfo.prototype = ...@@ -1735,7 +1748,7 @@ CSectionPageNumInfo.prototype =
return true; return true;
} }
} };
function CSectionColumn() function CSectionColumn()
{ {
...@@ -1762,7 +1775,7 @@ CSectionColumn.prototype = ...@@ -1762,7 +1775,7 @@ CSectionColumn.prototype =
this.W = Reader.GetDouble(); this.W = Reader.GetDouble();
this.Space = Reader.GetDouble(); this.Space = Reader.GetDouble();
} }
} };
function CSectionColumns() function CSectionColumns()
{ {
......
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