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

правка бага 19617 - [Copy&Paste] Добавляется лишний пробел в конце строки при ее выделении

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@51408 954022d7-b5bf-4e40-9824-e11837661b57
parent fc180b05
......@@ -73,6 +73,27 @@ CGraphicFrame.prototype =
{
return true;
},
Cursor_MoveToStartPos : function()
{
if(isRealObject(this.graphicObject))
{
this.graphicObject.Cursor_MoveToStartPos();
this.graphicObject.RecalculateCurPos();
}
},
Cursor_MoveToEndPos : function()
{
if(isRealObject(this.graphicObject))
{
this.graphicObject.Cursor_MoveToEndPos();
this.graphicObject.RecalculateCurPos();
}
},
getSearchResults: function(str)
{
if(this.graphicObject instanceof CTable)
......
......@@ -1566,28 +1566,14 @@ CPresentation.prototype =
Cursor_MoveToStartPos : function()
{
this.Selection.Start = false;
this.Selection.Use = false;
this.Selection.StartPos = 0;
this.Selection.EndPos = 0;
this.Selection.Flag = selectionflag_Common;
this.CurPos.ContentPos = 0;
this.CurPos.Type = docpostype_Content;
this.Content[0].Cursor_MoveToStartPos();
this.Slides[this.CurPage].graphicObjects.Cursor_MoveToStartPos();
return true;
},
Cursor_MoveToEndPos : function()
{
this.Selection.Start = false;
this.Selection.Use = false;
this.Selection.StartPos = 0;
this.Selection.EndPos = 0;
this.Selection.Flag = selectionflag_Common;
this.CurPos.ContentPos = this.Content.length - 1;
this.CurPos.Type = docpostype_Content;
this.Content[this.CurPos.ContentPos].Cursor_MoveToEndPos();
this.Slides[this.CurPage].graphicObjects.Cursor_MoveToEndPos();
return true;
},
Cursor_MoveLeft : function(AddToSelect, Word)
......
......@@ -192,6 +192,10 @@ CShape.prototype =
recalculateGroupHierarchy: true,
recalculateTextStyles: [true, true, true, true, true, true, true, true, true]
};
if(this.txBody)
{
this.txBody.recalcAll();
}
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this;
},
......@@ -2871,6 +2875,26 @@ CShape.prototype =
}
},
Cursor_MoveToStartPos : function()
{
if(isRealObject(this.txBody))
{
this.txBody.content.Cursor_MoveToStartPos();
this.txBody.content.RecalculateCurPos();
}
},
Cursor_MoveToEndPos : function()
{
if(isRealObject(this.txBody))
{
this.txBody.content.Cursor_MoveToEndPos();
this.txBody.content.RecalculateCurPos();
}
},
Cursor_MoveLeft : function(AddToSelect, Word)
{
if(isRealObject(this.txBody))
......
......@@ -166,6 +166,25 @@ CTextBody.prototype =
},
recalcAll: function()
{
this.recalcInfo =
{
recalculateBodyPr: true,
recalculateContent2: true
};
this.bRecalculateNumbering = true;
var content = this.content;
for(var i = 0; i < content.Content.length; ++i)
{
content.Content[i].Recalc_CompiledPr();
content.Content[i].RecalcInfo.Recalc_0_Type = pararecalc_0_All;
}
this.arrStyles = [];
content.arrStyles = [];
},
recalcColors: function()
{
this.content.recalcColors();
......
......@@ -2841,7 +2841,7 @@ CGraphicObjects.prototype = {
case STATES_ID_TEXT_ADD:
case STATES_ID_TEXT_ADD_IN_GROUP:
{
this.State.textObject.Cursor_MoveDown(AddToSelect);
this.State.textObject.Cursor_MoveEndOfLine(AddToSelect);
break;
}
}
......@@ -2854,7 +2854,7 @@ CGraphicObjects.prototype = {
case STATES_ID_TEXT_ADD:
case STATES_ID_TEXT_ADD_IN_GROUP:
{
this.State.textObject.Cursor_MoveDown(AddToSelect);
this.State.textObject.Cursor_MoveStartOfLine(AddToSelect);
break;
}
}
......@@ -2875,7 +2875,108 @@ CGraphicObjects.prototype = {
Cursor_MoveToCell : function(bNext)
{
switch (this.State.id)
{
case STATES_ID_TEXT_ADD:
case STATES_ID_TEXT_ADD_IN_GROUP:
{
this.State.textObject.Cursor_MoveLeft(AddToSelect, Word);
break;
}
case STATES_ID_NULL:
{
if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false)
{
var selected_objects = this.selectedObjects;
if(selected_objects.length > 0)
{
History.Create_NewPoint();
var shift;
if(Word)
{
shift = editor.WordControl.m_oDrawingDocument.GetMMPerDot(1);
}
else if(!AddToSelect)
{
shift = editor.WordControl.m_oDrawingDocument.GetMMPerDot(5);
}
for(var i = 0; i < selected_objects.length; ++i)
{
var new_x = selected_objects[i].x - shift;
var new_y = selected_objects[i].y;
selected_objects[i].setXfrm(new_x, new_y);
}
editor.WordControl.m_oLogicDocument.Recalculate();
editor.WordControl.m_oLogicDocument.Document_UpdateUndoRedoState();
}
}
break;
}
case STATES_ID_GROUP:
{
if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false)
{
var selected_objects = this.State.group.selectedObjects;
if(selected_objects.length > 0)
{
History.Create_NewPoint();
var shift;
if(Word)
{
shift = editor.WordControl.m_oDrawingDocument.GetMMPerDot(1);
}
else if(!AddToSelect)
{
shift = editor.WordControl.m_oDrawingDocument.GetMMPerDot(5);
}
var invert_group_transform = global_MatrixTransformer.Invert(this.State.group.transform);
this.State.group.normalize();
for(var i = 0; i < selected_objects.length; ++i)
{
var rel_transform = selected_objects[i].transform.CreateDublicate();
global_MatrixTransformer.MultiplyAppend(rel_transform, invert_group_transform);
rel_transform.tx = 0;
rel_transform.ty = 0;
var dx = rel_transform.TransformPointX(-shift, 0);
var dy = rel_transform.TransformPointY(-shift, 0);
var new_x = selected_objects[i].x + dx;
var new_y = selected_objects[i].y + dy;
selected_objects[i].setXfrm(new_x, new_y);
}
this.State.group.updateCoordinatesAfterInternalResize();
editor.WordControl.m_oLogicDocument.Recalculate();
editor.WordControl.m_oLogicDocument.Document_UpdateUndoRedoState();
}
}
break;
}
}
},
Cursor_MoveToStartPos : function()
{
switch (this.State.id)
{
case STATES_ID_TEXT_ADD:
case STATES_ID_TEXT_ADD_IN_GROUP:
{
this.State.textObject.Cursor_MoveToStartPos();
break;
}
}
},
Cursor_MoveToEndPos : function()
{
switch (this.State.id)
{
case STATES_ID_TEXT_ADD:
case STATES_ID_TEXT_ADD_IN_GROUP:
{
this.State.textObject.Cursor_MoveToEndPos();
break;
}
}
},
......
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