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

Исправлены баги при работе с колонтитулами.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56042 954022d7-b5bf-4e40-9824-e11837661b57
parent 472bc6ba
......@@ -1927,8 +1927,36 @@ CDocument.prototype =
var RepH = ( null === Header || null !== SectPr.Get_HdrFtrInfo(Header) ? false : true );
var RepF = ( null === Footer || null !== SectPr.Get_HdrFtrInfo(Footer) ? false : true );
pGraphics.DrawHeaderEdit( this.Pages[nPageIndex].Y, this.HdrFtr.Lock.Get_Type(), SectIndex, RepH, null === Header ? undefined : Header.RecalcInfo.NeedRecalc[nPageIndex] );
pGraphics.DrawFooterEdit( this.Pages[nPageIndex].YLimit, this.HdrFtr.Lock.Get_Type(), SectIndex, RepF, null === Footer ? undefined : Footer.RecalcInfo.NeedRecalc[nPageIndex] );
var HeaderInfo = undefined;
if ( null !== Header && undefined !== Header.RecalcInfo.NeedRecalc[nPageIndex] )
{
var bFirst = Header.RecalcInfo.NeedRecalc[nPageIndex].bFirst;
var bEven = Header.RecalcInfo.NeedRecalc[nPageIndex].bEven;
var HeaderSectPr = Header.RecalcInfo.SectPr[nPageIndex];
if ( undefined !== HeaderSectPr )
bFirst = ( true === bFirst && true === HeaderSectPr.Get_TitlePage() ? true : false );
HeaderInfo = { bFirst : bFirst, bEven : bEven };
}
var FooterInfo = undefined;
if ( null !== Footer && undefined !== Footer.RecalcInfo.NeedRecalc[nPageIndex] )
{
var bFirst = Footer.RecalcInfo.NeedRecalc[nPageIndex].bFirst;
var bEven = Footer.RecalcInfo.NeedRecalc[nPageIndex].bEven;
var FooterSectPr = Footer.RecalcInfo.SectPr[nPageIndex];
if ( undefined !== FooterSectPr )
bFirst = ( true === bFirst && true === FooterSectPr.Get_TitlePage() ? true : false );
FooterInfo = { bFirst : bFirst, bEven : bEven };
}
pGraphics.DrawHeaderEdit( this.Pages[nPageIndex].Y, this.HdrFtr.Lock.Get_Type(), SectIndex, RepH, HeaderInfo );
pGraphics.DrawFooterEdit( this.Pages[nPageIndex].YLimit, this.HdrFtr.Lock.Get_Type(), SectIndex, RepF, FooterInfo );
}
},
......
......@@ -142,7 +142,7 @@ CHeaderFooter.prototype =
this.RecalcInfo.RecalcObj[Page_abs] = this.Content.Save_RecalculateObject();
this.RecalcInfo.NeedRecalc[Page_abs] = this.LogicDocument.Get_SectionPageNumInfo(Page_abs);
this.RecalcInfo.SectPr[Page_abs] = false;
this.RecalcInfo.SectPr[Page_abs] = SectPr;
// Если у нас до этого был какой-то пересчет, тогда сравним его с текущим.
// 1. Сравним границы: у верхнего колонтитула смотрим на изменение нижней границы, а нижнего - верхней
......@@ -1274,7 +1274,7 @@ CHeaderFooterController.prototype =
var YLimit = SectPr.Get_PageHeight() / 2;
Header.Reset( X, Y, XLimit, YLimit );
bRecalcHeader = Header.Recalculate(PageIndex);
bRecalcHeader = Header.Recalculate(PageIndex, SectPr);
}
else
{
......@@ -1304,7 +1304,7 @@ CHeaderFooterController.prototype =
Y = Math.max( 2 * YLimit / 3, YLimit - SectPr.Get_PageMargins_Footer() - SummaryHeight );
Footer.Reset( X, Y, XLimit, YLimit );
bRecalcFooter = Footer.Recalculate(PageIndex);
bRecalcFooter = Footer.Recalculate(PageIndex, SectPr);
}
else
{
......
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