Commit 794f7fa6 authored by Ilya.Kirillov's avatar Ilya.Kirillov Committed by Alexander.Trofimov

Сделан запрет на добавление комментариев к залоченному параграфу(баг 27224)....

Сделан запрет на добавление комментариев к залоченному параграфу(баг 27224). Исправлен баг с неправильным изменением границ таблицы (баг 27220). Сделано, чтобы автозамена в формулах могла быть многосимвольной, добавлена автозамена \quadratic.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@59225 954022d7-b5bf-4e40-9824-e11837661b57
parent 3126aea5
...@@ -7707,6 +7707,12 @@ CTable.prototype = ...@@ -7707,6 +7707,12 @@ CTable.prototype =
this.Selection.Data2.Min = Y_min; this.Selection.Data2.Min = Y_min;
this.Selection.Data2.Max = Y_max; this.Selection.Data2.Max = Y_max;
this.Selection.Data2.Pos =
{
Row : Pos.Row,
Cell : Pos.Cell
};
if ( null != this.Selection.Data2.Min ) if ( null != this.Selection.Data2.Min )
_Y = Math.max( _Y, this.Selection.Data2.Min ); _Y = Math.max( _Y, this.Selection.Data2.Min );
...@@ -7808,26 +7814,10 @@ CTable.prototype = ...@@ -7808,26 +7814,10 @@ CTable.prototype =
} }
if ( true === this.Selection.Data2.bCol ) if ( true === this.Selection.Data2.bCol )
{ _X = this.private_UpdateTableRulerOnBorderMove(_X);
if ( null != this.Selection.Data2.Min )
_X = Math.max( _X, this.Selection.Data2.Min );
if ( null != this.Selection.Data2.Max )
_X = Math.min( _X, this.Selection.Data2.Max );
this.DrawingDocument.UpdateTableRuler( this.Selection.Data2.bCol, this.Selection.Data2.Index, _X );
}
else else
{ _Y = this.private_UpdateTableRulerOnBorderMove(_Y);
if ( null != this.Selection.Data2.Min )
_Y = Math.max( _Y, this.Selection.Data2.Min );
if ( null != this.Selection.Data2.Max )
_Y = Math.min( _Y, this.Selection.Data2.Max );
this.DrawingDocument.UpdateTableRuler( this.Selection.Data2.bCol, this.Selection.Data2.Index, _Y );
}
this.Selection.Data2.X = _X; this.Selection.Data2.X = _X;
this.Selection.Data2.Y = _Y; this.Selection.Data2.Y = _Y;
...@@ -19328,6 +19318,23 @@ CTable.prototype = ...@@ -19328,6 +19318,23 @@ CTable.prototype =
this.Internal_UpdateCellW(nColIndex); this.Internal_UpdateCellW(nColIndex);
} }
} }
},
private_UpdateTableRulerOnBorderMove : function(Pos)
{
if (null != this.Selection.Data2.Min)
Pos = Math.max(Pos, this.Selection.Data2.Min);
if (null != this.Selection.Data2.Max)
Pos = Math.min(Pos, this.Selection.Data2.Max);
// Обновляем Markup по ячейке в которой мы двигаем границу. Так делаем, потому что мы можем находится изначально
// на другой странице данной таблице, а там Markup может быть совершенно другим. В конце движения границы
// произойдет обновление селекта, и Markup обновится по текущему положению курсора.
this.Internal_Update_TableMarkup(this.Selection.Data2.Pos.Row, this.Selection.Data2.Pos.Cell, this.Selection.Data2.PageNum);
this.DrawingDocument.UpdateTableRuler(this.Selection.Data2.bCol, this.Selection.Data2.Index, Pos);
return Pos;
} }
}; };
......
...@@ -3747,8 +3747,8 @@ CMathContent.prototype.private_CanAutoCorrectText = function(AutoCorrectionEngin ...@@ -3747,8 +3747,8 @@ CMathContent.prototype.private_CanAutoCorrectText = function(AutoCorrectionEngin
var Result = false; var Result = false;
var RemoveCount = 0; var RemoveCount = 0;
var ReplaceChar = ' '; var ReplaceChars = [0x0020];
var AutoCorrectCount = g_aAutoCorrectMathSymbols.length; var AutoCorrectCount = g_aAutoCorrectMathSymbols.length;
for (var nIndex = 0; nIndex < AutoCorrectCount; nIndex++) for (var nIndex = 0; nIndex < AutoCorrectCount; nIndex++)
{ {
...@@ -3774,18 +3774,31 @@ CMathContent.prototype.private_CanAutoCorrectText = function(AutoCorrectionEngin ...@@ -3774,18 +3774,31 @@ CMathContent.prototype.private_CanAutoCorrectText = function(AutoCorrectionEngin
if (true === Found) if (true === Found)
{ {
RemoveCount = CheckStringLen + IndexAdd; RemoveCount = CheckStringLen + IndexAdd;
ReplaceChar = AutoCorrectElement[1];
if (undefined === AutoCorrectElement[1].length)
ReplaceChars[0] = AutoCorrectElement[1];
else
{
for (var Index = 0, Len = AutoCorrectElement[1].length; Index < Len; Index++)
{
ReplaceChars[Index] = AutoCorrectElement[1][Index];
}
}
} }
} }
if (RemoveCount > 0) if (RemoveCount > 0)
{ {
var ReplaceText = new CMathText();
ReplaceText.add(ReplaceChar);
var MathRun = new ParaRun(this.ParaMath.Paragraph, true); var MathRun = new ParaRun(this.ParaMath.Paragraph, true);
MathRun.Add(ReplaceText, true);
for (var Index = 0, Count = ReplaceChars.length; Index < Count; Index++)
{
var ReplaceText = new CMathText();
ReplaceText.add(ReplaceChars[Index]);
MathRun.Add(ReplaceText, true);
}
AutoCorrectionEngine.RemoveCount = RemoveCount; AutoCorrectionEngine.RemoveCount = RemoveCount;
AutoCorrectionEngine.ReplaceContent.push(MathRun); AutoCorrectionEngine.ReplaceContent.push(MathRun);
...@@ -4220,7 +4233,7 @@ var g_aAutoCorrectMathSymbols = ...@@ -4220,7 +4233,7 @@ var g_aAutoCorrectMathSymbols =
['\\psi', 0x03C8], ['\\psi', 0x03C8],
['\\Psi', 0x03A8], ['\\Psi', 0x03A8],
['\\qdrt', 0x221C], ['\\qdrt', 0x221C],
// TODO: \\quadratic ['\\quadratic', [0x0078, 0x003d, 0x0028, 0x002d, 0x0062, 0x00B1, 0x221A, 0x0020, 0x0028, 0x0062, 0x005e, 0x0032, 0x002d, 0x0034, 0x0061, 0x0063, 0x0029, 0x0029, 0x002f, 0x0032, 0x0061]],
['\\rangle', 0x232A], ['\\rangle', 0x232A],
['\\ratio', 0x2236], ['\\ratio', 0x2236],
['\\rbrace', 0x007D], ['\\rbrace', 0x007D],
......
...@@ -5760,22 +5760,25 @@ asc_docs_api.prototype.asc_hideComments = function() ...@@ -5760,22 +5760,25 @@ asc_docs_api.prototype.asc_hideComments = function()
asc_docs_api.prototype.asc_addComment = function(AscCommentData) asc_docs_api.prototype.asc_addComment = function(AscCommentData)
{ {
//if ( true === CollaborativeEditing.Get_GlobalLock() ) if (true === CollaborativeEditing.Get_GlobalLock())
// return; return;
if (null == this.WordControl.m_oLogicDocument) if (null == this.WordControl.m_oLogicDocument)
return; return;
var CommentData = new CCommentData();
CommentData.Read_FromAscCommentData(AscCommentData);
// Добавлять комментарии можно всегда if (false === this.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Paragraph_Content))
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(); {
var Comment = this.WordControl.m_oLogicDocument.Add_Comment( CommentData ); var CommentData = new CCommentData();
if ( null != Comment ) CommentData.Read_FromAscCommentData(AscCommentData);
this.sync_AddComment( Comment.Get_Id(), CommentData );
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint();
return Comment.Get_Id(); var Comment = this.WordControl.m_oLogicDocument.Add_Comment(CommentData);
if (null != Comment)
this.sync_AddComment(Comment.Get_Id(), CommentData);
return Comment.Get_Id();
}
}; };
asc_docs_api.prototype.asc_removeComment = function(Id) asc_docs_api.prototype.asc_removeComment = function(Id)
......
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