Commit 22610c53 authored by Ilya.Kirillov's avatar Ilya.Kirillov Committed by Alexander.Trofimov

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

Исправлен баг с падением при отклонении изменений и выделении картинки. Исправлен баг с тем, что удаление картинки при переносе не сохранялось как изменение (баг 30863).

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@66224 954022d7-b5bf-4e40-9824-e11837661b57
parent 3c5e77c6
...@@ -8679,26 +8679,6 @@ Paragraph.prototype = ...@@ -8679,26 +8679,6 @@ Paragraph.prototype =
return Run; return Run;
}, },
// Ищем графический объект по Id и удаляем запись он нем в параграфе
Remove_DrawingObject : function(Id)
{
for ( var Index = 0; Index < this.Content.length; Index++ )
{
var Item = this.Content[Index];
if ( para_Drawing === Item.Type && Id === Item.Get_Id() )
{
var HdrFtr = this.Parent.Is_HdrFtr(true);
if ( null != HdrFtr && true != Item.Is_Inline() )
HdrFtr.RecalcInfo.NeedRecalc = true;
this.Internal_Content_Remove( Index );
return Index;
}
}
return -1;
},
Get_DrawingObjectContentPos : function(Id) Get_DrawingObjectContentPos : function(Id)
{ {
var ContentPos = new CParagraphContentPos(); var ContentPos = new CParagraphContentPos();
......
...@@ -3955,6 +3955,8 @@ function ParaDrawing(W, H, GraphicObj, DrawingDocument, DocumentContent, Parent) ...@@ -3955,6 +3955,8 @@ function ParaDrawing(W, H, GraphicObj, DrawingDocument, DocumentContent, Parent)
this.DrawingDocument = DrawingDocument; this.DrawingDocument = DrawingDocument;
this.Parent = Parent; this.Parent = Parent;
this.LogicDocument = DrawingDocument ? DrawingDocument.m_oLogicDocument : null;
// Расстояние до окружающего текста // Расстояние до окружающего текста
this.Distance = this.Distance =
{ {
...@@ -5002,7 +5004,19 @@ ParaDrawing.prototype = ...@@ -5002,7 +5004,19 @@ ParaDrawing.prototype =
NearPos.Paragraph.Check_NearestPos( NearPos ); NearPos.Paragraph.Check_NearestPos( NearPos );
var RunPr = this.Remove_FromDocument( false ); var RunPr = this.Remove_FromDocument( false );
this.Add_ToDocument( NearPos, true, RunPr );
if (this.LogicDocument && true === this.LogicDocument.Is_TrackRevisions())
{
var NewParaDrawing = this.Copy();
NewParaDrawing.Add_ToDocument(NearPos, true, RunPr);
this.LogicDocument.Select_DrawingObject(NewParaDrawing.Get_Id());
console.log("1");
}
else
{
this.Add_ToDocument(NearPos, true, RunPr);
console.log("2");
}
}, },
GoTo_Text : function(bBefore, bUpdateStates) GoTo_Text : function(bBefore, bUpdateStates)
...@@ -5990,6 +6004,7 @@ ParaDrawing.prototype = ...@@ -5990,6 +6004,7 @@ ParaDrawing.prototype =
{ {
this.Id = Reader.GetString2(); this.Id = Reader.GetString2();
this.DrawingDocument = editor.WordControl.m_oLogicDocument.DrawingDocument; this.DrawingDocument = editor.WordControl.m_oLogicDocument.DrawingDocument;
this.LogicDocument = this.DrawingDocument ? this.DrawingDocument.m_oLogicDocument : null;
this.Extent.W = readDouble(Reader); this.Extent.W = readDouble(Reader);
this.Extent.H = readDouble(Reader); this.Extent.H = readDouble(Reader);
......
...@@ -1623,7 +1623,59 @@ ParaRun.prototype.Remove_DrawingObject = function(Id) ...@@ -1623,7 +1623,59 @@ ParaRun.prototype.Remove_DrawingObject = function(Id)
if ( para_Drawing === Element.Type && Id === Element.Get_Id() ) if ( para_Drawing === Element.Type && Id === Element.Get_Id() )
{ {
this.Remove_FromContent( CurPos, 1, true ); var TrackRevisions = null;
if (this.Paragraph && this.Paragraph.LogicDocument)
TrackRevisions = this.Paragraph.LogicDocument.Is_TrackRevisions();
if (true === TrackRevisions)
{
var ReviewType = this.Get_ReviewType();
if (reviewtype_Common === ReviewType)
{
// Разбиваем ран на две части
var StartPos = CurPos;
var EndPos = CurPos + 1;
var Parent = this.Get_Parent();
var RunPos = this.private_GetPosInParent(Parent);
if (-1 !== RunPos && Parent)
{
var DeletedRun = null;
if (StartPos <= 0 && EndPos >= this.Content.length)
DeletedRun = this;
else if (StartPos <= 0)
{
this.Split2(EndPos, Parent, RunPos);
DeletedRun = this;
}
else if (EndPos >= this.Content.length)
{
DeletedRun = this.Split2(StartPos, Parent, RunPos);
}
else
{
this.Split2(EndPos, Parent, RunPos);
DeletedRun = this.Split2(StartPos, Parent, RunPos);
}
DeletedRun.Set_ReviewType(reviewtype_Remove);
}
}
else if (reviewtype_Add === ReviewType)
{
this.Remove_FromContent(CurPos, 1, true);
}
else if (reviewtype_Remove === ReviewType)
{
// Ничего не делаем
}
}
else
{
this.Remove_FromContent(CurPos, 1, true);
}
return; return;
} }
} }
......
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