Commit fe93796a authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

Правка багов с z-индексами при совместном редактировании.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@57288 954022d7-b5bf-4e40-9824-e11837661b57
parent 6190c79f
...@@ -7616,7 +7616,10 @@ CDocument.prototype = ...@@ -7616,7 +7616,10 @@ CDocument.prototype =
else if ( docpostype_DrawingObjects === this.CurPos.Type ) else if ( docpostype_DrawingObjects === this.CurPos.Type )
{ {
var ParaDrawing = this.DrawingObjects.getMajorParaDrawing(); var ParaDrawing = this.DrawingObjects.getMajorParaDrawing();
ParaDrawing.GoTo_Text(); if(ParaDrawing)
{
ParaDrawing.GoTo_Text();
}
return this.DrawingObjects.resetSelection(); return this.DrawingObjects.resetSelection();
} }
else if ( docpostype_Content === this.CurPos.Type ) else if ( docpostype_Content === this.CurPos.Type )
......
...@@ -227,6 +227,7 @@ CGraphicObjects.prototype = ...@@ -227,6 +227,7 @@ CGraphicObjects.prototype =
this.drawingObjects[i].GraphicObj.recalculateText(); this.drawingObjects[i].GraphicObj.recalculateText();
} }
} }
this.zIndexManager.startRefreshIndex = 0;
this.zIndexManager.recalculate(); this.zIndexManager.recalculate();
//TODO //TODO
} }
...@@ -2839,20 +2840,22 @@ ZIndexManager.prototype = ...@@ -2839,20 +2840,22 @@ ZIndexManager.prototype =
Load_Changes: function(r) Load_Changes: function(r)
{ {
var type = r.GetLong(); var type = r.GetLong();
var Pos; var Pos, ChangedPos;
switch(type) switch(type)
{ {
case historyitem_ZIndexManagerRemoveItem: case historyitem_ZIndexManagerRemoveItem:
{ {
Pos = r.GetLong(); Pos = r.GetLong();
this.Content.splice(Pos, 1); ChangedPos = this.m_oContentChanges.Check(contentchanges_Remove, Pos);
this.Content.splice(ChangedPos, 1);
break; break;
} }
case historyitem_ZIndexManagerAddItem: case historyitem_ZIndexManagerAddItem:
{ {
Pos = r.GetLong(); Pos = r.GetLong();
var Id = r.GetString2(); var Id = r.GetString2();
this.Content.splice(Pos, 0, g_oTableId.Get_ById(Id)); ChangedPos = this.m_oContentChanges.Check(contentchanges_Add, Pos);
this.Content.splice(ChangedPos, 0, g_oTableId.Get_ById(Id));
break; break;
} }
} }
......
...@@ -217,7 +217,8 @@ CHistory.prototype = ...@@ -217,7 +217,8 @@ CHistory.prototype =
( Class instanceof CTableRow && ( historyitem_TableRow_AddCell === Data.Type || historyitem_TableRow_RemoveCell === Data.Type ) ) || ( Class instanceof CTableRow && ( historyitem_TableRow_AddCell === Data.Type || historyitem_TableRow_RemoveCell === Data.Type ) ) ||
( Class instanceof Paragraph && ( historyitem_Paragraph_AddItem === Data.Type || historyitem_Paragraph_RemoveItem === Data.Type ) ) || ( Class instanceof Paragraph && ( historyitem_Paragraph_AddItem === Data.Type || historyitem_Paragraph_RemoveItem === Data.Type ) ) ||
( Class instanceof ParaHyperlink && ( historyitem_Hyperlink_AddItem === Data.Type || historyitem_Hyperlink_RemoveItem === Data.Type ) ) || ( Class instanceof ParaHyperlink && ( historyitem_Hyperlink_AddItem === Data.Type || historyitem_Hyperlink_RemoveItem === Data.Type ) ) ||
( Class instanceof ParaRun && ( historyitem_ParaRun_AddItem === Data.Type || historyitem_ParaRun_RemoveItem === Data.Type ) ) ) ( Class instanceof ParaRun && ( historyitem_ParaRun_AddItem === Data.Type || historyitem_ParaRun_RemoveItem === Data.Type ) ) ||
( Class instanceof ZIndexManager && (historyitem_ZIndexManagerRemoveItem === Data.Type || historyitem_ZIndexManagerAddItem === Data.Type )))
{ {
var bAdd = ( ( Class instanceof CDocument && historyitem_Document_AddItem === Data.Type ) || var bAdd = ( ( Class instanceof CDocument && historyitem_Document_AddItem === Data.Type ) ||
( Class instanceof CDocumentContent && historyitem_DocumentContent_AddItem === Data.Type ) || ( Class instanceof CDocumentContent && historyitem_DocumentContent_AddItem === Data.Type ) ||
...@@ -225,7 +226,8 @@ CHistory.prototype = ...@@ -225,7 +226,8 @@ CHistory.prototype =
( Class instanceof CTableRow && historyitem_TableRow_AddCell === Data.Type ) || ( Class instanceof CTableRow && historyitem_TableRow_AddCell === Data.Type ) ||
( Class instanceof Paragraph && historyitem_Paragraph_AddItem === Data.Type ) || ( Class instanceof Paragraph && historyitem_Paragraph_AddItem === Data.Type ) ||
( Class instanceof ParaHyperlink && historyitem_Hyperlink_AddItem === Data.Type ) || ( Class instanceof ParaHyperlink && historyitem_Hyperlink_AddItem === Data.Type ) ||
( Class instanceof ParaRun && historyitem_ParaRun_AddItem === Data.Type ) ( Class instanceof ParaRun && historyitem_ParaRun_AddItem === Data.Type ) ||
( Class instanceof ZIndexManager && historyitem_ZIndexManagerAddItem === Data.Type )
) ? true : false; ) ? true : false;
var Count = 1; var Count = 1;
......
...@@ -3931,7 +3931,6 @@ function ParaDrawing(W, H, GraphicObj, DrawingDocument, DocumentContent, Parent) ...@@ -3931,7 +3931,6 @@ function ParaDrawing(W, H, GraphicObj, DrawingDocument, DocumentContent, Parent)
this.snapArrayX = []; this.snapArrayX = [];
this.snapArrayY = []; this.snapArrayY = [];
this.bNeedUpdateWH = true; this.bNeedUpdateWH = true;
this.setZIndex();
//------------------------------------------------------------ //------------------------------------------------------------
g_oTableId.Add( this, this.Id ); g_oTableId.Add( this, this.Id );
...@@ -4995,11 +4994,6 @@ ParaDrawing.prototype = ...@@ -4995,11 +4994,6 @@ ParaDrawing.prototype =
break; break;
} }
case historyitem_Drawing_SetZIndex:
{
this.RelativeHeight = Data.oldIndex;
break;
}
case historyitem_Drawing_SetGraphicObject: case historyitem_Drawing_SetGraphicObject:
{ {
...@@ -5142,11 +5136,6 @@ ParaDrawing.prototype = ...@@ -5142,11 +5136,6 @@ ParaDrawing.prototype =
break; break;
} }
case historyitem_Drawing_SetZIndex:
{
this.RelativeHeight = Data.newIndex;
break;
}
case historyitem_Drawing_SetGraphicObject: case historyitem_Drawing_SetGraphicObject:
{ {
...@@ -5551,11 +5540,6 @@ ParaDrawing.prototype = ...@@ -5551,11 +5540,6 @@ ParaDrawing.prototype =
break; break;
} }
case historyitem_Drawing_SetZIndex:
{
Writer.WriteLong(Data.newIndex);
break;
}
case historyitem_Drawing_SetGraphicObject: case historyitem_Drawing_SetGraphicObject:
{ {
...@@ -5773,11 +5757,6 @@ ParaDrawing.prototype = ...@@ -5773,11 +5757,6 @@ ParaDrawing.prototype =
break; break;
} }
case historyitem_Drawing_SetZIndex:
{
this.RelativeHeight = Reader.GetLong();
break;
}
case historyitem_Drawing_SetGraphicObject: case historyitem_Drawing_SetGraphicObject:
{ {
...@@ -6087,14 +6066,6 @@ ParaDrawing.prototype = ...@@ -6087,14 +6066,6 @@ ParaDrawing.prototype =
return []; return [];
}, },
setZIndex: function()
{
var data = {Type:historyitem_Drawing_SetZIndex, oldIndex: this.RelativeHeight};
if(this.mainGraphicObjects)
this.RelativeHeight = ++this.mainGraphicObjects.maximalGraphicObjectZIndex;
data.newIndex = this.RelativeHeight;
History.Add(this, data);
},
setZIndex2: function(zIndex) setZIndex2: function(zIndex)
{ {
...@@ -6998,26 +6969,16 @@ ParaDrawing.prototype = ...@@ -6998,26 +6969,16 @@ ParaDrawing.prototype =
{ {
var g = this.GraphicObj.copy(c); var g = this.GraphicObj.copy(c);
c.Set_GraphicObject(g); c.Set_GraphicObject(g);
if(g.isGroup()) g.setParent(c);
g.calculateAfterOpen3();
else if(!(typeof CChartAsGroup != "undefined" && g instanceof CChartAsGroup))
g.calculateAfterOpen();
else
g.init2();
} }
var d = this.Distance; var d = this.Distance;
c.Set_PositionH( this.PositionH.RelativeFrom, this.PositionH.Align, this.PositionH.Value ); c.Set_PositionH( this.PositionH.RelativeFrom, this.PositionH.Align, this.PositionH.Value );
c.Set_PositionV( this.PositionV.RelativeFrom, this.PositionV.Align, this.PositionV.Value ); c.Set_PositionV( this.PositionV.RelativeFrom, this.PositionV.Align, this.PositionV.Value );
c.Set_Distance(d.L, d.T, d.R, d.B); c.Set_Distance(d.L, d.T, d.R, d.B);
c.setZIndex();
c.Set_AllowOverlap(this.AllowOverlap); c.Set_AllowOverlap(this.AllowOverlap);
c.Set_WrappingType(this.wrappingType); c.Set_WrappingType(this.wrappingType);
c.Set_BehindDoc(this.behindDoc); c.Set_BehindDoc(this.behindDoc);
c.Update_Size(this.W, this.H); c.Update_Size(this.W, this.H);
History.Add(c, {Type: historyitem_CalculateAfterPaste});
return c; return c;
}, },
......
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