Commit 00bbfa3f 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@53176 954022d7-b5bf-4e40-9824-e11837661b57
parent fb744b55
...@@ -781,10 +781,12 @@ CDocument.prototype = ...@@ -781,10 +781,12 @@ CDocument.prototype =
if ( true === bFullRecalc ) if ( true === bFullRecalc )
{ {
ChangeIndex = 0; ChangeIndex = 0;
RecalcData.Inline.PageNum = 0;
} }
else if ( -1 === RecalcData.Inline.Pos ) else if ( -1 === RecalcData.Inline.Pos )
{ {
ChangeIndex = -1; ChangeIndex = -1;
RecalcData.Inline.PageNum = 0;
} }
else if ( RecalcData.Inline.Pos >= 0 ) else if ( RecalcData.Inline.Pos >= 0 )
{ {
...@@ -1015,7 +1017,6 @@ CDocument.prototype = ...@@ -1015,7 +1017,6 @@ CDocument.prototype =
if ( undefined === Frame_YLimit ) if ( undefined === Frame_YLimit )
Frame_YLimit = Page_Height; Frame_YLimit = Page_Height;
for ( var TempIndex = Index; TempIndex < Index + FlowCount; TempIndex++ ) for ( var TempIndex = Index; TempIndex < Index + FlowCount; TempIndex++ )
{ {
var TempElement = this.Content[TempIndex]; var TempElement = this.Content[TempIndex];
...@@ -10750,7 +10751,7 @@ CDocument.prototype = ...@@ -10750,7 +10751,7 @@ CDocument.prototype =
Y_Top_Margin = Y_Top_Field; Y_Top_Margin = Y_Top_Field;
} }
this.HdrFtr.UpdateMargins( 0, true ); this.HdrFtr.UpdateMargins( 0, true, true );
break; break;
} }
...@@ -10766,7 +10767,7 @@ CDocument.prototype = ...@@ -10766,7 +10767,7 @@ CDocument.prototype =
Y_Bottom_Field = Page_Height - Y_Bottom_Margin; Y_Bottom_Field = Page_Height - Y_Bottom_Margin;
Y_Top_Field = Y_Top_Margin; Y_Top_Field = Y_Top_Margin;
this.HdrFtr.UpdateMargins( 0, true ); this.HdrFtr.UpdateMargins( 0, true, true );
break; break;
} }
...@@ -10779,7 +10780,7 @@ CDocument.prototype = ...@@ -10779,7 +10780,7 @@ CDocument.prototype =
Y_Bottom_Margin = Data.Margins_old.Bottom; Y_Bottom_Margin = Data.Margins_old.Bottom;
X_Left_Margin = Data.Margins_old.Left; X_Left_Margin = Data.Margins_old.Left;
this.HdrFtr.UpdateMargins( 0, true ); this.HdrFtr.UpdateMargins( 0, true, true );
editor.DocumentOrientation = this.Orientation === orientation_Portrait ? true : false; editor.DocumentOrientation = this.Orientation === orientation_Portrait ? true : false;
editor.sync_PageOrientCallback(editor.get_DocumentOrientation()); editor.sync_PageOrientCallback(editor.get_DocumentOrientation());
...@@ -10837,7 +10838,7 @@ CDocument.prototype = ...@@ -10837,7 +10838,7 @@ CDocument.prototype =
Y_Top_Margin = Y_Top_Field; Y_Top_Margin = Y_Top_Field;
} }
this.HdrFtr.UpdateMargins( 0, true ); this.HdrFtr.UpdateMargins( 0, true, true );
break; break;
} }
...@@ -10853,7 +10854,7 @@ CDocument.prototype = ...@@ -10853,7 +10854,7 @@ CDocument.prototype =
Y_Bottom_Field = Page_Height - Y_Bottom_Margin; Y_Bottom_Field = Page_Height - Y_Bottom_Margin;
Y_Top_Field = Y_Top_Margin; Y_Top_Field = Y_Top_Margin;
this.HdrFtr.UpdateMargins( 0, true ); this.HdrFtr.UpdateMargins( 0, true, true );
break; break;
} }
...@@ -10866,7 +10867,7 @@ CDocument.prototype = ...@@ -10866,7 +10867,7 @@ CDocument.prototype =
Y_Bottom_Margin = Data.Margins_new.Bottom; Y_Bottom_Margin = Data.Margins_new.Bottom;
X_Left_Margin = Data.Margins_new.Left; X_Left_Margin = Data.Margins_new.Left;
this.HdrFtr.UpdateMargins( 0, true ); this.HdrFtr.UpdateMargins( 0, true, true );
editor.DocumentOrientation = this.Orientation === orientation_Portrait ? true : false; editor.DocumentOrientation = this.Orientation === orientation_Portrait ? true : false;
editor.sync_PageOrientCallback(editor.get_DocumentOrientation()); editor.sync_PageOrientCallback(editor.get_DocumentOrientation());
...@@ -11578,7 +11579,7 @@ CDocument.prototype = ...@@ -11578,7 +11579,7 @@ CDocument.prototype =
Y_Top_Margin = Y_Top_Field; Y_Top_Margin = Y_Top_Field;
} }
this.HdrFtr.UpdateMargins( 0, true ); this.HdrFtr.UpdateMargins( 0, true, true );
break; break;
} }
...@@ -11598,7 +11599,7 @@ CDocument.prototype = ...@@ -11598,7 +11599,7 @@ CDocument.prototype =
Y_Bottom_Field = Page_Height - Y_Bottom_Margin; Y_Bottom_Field = Page_Height - Y_Bottom_Margin;
Y_Top_Field = Y_Top_Margin; Y_Top_Field = Y_Top_Margin;
this.HdrFtr.UpdateMargins( 0, true ); this.HdrFtr.UpdateMargins( 0, true, true );
break; break;
} }
...@@ -11618,7 +11619,7 @@ CDocument.prototype = ...@@ -11618,7 +11619,7 @@ CDocument.prototype =
Y_Bottom_Margin = Reader.GetDouble(); Y_Bottom_Margin = Reader.GetDouble();
X_Left_Margin = Reader.GetDouble(); X_Left_Margin = Reader.GetDouble();
this.HdrFtr.UpdateMargins( 0, true ); this.HdrFtr.UpdateMargins( 0, true, true );
editor.DocumentOrientation = this.Orientation === orientation_Portrait ? true : false; editor.DocumentOrientation = this.Orientation === orientation_Portrait ? true : false;
editor.sync_PageOrientCallback(editor.get_DocumentOrientation()); editor.sync_PageOrientCallback(editor.get_DocumentOrientation());
......
...@@ -417,7 +417,7 @@ CHeaderFooter.prototype = ...@@ -417,7 +417,7 @@ CHeaderFooter.prototype =
return this.Content.Get_PageBounds(0); return this.Content.Get_PageBounds(0);
}, },
UpdateMargins : function(bNoRecalc) UpdateMargins : function(bNoRecalc, bNoSaveHistory)
{ {
// Обновляем границы // Обновляем границы
this.Content.X = X_Left_Field; this.Content.X = X_Left_Field;
...@@ -425,8 +425,12 @@ CHeaderFooter.prototype = ...@@ -425,8 +425,12 @@ CHeaderFooter.prototype =
// Запускаем пересчет // Запускаем пересчет
if ( hdrftr_Footer === this.Type ) if ( hdrftr_Footer === this.Type )
{
if ( true !== bNoSaveHistory )
{ {
History.Add( this, { Type : historyitem_HdrFtr_BoundY2, Old : this.BoundY2, New : Page_Height - Y_Default_Footer } ); History.Add( this, { Type : historyitem_HdrFtr_BoundY2, Old : this.BoundY2, New : Page_Height - Y_Default_Footer } );
}
this.BoundY2 = Page_Height - Y_Default_Footer; this.BoundY2 = Page_Height - Y_Default_Footer;
} }
...@@ -2010,29 +2014,29 @@ CHeaderFooterController.prototype = ...@@ -2010,29 +2014,29 @@ CHeaderFooterController.prototype =
return -1; return -1;
}, },
UpdateMargins : function(Index, bNoRecalc) UpdateMargins : function(Index, bNoRecalc, bNoSaveHistory)
{ {
var SectHdrFtr = this.Content[Index]; var SectHdrFtr = this.Content[Index];
var Headers = SectHdrFtr.Header; var Headers = SectHdrFtr.Header;
var Footers = SectHdrFtr.Footer; var Footers = SectHdrFtr.Footer;
if ( Headers.First != Headers.Odd && Headers.First != Headers.Even && null != Headers.First ) if ( Headers.First != Headers.Odd && Headers.First != Headers.Even && null != Headers.First )
Headers.First.UpdateMargins(bNoRecalc); Headers.First.UpdateMargins(bNoRecalc, bNoSaveHistory);
if ( Headers.Even != Headers.Odd && null != Headers.Even ) if ( Headers.Even != Headers.Odd && null != Headers.Even )
Headers.Even.UpdateMargins(bNoRecalc); Headers.Even.UpdateMargins(bNoRecalc, bNoSaveHistory);
if ( null != Headers.Odd ) if ( null != Headers.Odd )
Headers.Odd.UpdateMargins(bNoRecalc); Headers.Odd.UpdateMargins(bNoRecalc, bNoSaveHistory);
if ( Footers.First != Footers.Odd && Footers.First != Footers.Even && null != Footers.First ) if ( Footers.First != Footers.Odd && Footers.First != Footers.Even && null != Footers.First )
Footers.First.UpdateMargins(bNoRecalc); Footers.First.UpdateMargins(bNoRecalc, bNoSaveHistory);
if ( Footers.Even != Footers.Odd && null != Footers.Even ) if ( Footers.Even != Footers.Odd && null != Footers.Even )
Footers.Even.UpdateMargins(bNoRecalc); Footers.Even.UpdateMargins(bNoRecalc, bNoSaveHistory);
if ( null != Footers.Odd ) if ( null != Footers.Odd )
Footers.Odd.UpdateMargins(bNoRecalc); Footers.Odd.UpdateMargins(bNoRecalc, bNoSaveHistory);
}, },
......
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