Commit 7cbebd26 authored by Ilya Kirillov's avatar Ilya Kirillov

Fixed bug with recalculating the document after working with a drawing shapes.

parent bd0de5bd
...@@ -1194,6 +1194,14 @@ CHistory.prototype.GetAllParagraphsForRecalcData = function(Props) ...@@ -1194,6 +1194,14 @@ CHistory.prototype.GetAllParagraphsForRecalcData = function(Props)
} }
return arrParagraphs; return arrParagraphs;
}; };
CHistory.prototype.GetRecalculateIndex = function()
{
return this.RecIndex;
};
CHistory.prototype.SetRecalculateIndex = function(nIndex)
{
this.RecIndex = Math.min(this.Index, nIndex);
};
function CRC32() function CRC32()
{ {
......
...@@ -1264,14 +1264,19 @@ ParaDrawing.prototype.Set_XYForAdd = function(X, Y, NearPos, PageNum) ...@@ -1264,14 +1264,19 @@ ParaDrawing.prototype.Set_XYForAdd = function(X, Y, NearPos, PageNum)
var Layout = NearPos.Paragraph.Get_Layout(NearPos.ContentPos, this); var Layout = NearPos.Paragraph.Get_Layout(NearPos.ContentPos, this);
this.private_SetXYByLayout(X, Y, PageNum, Layout, true, true); this.private_SetXYByLayout(X, Y, PageNum, Layout, true, true);
var nRecalcIndex = -1;
var oLogicDocument = this.document; var oLogicDocument = this.document;
if (oLogicDocument) if (oLogicDocument)
{ {
nRecalcIndex = oLogicDocument.Get_History().GetRecalculateIndex();
this.SetSkipOnRecalculate(true); this.SetSkipOnRecalculate(true);
oLogicDocument.Recalculate(); oLogicDocument.Recalculate();
this.SetSkipOnRecalculate(false); this.SetSkipOnRecalculate(false);
} }
if (-1 !== nRecalcIndex)
oLogicDocument.Get_History().SetRecalculateIndex(nRecalcIndex);
Layout = NearPos.Paragraph.Get_Layout(NearPos.ContentPos, this); Layout = NearPos.Paragraph.Get_Layout(NearPos.ContentPos, this);
this.private_SetXYByLayout(X, Y, PageNum, Layout, true, true); this.private_SetXYByLayout(X, Y, PageNum, Layout, true, true);
} }
...@@ -1295,14 +1300,19 @@ ParaDrawing.prototype.Set_XY = function(X, Y, Paragraph, PageNum, bResetAlign) ...@@ -1295,14 +1300,19 @@ ParaDrawing.prototype.Set_XY = function(X, Y, Paragraph, PageNum, bResetAlign)
var Layout = Paragraph.Get_Layout(ContentPos, this); var Layout = Paragraph.Get_Layout(ContentPos, this);
this.private_SetXYByLayout(X, Y, PageNum, Layout, (bResetAlign || true !== this.PositionH.Align ? true : false), (bResetAlign || true !== this.PositionV.Align ? true : false)); this.private_SetXYByLayout(X, Y, PageNum, Layout, (bResetAlign || true !== this.PositionH.Align ? true : false), (bResetAlign || true !== this.PositionV.Align ? true : false));
var nRecalcIndex = -1;
var oLogicDocument = this.document; var oLogicDocument = this.document;
if (oLogicDocument) if (oLogicDocument)
{ {
nRecalcIndex = oLogicDocument.Get_History().GetRecalculateIndex();
this.SetSkipOnRecalculate(true); this.SetSkipOnRecalculate(true);
oLogicDocument.Recalculate(); oLogicDocument.Recalculate();
this.SetSkipOnRecalculate(false); this.SetSkipOnRecalculate(false);
} }
if (-1 !== nRecalcIndex)
oLogicDocument.Get_History().SetRecalculateIndex(nRecalcIndex);
Layout = Paragraph.Get_Layout(ContentPos, this); Layout = Paragraph.Get_Layout(ContentPos, this);
this.private_SetXYByLayout(X, Y, PageNum, Layout, (bResetAlign || true !== this.PositionH.Align ? true : false), (bResetAlign || true !== this.PositionV.Align ? true : false)); this.private_SetXYByLayout(X, Y, PageNum, Layout, (bResetAlign || true !== this.PositionH.Align ? true : false), (bResetAlign || true !== this.PositionV.Align ? true : false));
} }
......
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