Commit aab9e996 authored by Ilya.Kirillov's avatar Ilya.Kirillov

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

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

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@64882 954022d7-b5bf-4e40-9824-e11837661b57
parent 6d2a4153
......@@ -1209,6 +1209,11 @@ ParaComment.prototype =
return this;
},
Get_ClassesByPos : function(Classes, ContentPos, Depth)
{
Classes.push(this);
},
Get_PosByDrawing : function(Id, ContentPos, Depth)
{
return false;
......
......@@ -198,13 +198,13 @@ ParaHyperlink.prototype.Clear_TextFormatting = function( DefHyper )
{
var Count = this.Content.length;
for ( var Pos = 0; Pos < Count; Pos++ )
for (var Pos = 0; Pos < Count; Pos++)
{
var Item = this.Content[Pos];
Item.Clear_TextFormatting( DefHyper );
Item.Clear_TextFormatting(DefHyper);
if ( para_Run === Item.Type )
Item.Set_RStyle( DefHyper );
if (para_Run === Item.Type && null !== DefHyper && undefined !== DefHyper)
Item.Set_RStyle(DefHyper);
}
};
......@@ -216,6 +216,19 @@ ParaHyperlink.prototype.Split = function (ContentPos, Depth)
return NewHyperlink;
};
ParaHyperlink.prototype.CopyContent = function(Selected)
{
var Content = ParaHyperlink.superclass.CopyContent.apply(this, arguments);
for (var CurPos = 0, Count = Content.length; CurPos < Count; CurPos++)
{
var Item = Content[CurPos];
Item.Clear_TextFormatting();
}
return Content;
};
//-----------------------------------------------------------------------------------
// Функции отрисовки
//-----------------------------------------------------------------------------------
......
......@@ -610,6 +610,11 @@ ParaMath.prototype.CopyContent = function(Selected)
var NewMath = this.Copy(Selected);
return [NewMath];
};
ParaMath.prototype.CopyContent = function(Selected)
{
return [this.Copy(Selected)];
};
ParaMath.prototype.Set_Paragraph = function(Paragraph)
{
this.Paragraph = Paragraph;
......@@ -2371,6 +2376,12 @@ ParaMath.prototype.Get_ElementByPos = function(ContentPos, Depth)
return this.Root.Get_ElementByPos(ContentPos, Depth);
};
ParaMath.prototype.Get_ClassesByPos = function(Classes, ContentPos, Depth)
{
Classes.push(this);
// TODO: Реализовать
};
ParaMath.prototype.Get_PosByDrawing = function(Id, ContentPos, Depth)
{
return false;
......
......@@ -4243,6 +4243,18 @@ Paragraph.prototype =
return null;
},
// Получаем список классов по заданной позиции
Get_ClassesByPos : function(ContentPos)
{
var Classes = [];
var CurPos = ContentPos.Get(0);
if (0 <= CurPos && CurPos <= this.Content.length - 1)
this.Content[CurPos].Get_ClassesByPos(Classes, ContentPos, 1);
return Classes;
},
// Получаем по заданной позиции элемент текста
Get_RunElementByPos : function(ContentPos)
{
......
......@@ -5008,15 +5008,19 @@ ParaDrawing.prototype =
Remove_FromDocument : function(bRecalculate)
{
var Result = null;
var Run = this.Parent.Get_DrawingObjectRun( this.Id );
var Run = this.Parent.Get_DrawingObjectRun(this.Id);
if ( null !== Run )
if (null !== Run)
{
Run.Remove_DrawingObject( this.Id );
Run.Remove_DrawingObject(this.Id);
if (true === Run.Is_InHyperlink())
Result = new CTextPr();
else
Result = Run.Get_TextPr();
}
if ( false != bRecalculate )
if (false != bRecalculate)
editor.WordControl.m_oLogicDocument.Recalculate();
return Result;
......
......@@ -1109,6 +1109,13 @@ CParagraphContentWithParagraphLikeContent.prototype.Get_AllParagraphs = function
this.Content[CurPos].Get_AllParagraphs(Props, ParaArray);
}
};
CParagraphContentWithParagraphLikeContent.prototype.Get_ClassesByPos = function(Classes, ContentPos, Depth)
{
Classes.push(this);
var CurPos = ContentPos.Get(Depth);
if (0 <= CurPos && CurPos <= this.Content.length - 1)
this.Content[CurPos].Get_ClassesByPos(Classes, ContentPos, Depth + 1);
};
//----------------------------------------------------------------------------------------------------------------------
// Функции пересчета
//----------------------------------------------------------------------------------------------------------------------
......
......@@ -10099,6 +10099,37 @@ ParaRun.prototype.Reject_RevisionChanges = function(Type, bAll)
}
}
};
ParaRun.prototype.Is_InHyperlink = function()
{
if (!this.Paragraph)
return false;
var ContentPos = this.Paragraph.Get_PosByElement(this);
var Classes = this.Paragraph.Get_ClassesByPos(ContentPos);
var bHyper = false;
var bRun = false;
for (var Index = 0, Count = Classes.length; Index < Count; Index++)
{
var Item = Classes[Index];
if (Item === this)
{
bRun = true;
break;
}
else if (Item instanceof ParaHyperlink)
{
bHyper = true;
}
}
return (bHyper && bRun);
};
ParaRun.prototype.Get_ClassesByPos = function(Classes, ContentPos, Depth)
{
Classes.push(this);
};
function CParaRunStartState(Run)
{
......
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