Commit d12953ba authored by Ilya Kirillov's avatar Ilya Kirillov

Implemented a function for determining whether the cursor is in the composite text.

parent 1894d064
......@@ -11142,6 +11142,27 @@ CDocument.prototype.Check_CompositeInputRun = function()
if (true !== oRun.Is_UseInDocument())
AscCommon.g_inputContext.externalEndCompositeInput();
};
CDocument.prototype.Is_CursorInsideCompositeText = function()
{
if (null === this.CompositeInput)
return false;
var oCurrentParagraph = this.Get_CurrentParagraph();
if (!oCurrentParagraph)
return false;
var oParaPos = oCurrentParagraph.Get_ParaContentPos(false, false, false);
var arrClasses = oCurrentParagraph.Get_ClassesByPos(oParaPos);
if (arrClasses.length <= 0 || arrClasses[arrClasses.length - 1] !== this.CompositeInput.Run)
return false;
var nInRunPos = oParaPos.Get(oParaPos.Get_Depth());
if (nInRunPos >= this.CompositeInput.Pos && nInRunPos <= this.CompositeInput.Pos + this.CompositeInput.Length)
return true;
return false;
};
//----------------------------------------------------------------------------------------------------------------------
// Функции для работы со сносками
//----------------------------------------------------------------------------------------------------------------------
......
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