Commit 9d9a0bc0 authored by Ilya.Kirillov's avatar Ilya.Kirillov Committed by Alexander.Trofimov

Исправлен баг при удалении в гиперссылках. Исправлен баг с drag-n-drop...

Исправлен баг при удалении в гиперссылках. Исправлен баг с drag-n-drop автофигур в автофигуры (баг 24181). Исправлен баг с удалением в автофигурах в колонтитуле (баг 24400).

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56821 954022d7-b5bf-4e40-9824-e11837661b57
parent 91a82290
...@@ -75,6 +75,8 @@ function CSelectedElement(Element, SelectedAll) ...@@ -75,6 +75,8 @@ function CSelectedElement(Element, SelectedAll)
function CSelectedContent() function CSelectedContent()
{ {
this.Elements = []; this.Elements = [];
this.HaveShape = false;
} }
CSelectedContent.prototype = CSelectedContent.prototype =
...@@ -87,6 +89,11 @@ CSelectedContent.prototype = ...@@ -87,6 +89,11 @@ CSelectedContent.prototype =
Add : function(Element) Add : function(Element)
{ {
this.Elements.push( Element ); this.Elements.push( Element );
},
Set_Shape : function(Value)
{
this.HaveShape = Value;
} }
}; };
...@@ -2990,8 +2997,11 @@ CDocument.prototype = ...@@ -2990,8 +2997,11 @@ CDocument.prototype =
{ {
var Res = this.HdrFtr.Remove(Count, bOnlyText, bRemoveOnlySelection, bOnTextAdd); var Res = this.HdrFtr.Remove(Count, bOnlyText, bRemoveOnlySelection, bOnTextAdd);
if ( null !== this.HdrFtr.CurHdtr && docpostype_DrawingObjects !== this.HdrFtr.CurHdrFtr.Content.CurPos.Type )
{
this.Selection_Remove(); this.Selection_Remove();
this.Selection.Use = false; this.Selection.Use = false;
}
this.Document_UpdateInterfaceState(); this.Document_UpdateInterfaceState();
this.Document_UpdateRulersState(); this.Document_UpdateRulersState();
...@@ -8275,6 +8285,13 @@ CDocument.prototype = ...@@ -8275,6 +8285,13 @@ CDocument.prototype =
var Para = NearPos.Paragraph; var Para = NearPos.Paragraph;
// Автофигуры не вставляем в другие автофигуры
if ( true === Para.Parent.Is_DrawingShape() && true === DocContent.HaveShape )
{
History.Remove_LastPoint();
return;
}
// Заполним массив для проверки лока // Заполним массив для проверки лока
var ArrayForCheck = []; var ArrayForCheck = [];
var Count = DocContent.Elements.length; var Count = DocContent.Elements.length;
......
...@@ -439,7 +439,7 @@ ParaHyperlink.prototype = ...@@ -439,7 +439,7 @@ ParaHyperlink.prototype =
if ( StartPos !== this.Content.length - 1 && true === this.Content[StartPos].Is_Empty() ) if ( StartPos !== this.Content.length - 1 && true === this.Content[StartPos].Is_Empty() )
{ {
this.Remove_FromContent( StartPos, true ); this.Remove_FromContent( StartPos, 1, true );
} }
} }
else else
...@@ -448,18 +448,18 @@ ParaHyperlink.prototype = ...@@ -448,18 +448,18 @@ ParaHyperlink.prototype =
if ( EndPos !== this.Content.length - 1 && true === this.Content[EndPos].Is_Empty() ) if ( EndPos !== this.Content.length - 1 && true === this.Content[EndPos].Is_Empty() )
{ {
this.Remove_FromContent( EndPos, true ); this.Remove_FromContent( EndPos, 1, true );
} }
for ( var CurPos = EndPos - 1; CurPos > StartPos; CurPos-- ) for ( var CurPos = EndPos - 1; CurPos > StartPos; CurPos-- )
{ {
this.Remove_FromContent( EndPos, true ); this.Remove_FromContent( EndPos, 1, true );
} }
this.Content[StartPos].Remove(Direction, bOnAddText); this.Content[StartPos].Remove(Direction, bOnAddText);
if ( true === this.Content[StartPos].Is_Empty() ) if ( true === this.Content[StartPos].Is_Empty() )
this.Remove_FromContent( StartPos, true ); this.Remove_FromContent( StartPos, 1, true );
} }
this.Selection_Remove(); this.Selection_Remove();
...@@ -497,7 +497,7 @@ ParaHyperlink.prototype = ...@@ -497,7 +497,7 @@ ParaHyperlink.prototype =
else else
{ {
if ( ContentPos !== this.Content.length - 1 && true === this.Content[ContentPos].Is_Empty() ) if ( ContentPos !== this.Content.length - 1 && true === this.Content[ContentPos].Is_Empty() )
this.Remove_FromContent( ContentPos, true ); this.Remove_FromContent( ContentPos, 1, true );
this.State.ContentPos = ContentPos; this.State.ContentPos = ContentPos;
} }
......
...@@ -4767,6 +4767,7 @@ Paragraph.prototype = ...@@ -4767,6 +4767,7 @@ Paragraph.prototype =
else else
{ {
var SearchPos = new CParagraphSearchPos(); var SearchPos = new CParagraphSearchPos();
SearchPos.ForSelection = true;
if ( true === Word ) if ( true === Word )
this.Get_WordStartPos( SearchPos, EndSelectionPos ); this.Get_WordStartPos( SearchPos, EndSelectionPos );
...@@ -4866,6 +4867,7 @@ Paragraph.prototype = ...@@ -4866,6 +4867,7 @@ Paragraph.prototype =
else else
{ {
var SearchPos = new CParagraphSearchPos(); var SearchPos = new CParagraphSearchPos();
SearchPos.ForSelection = true;
if ( true === Word ) if ( true === Word )
this.Get_WordEndPos( SearchPos, EndSelectionPos, true ); this.Get_WordEndPos( SearchPos, EndSelectionPos, true );
...@@ -7069,13 +7071,15 @@ Paragraph.prototype = ...@@ -7069,13 +7071,15 @@ Paragraph.prototype =
EndPos = this.Selection.StartPos; EndPos = this.Selection.StartPos;
} }
var Para = null;
if ( true === this.Selection_IsFromStart() && true === this.Selection_CheckParaEnd() ) if ( true === this.Selection_IsFromStart() && true === this.Selection_CheckParaEnd() )
{ {
DocContent.Add( new CSelectedElement( this.Copy(this.Parent), true ) ); Para = this.Copy(this.Parent);
return; DocContent.Add( new CSelectedElement( Para, true ) );
} }
else
var Para = new Paragraph(this.DrawingDocument, this.Parent, 0, 0, 0, 0, 0); {
Para = new Paragraph(this.DrawingDocument, this.Parent, 0, 0, 0, 0, 0);
// Копируем настройки // Копируем настройки
Para.Set_Pr(this.Pr.Copy()); Para.Set_Pr(this.Pr.Copy());
...@@ -7099,8 +7103,27 @@ Paragraph.prototype = ...@@ -7099,8 +7103,27 @@ Paragraph.prototype =
SectPr.Copy(this.SectPr); SectPr.Copy(this.SectPr);
Para.Set_SectionPr(SectPr); Para.Set_SectionPr(SectPr);
} }
DocContent.Add( new CSelectedElement( Para, false ) ); DocContent.Add( new CSelectedElement( Para, false ) );
}
if ( null !== Para && false === DocContent.HaveShape )
{
// Проверим есть ли у нас автофигуры в параграфе
var DrawingObjects = Para.Get_AllDrawingObjects();
var Count = DrawingObjects.length;
for ( var Index = 0; Index < Count; Index++ )
{
var DrawingObj = DrawingObjects[Index];
var ShapeType = DrawingObj.GraphicObj.getObjectType();
if ( historyitem_type_Shape === ShapeType || historyitem_type_GroupShape === ShapeType )
{
DocContent.Set_Shape( true );
break;
}
}
}
}, },
Get_Paragraph_TextPr : function() Get_Paragraph_TextPr : function()
...@@ -13791,6 +13814,8 @@ function CParagraphSearchPos() ...@@ -13791,6 +13814,8 @@ function CParagraphSearchPos()
this.Punctuation = false; this.Punctuation = false;
this.First = true; this.First = true;
this.UpdatePos = false; this.UpdatePos = false;
this.ForSelection = false;
} }
function CParagraphSearchPosXY() function CParagraphSearchPosXY()
......
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