Commit 6ec2f3fa authored by Ilya.Kirillov's avatar Ilya.Kirillov Committed by Alexander.Trofimov

Реализован Drag-drop текста.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@52061 954022d7-b5bf-4e40-9824-e11837661b57
parent 181023e3
......@@ -614,7 +614,7 @@ function CTableOutlineDr()
var _table = _outline.Table;
_table.Cursor_MoveToStartPos();
_table.Document_SetThisElementCurrent();
_table.Document_SetThisElementCurrent(true);
if (!_table.Is_Inline())
{
......@@ -5144,7 +5144,7 @@ function CDrawingDocument()
this.LockCursorType("move");
this.TableOutlineDr.TableOutline.Table.Select_All();
this.TableOutlineDr.TableOutline.Table.Document_SetThisElementCurrent();
this.TableOutlineDr.TableOutline.Table.Document_SetThisElementCurrent(true);
if (-1 == oWordControl.m_oTimerScrollSelect)
{
......
This diff is collapsed.
This diff is collapsed.
......@@ -257,14 +257,19 @@ CHeaderFooter.prototype =
return { X : X_Left_Field, Y : 0, XLimit : X_Right_Field, YLimit : 0 };
},
Set_CurrentElement : function()
Set_CurrentElement : function(bUpdateStates)
{
this.Parent.CurHdrFtr = this;
this.Parent.CurHdrFtr = this;
this.Parent.WaitMouseDown = true;
this.LogicDocument.CurPos.Type = docpostype_HdrFtr;
this.LogicDocument.Document_UpdateInterfaceState();
this.LogicDocument.Document_UpdateRulersState();
this.LogicDocument.Document_UpdateSelectionState();
if ( true === bUpdateStates )
{
this.LogicDocument.Document_UpdateInterfaceState();
this.LogicDocument.Document_UpdateRulersState();
this.LogicDocument.Document_UpdateSelectionState();
}
},
Is_ThisElementCurrent : function()
......@@ -542,6 +547,11 @@ CHeaderFooter.prototype =
this.Content.Get_SelectedElementsInfo(Info);
},
Get_SelectedContent : function(SelectedContent)
{
this.Content.Get_SelectedContent( SelectedContent );
},
Set_BoundY2 : function(Value, bRecalculate)
{
History.Add( this, { Type : historyitem_HdrFtr_BoundY2, Old : this.BoundY2, New : Value } );
......@@ -2175,6 +2185,12 @@ CHeaderFooterController.prototype =
this.CurHdrFtr.Get_SelectedElementsInfo(Info);
},
Get_SelectedContent : function(SelectedContent)
{
if ( null != this.CurHdrFtr )
this.CurHdrFtr.Get_SelectedContent( SelectedContent );
},
//-----------------------------------------------------------------------------------
// Функции для работы с контентом
//-----------------------------------------------------------------------------------
......
......@@ -182,6 +182,8 @@ Paragraph.prototype =
History.Add( this, { Type : historyitem_Paragraph_Pr, Old : Pr_old, New : Pr_new } );
this.Pr = oNewPr;
this.Recalc_CompiledPr();
},
Copy : function(Parent)
......@@ -741,7 +743,7 @@ Paragraph.prototype =
}
*/
var _ContentPos = ContentPos;
var _ContentPos = Math.max( 0, Math.min( ContentPos, this.Content.length - 1 ) );
while ( undefined === this.Content[_ContentPos].CurPage )
{
......@@ -6727,7 +6729,7 @@ Paragraph.prototype =
Set_ContentPos : function(Pos, bCorrectPos, Line)
{
this.CurPos.ContentPos = Pos;
this.CurPos.ContentPos = Math.max( 0, Math.min( this.Content.length - 1, Pos ) );
this.CurPos.Line = ( undefined === Line ? -1 : Line );
if ( false != bCorrectPos )
......@@ -8227,7 +8229,7 @@ Paragraph.prototype =
this.Extend_ToPos( X );
this.Cursor_MoveToEndPos();
this.Document_SetThisElementCurrent();
this.Document_SetThisElementCurrent(true);
editor.WordControl.m_oLogicDocument.Recalculate();
return;
}
......@@ -8511,7 +8513,7 @@ Paragraph.prototype =
{
if ( NearPos !== undefined )
{
if ( true === this.Selection.Use && NearPos.Paragraph === this && NearPos.ContentPos >= this.Selection.StartPos && NearPos.ContentPos <= this.Selection.EndPos )
if ( NearPos.Paragraph === this && ( ( true === this.Selection.Use && NearPos.ContentPos >= this.Selection.StartPos && NearPos.ContentPos <= this.Selection.EndPos ) || ( true === this.ApplyToAll ) ) )
return true;
return false;
......@@ -8713,11 +8715,13 @@ Paragraph.prototype =
EndPos = this.Selection.StartPos;
}
var _StartPos = this.Internal_GetStartPos();
var _EndPos = this.Internal_GetEndPos();
// Если выделен параграф целиком, тогда просто его копируем
if ( StartPos <= 0 && EndPos >= this.Content.length - 2 )
if ( StartPos <= _StartPos && EndPos >= _EndPos )
{
DocContent.Set_Inline( false );
DocContent.Add( this.Copy() );
DocContent.Add( new CSelectedElement( this.Copy(this.Parent), true ) );
return;
}
......@@ -8743,7 +8747,7 @@ Paragraph.prototype =
Para.Internal_Content_Add( Para.Content.length, new ParaEnd(), false );
Para.Internal_Content_Add( Para.Content.length, new ParaEmpty(), false );
DocContent.Add( Para );
DocContent.Add( new CSelectedElement( Para, false ) );
},
// Проверяем пустой ли параграф
......@@ -10980,9 +10984,9 @@ Paragraph.prototype =
//-----------------------------------------------------------------------------------
// Дополнительные функции
//-----------------------------------------------------------------------------------
Document_SetThisElementCurrent : function()
Document_SetThisElementCurrent : function(bUpdateStates)
{
this.Parent.Set_CurrentElement( this.Index );
this.Parent.Set_CurrentElement( this.Index, bUpdateStates );
},
Is_ThisElementCurrent : function()
......
......@@ -4491,7 +4491,7 @@ ParaDrawing.prototype =
if ( undefined != this.Parent && null != this.Parent )
{
this.Parent.Cursor_MoveTo_Drawing( this.Id, bBefore );
this.Parent.Document_SetThisElementCurrent();
this.Parent.Document_SetThisElementCurrent(true);
}
},
......@@ -6696,6 +6696,8 @@ ParaDrawing.prototype =
}
var d = this.Distance;
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_Distance(d.L, d.T, d.R, d.B);
c.setZIndex();
c.Set_AllowOverlap(this.AllowOverlap);
......
......@@ -91,7 +91,7 @@ CDocumentSearch.prototype =
Paragraph.Selection.EndPos = SearchElement.EndPos;
Paragraph.CurPos.ContentPos = SearchElement.StartPos;
Paragraph.Document_SetThisElementCurrent();
Paragraph.Document_SetThisElementCurrent(true);
}
this.CurId = Id;
......
This diff is collapsed.
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