Commit 0d467a42 authored by Ilya.Kirillov's avatar Ilya.Kirillov

Сделано, чтобы при копировании содержимого сложного объета внутри параграфа...

Сделано, чтобы при копировании содержимого сложного объета внутри параграфа (гиперссылка, поле), если он выделен не целиком, копировалось только его содержимое (баг 29101).

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@64744 954022d7-b5bf-4e40-9824-e11837661b57
parent 6f24c9c5
...@@ -977,10 +977,15 @@ ParaComment.prototype = ...@@ -977,10 +977,15 @@ ParaComment.prototype =
return true; return true;
}, },
Copy : function() Copy : function(Selected)
{ {
return new ParaComment(this.Start, this.CommentId); return new ParaComment(this.Start, this.CommentId);
}, },
CopyContent : function(Selected)
{
return [];
},
Split : function() Split : function()
{ {
......
...@@ -6756,10 +6756,18 @@ Paragraph.prototype = ...@@ -6756,10 +6756,18 @@ Paragraph.prototype =
{ {
var Item = this.Content[Pos]; var Item = this.Content[Pos];
if ( StartPos === Pos || EndPos === Pos ) if ((StartPos === Pos || EndPos === Pos) && true !== Item.Is_SelectedAll())
Para.Internal_Content_Add( Pos - StartPos, Item.Copy(true), false ); {
var Content = Item.CopyContent(true);
for (var ContentPos = 0, ContentLen = Content.length; ContentPos < ContentLen; ContentPos++)
{
Para.Internal_Content_Add(Pos - StartPos + ContentPos, Content[ContentPos], false);
}
}
else else
Para.Internal_Content_Add( Pos - StartPos, Item.Copy(false), false ); {
Para.Internal_Content_Add(Pos - StartPos, Item.Copy(false), false);
}
} }
// Добавляем секцию в конце // Добавляем секцию в конце
......
...@@ -222,6 +222,44 @@ CParagraphContentWithParagraphLikeContent.prototype.Copy = function(Selected) ...@@ -222,6 +222,44 @@ CParagraphContentWithParagraphLikeContent.prototype.Copy = function(Selected)
return NewElement; return NewElement;
}; };
CParagraphContentWithParagraphLikeContent.prototype.CopyContent = function(Selected)
{
var CopyContent = [];
var StartPos = 0;
var EndPos = this.Content.length - 1;
if (true === Selected && true === this.State.Selection.Use)
{
StartPos = this.State.Selection.StartPos;
EndPos = this.State.Selection.EndPos;
if (StartPos > EndPos)
{
StartPos = this.State.Selection.EndPos;
EndPos = this.State.Selection.StartPos;
}
}
for (var CurPos = StartPos; CurPos <= EndPos; CurPos++)
{
var Item = this.Content[CurPos];
if ((StartPos === CurPos || EndPos === CurPos) && true !== Item.Is_SelectedAll())
{
var Content = Item.CopyContent(Selected);
for (var ContentPos = 0, ContentLen = Content.length; ContentPos < ContentLen; ContentPos++)
{
CopyContent.push(Content[ContentPos]);
}
}
else
{
CopyContent.push(Item.Copy(false));
}
}
return CopyContent;
};
CParagraphContentWithParagraphLikeContent.prototype.Get_Paragraph = function() CParagraphContentWithParagraphLikeContent.prototype.Get_Paragraph = function()
{ {
return this.Paragraph; return this.Paragraph;
......
...@@ -177,6 +177,11 @@ ParaRun.prototype.Copy2 = function() ...@@ -177,6 +177,11 @@ ParaRun.prototype.Copy2 = function()
return NewRun; return NewRun;
}; };
ParaRun.prototype.CopyContent = function(Selected)
{
return [this.Copy(Selected)];
};
ParaRun.prototype.Get_AllDrawingObjects = function(DrawingObjs) ParaRun.prototype.Get_AllDrawingObjects = function(DrawingObjs)
{ {
var Count = this.Content.length; var Count = this.Content.length;
...@@ -5206,8 +5211,8 @@ ParaRun.prototype.Is_SelectedAll = function(Props) ...@@ -5206,8 +5211,8 @@ ParaRun.prototype.Is_SelectedAll = function(Props)
if ( false === Selection.Use && true !== this.Is_Empty( Props ) ) if ( false === Selection.Use && true !== this.Is_Empty( Props ) )
return false; return false;
var SkipAnchor = Props.SkipAnchor; var SkipAnchor = Props ? Props.SkipAnchor : false;
var SkipEnd = Props.SkipEnd; var SkipEnd = Props ? Props.SkipEnd : false;
var StartPos = Selection.StartPos; var StartPos = Selection.StartPos;
var EndPos = Selection.EndPos; var EndPos = Selection.EndPos;
......
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