Commit 3a616e65 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin

Поправлены баги в быстром совместном редактировании

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@66178 954022d7-b5bf-4e40-9824-e11837661b57
parent 5558d434
......@@ -5614,11 +5614,14 @@ DrawingObjectsController.prototype =
oState.DrawingsSelectionState = this.getSelectionState()[0];
},
loadDocumentStateAfterLoadChanges: function(oSelectionState)
loadDocumentStateAfterLoadChanges: function(oSelectionState, PageIndex)
{
var bDocument = isRealObject(this.document);
var nPageIndex = 0;
if(!bDocument)
if(isRealNumber(PageIndex)){
nPageIndex = PageIndex;
}
else if(!bDocument)
{
if(this.drawingObjects.getObjectType && this.drawingObjects.getObjectType() === historyitem_type_Slide)
{
......@@ -5630,9 +5633,9 @@ DrawingObjectsController.prototype =
var oDrawingSelectionState = oSelectionState.DrawingsSelectionState;
if(oDrawingSelectionState.textObject)
{
if(oDrawingSelectionState.textObject.Is_UseInDocument())
if(oDrawingSelectionState.textObject.Is_UseInDocument() && (!oDrawingSelectionState.textObject.group || oDrawingSelectionState.textObject.group === this))
{
this.selectObject(oDrawingSelectionState.textObject, bDocument ? oDrawingSelectionState.textObject.parent.PageNum : nPageIndex);
this.selectObject(oDrawingSelectionState.textObject, bDocument ? (oDrawingSelectionState.textObject.parent ? oDrawingSelectionState.textObject.parent.PageNum : nPageIndex) : nPageIndex);
var oDocContent = oDrawingSelectionState.textObject.getDocContent();
if(oDocContent){
if (true === oSelectionState.DrawingSelection)
......@@ -5643,6 +5646,10 @@ DrawingObjectsController.prototype =
else
{
oDocContent.Set_ContentPosition(oSelectionState.Pos, 0, 0);
if(this.document){
this.document.NeedUpdateTarget = true;
this.document.RecalculateCurPos();
}
}
this.selection.textSelection = oDrawingSelectionState.textObject;
}
......@@ -5652,9 +5659,18 @@ DrawingObjectsController.prototype =
{
if(oDrawingSelectionState.groupObject.Is_UseInDocument())
{
this.selectObject(oDrawingSelectionState.groupObject, bDocument ? oDrawingSelectionState.groupObject.parent.PageNum : nPageIndex);
oDrawingSelectionState.groupSelection.resetSelection(oDrawingSelectionState.groupSelection);
if(oDrawingSelectionState.groupObject.loadDocumentStateAfterLoadChanges(oDrawingSelectionState.groupSelection))
this.selectObject(oDrawingSelectionState.groupObject, bDocument ? (oDrawingSelectionState.groupObject.parent ? oDrawingSelectionState.groupObject.parent.PageNum : nPageIndex) : nPageIndex);
oDrawingSelectionState.groupObject.resetSelection(this);
var oState =
{
DrawingsSelectionState: oDrawingSelectionState.groupSelection,
Pos: oSelectionState.Pos,
StartPos: oSelectionState.StartPos,
EndPos: oSelectionState.EndPos,
DrawingSelection: oSelectionState.DrawingSelection
};
if(oDrawingSelectionState.groupObject.loadDocumentStateAfterLoadChanges(oState, nPageIndex))
{
this.selection.groupSelection = oDrawingSelectionState.groupObject;
}
......@@ -5664,7 +5680,7 @@ DrawingObjectsController.prototype =
{
if(oDrawingSelectionState.chartObject.Is_UseInDocument())
{
this.selectObject(oDrawingSelectionState.chartObject, bDocument ? oDrawingSelectionState.chartObject.parent.PageNum : nPageIndex);
this.selectObject(oDrawingSelectionState.chartObject, bDocument ? (oDrawingSelectionState.chartObject.parent ? oDrawingSelectionState.chartObject.parent.PageNum : nPageIndex) : nPageIndex);
oDrawingSelectionState.chartObject.resetSelection();
if(oDrawingSelectionState.chartObject.loadDocumentStateAfterLoadChanges(oDrawingSelectionState.chartSelection))
{
......@@ -5690,7 +5706,7 @@ DrawingObjectsController.prototype =
var oSp = oDrawingSelectionState.selection[i].object;
if(oSp.Is_UseInDocument())
{
this.selectObject(oSp, bDocument ? oSp.parent.PageNum : nPageIndex);
this.selectObject(oSp, bDocument ? (oSp.parent ? oSp.parent.PageNum : nPageIndex) : nPageIndex);
}
}
}
......
......@@ -44,8 +44,8 @@ CShape.prototype.Is_UseInDocument = function(){
{
return this.group.Is_UseInDocument();
}
return false;
}
return false;
}
if(this.drawingBase)
{
......
......@@ -3428,7 +3428,12 @@ CPresentation.prototype =
return;
}
}
this.Slides[this.CurPage].graphicObjects.loadDocumentStateAfterLoadChanges(oState);
var oDrawingObjects = this.Slides[this.CurPage].graphicObjects;
oDrawingObjects.clearPreTrackObjects();
oDrawingObjects.clearTrackObjects();
oDrawingObjects.resetSelection();
oDrawingObjects.changeCurrentState(new NullState(oDrawingObjects));
oDrawingObjects.loadDocumentStateAfterLoadChanges(oState);
}
},
......
......@@ -42,12 +42,16 @@ CShape.prototype.Is_UseInDocument = function(drawingObjects)
{
return this.group.Is_UseInDocument();
}
return false;
}
return false;
}
if(this.parent && this.parent.Is_UseInDocument && this.parent.GraphicObj === this)
{
return this.parent.Is_UseInDocument();
if(this.parent && this.parent.cSld){
var aSpTree = this.parent.cSld.spTree;
for(var i = 0; i < aSpTree.length; ++i){
if(aSpTree[i] === this){
return true;
}
}
}
return false;
};
......
......@@ -172,7 +172,7 @@ function asc_docs_api(name)
CHART_STYLE_MANAGER = new CChartStyleManager();
}
asc.extendClass(asc_docs_api, baseEditorsApi);
Asc.extendClass(asc_docs_api, baseEditorsApi);
/////////////////////////////////////////////////////////////////////////
///////////////////CoAuthoring and Chat api//////////////////////////////
......
......@@ -14771,25 +14771,7 @@ CDocument.prototype.Save_DocumentStateBeforeLoadChanges = function()
}
else // if (docpostype_Drawing === HdrFtrContent.CurPos.Type)
{
var DrawingContent = this.DrawingObjects.getTargetDocContent();
var ParaDrawing = this.DrawingObjects.getMajorParaDrawing();
if (null === DrawingContent || null === ParaDrawing)
{
this.DrawingObjects.Save_DocumentStateBeforeLoadChanges(State);
}
else
{
State.ParaDrawing = ParaDrawing;
State.DrawingContent = DrawingContent;
State.DrawingSelection = DrawingContent.Selection.Use;
State.X = ParaDrawing.X;
State.Y = ParaDrawing.Y;
State.Pos = DrawingContent.Get_ContentPosition(false, false, undefined);
State.StartPos = DrawingContent.Get_ContentPosition(true, true, undefined);
State.EndPos = DrawingContent.Get_ContentPosition(true, false, undefined);
}
this.DrawingObjects.Save_DocumentStateBeforeLoadChanges(State);
}
}
......@@ -14797,25 +14779,7 @@ CDocument.prototype.Save_DocumentStateBeforeLoadChanges = function()
}
case docpostype_DrawingObjects:
{
var DrawingContent = this.DrawingObjects.getTargetDocContent();
var ParaDrawing = this.DrawingObjects.getMajorParaDrawing();
if (null === DrawingContent || null === ParaDrawing)
{
this.DrawingObjects.Save_DocumentStateBeforeLoadChanges(State);
}
else
{
State.ParaDrawing = ParaDrawing;
State.DrawingContent = DrawingContent;
State.DrawingSelection = DrawingContent.Selection.Use;
State.X = ParaDrawing.X;
State.Y = ParaDrawing.Y;
State.Pos = DrawingContent.Get_ContentPosition(false, false, undefined);
State.StartPos = DrawingContent.Get_ContentPosition(true, true, undefined);
State.EndPos = DrawingContent.Get_ContentPosition(true, false, undefined);
}
this.DrawingObjects.Save_DocumentStateBeforeLoadChanges(State);
break;
}
case docpostype_Content:
......@@ -14874,38 +14838,10 @@ CDocument.prototype.Load_DocumentStateAfterLoadChanges = function(State)
{
HdrFtrContent.CurPos.Type = docpostype_DrawingObjects;
var DrawingContent = State.DrawingContent;
var ParaDrawing = State.ParaDrawing;
if (DrawingContent && ParaDrawing)
{
if (true === ParaDrawing.Is_UseInDocument())
{
DrawingContent.Set_CurrentElement(0, false);
if (true === State.DrawingSelection)
{
DrawingContent.Set_ContentPosition(State.StartPos, 0, 0);
DrawingContent.Set_ContentSelection(State.StartPos, State.EndPos, 0, 0, 0);
}
else
{
DrawingContent.Set_ContentPosition(State.Pos, 0, 0);
this.NeedUpdateTarget = true;
this.RecalculateCurPos();
}
}
else
{
HdrFtrContent.CurPos.Type = docpostype_Content;
this.Cursor_MoveAt(State.X ? State.X : 0, State.Y ? State.Y : 0, false);
}
}
else
if (true !== this.DrawingObjects.Load_DocumentStateAfterLoadChanges(State))
{
if (true !== this.DrawingObjects.Load_DocumentStateAfterLoadChanges(State))
{
HdrFtrContent.CurPos.Type = docpostype_Content;
this.Cursor_MoveAt(State.X ? State.X : 0, State.Y ? State.Y : 0, false);
}
HdrFtrContent.CurPos.Type = docpostype_Content;
this.Cursor_MoveAt(State.X ? State.X : 0, State.Y ? State.Y : 0, false);
}
}
}
......@@ -14919,40 +14855,11 @@ CDocument.prototype.Load_DocumentStateAfterLoadChanges = function(State)
}
case docpostype_DrawingObjects:
{
var DrawingContent = State.DrawingContent;
var ParaDrawing = State.ParaDrawing;
if (DrawingContent && ParaDrawing)
{
if (true === ParaDrawing.Is_UseInDocument())
{
DrawingContent.Set_CurrentElement(0, false);
if (true === State.DrawingSelection)
{
DrawingContent.Set_ContentPosition(State.StartPos, 0, 0);
DrawingContent.Set_ContentSelection(State.StartPos, State.EndPos, 0, 0, 0);
}
else
{
DrawingContent.Set_ContentPosition(State.Pos, 0, 0);
this.NeedUpdateTarget = true;
this.RecalculateCurPos();
}
}
else
{
this.CurPos.Type = docpostype_Content;
this.Cursor_MoveAt(State.X ? State.X : 0, State.Y ? State.Y : 0, false);
}
}
else
if (true !== this.DrawingObjects.Load_DocumentStateAfterLoadChanges(State))
{
if (true !== this.DrawingObjects.Load_DocumentStateAfterLoadChanges(State))
{
this.CurPos.Type = docpostype_Content;
this.Cursor_MoveAt(State.X ? State.X : 0, State.Y ? State.Y : 0, false);
}
this.CurPos.Type = docpostype_Content;
this.Cursor_MoveAt(State.X ? State.X : 0, State.Y ? State.Y : 0, false);
}
break;
}
case docpostype_Content:
......
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