Commit 0a5bc188 authored by Anna.Pavlova's avatar Anna.Pavlova Committed by Alexander.Trofimov

к rev 68326

Поправлен баг: проверка на ForcedBreak для контекстного меню при селекте нескольких элементов

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@68330 954022d7-b5bf-4e40-9824-e11837661b57
parent d27ea799
......@@ -4730,38 +4730,7 @@ CMathContent.prototype.Check_Composition = function()
};
CMathContent.prototype.Can_ModifyForcedBreak = function(Pr)
{
var Pos = null;
var CurPos;
if(true === this.Selection.Use)
{
var StartPos = this.Selection.StartPos,
EndPos = this.Selection.EndPos;
if ( StartPos > EndPos )
{
StartPos = this.Selection.EndPos;
EndPos = this.Selection.StartPos;
}
var bFirstItem = false;
for(CurPos = StartPos; CurPos <= EndPos; CurPos++)
{
if(true !== this.Content[CurPos].Selection_IsEmpty())
{
if(bFirstItem == true)
break;
bFirstItem = true;
Pos = CurPos;
}
}
}
else
{
Pos = this.CurPos;
}
var Pos = this.private_GetPosRunForForcedBreak();
if(Pos !== null && this.bOneLine == false)
{
......@@ -4787,7 +4756,51 @@ CMathContent.prototype.Can_ModifyForcedBreak = function(Pr)
this.Content[Pos + 1].Math_Can_ModidyForcedBreak(Pr, false, true);
}
}
};
CMathContent.prototype.private_GetPosRunForForcedBreak = function()
{
var Pos = null;
if(true === this.Selection.Use)
{
var StartPos = this.Selection.StartPos,
EndPos = this.Selection.EndPos;
if ( StartPos > EndPos )
{
StartPos = this.Selection.EndPos;
EndPos = this.Selection.StartPos;
}
var bHaveSelectedItem = false;
for(var CurPos = StartPos; CurPos <= EndPos; CurPos++)
{
var Item = this.Content[CurPos];
var bSelect = true !== Item.Selection_IsEmpty(),
bSelectRun = bSelect == true && Item.Type == para_Math_Run,
bSelectComp = bSelect == true && Item.Type == para_Math_Composition;
var bSelectManyRuns = bSelectRun && bHaveSelectedItem;
if(bSelectComp || bSelectManyRuns)
{
Pos = null;
break;
}
if(bSelectRun)
{
bHaveSelectedItem = true;
Pos = CurPos;
}
}
}
else
{
Pos = this.CurPos;
}
return Pos;
};
CMathContent.prototype.private_FindCurrentPosInContent = function()
{
......
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