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

1. Переделала remove: поправила баги на delete не выставлялся placeholder в...

1. Переделала remove: поправила баги на delete не выставлялся placeholder в формуле, удаление по селекту
2. Поправила баг на добавление элемента, если находимся в плейсхолдере (сначала приходит Remove в ParagraphContent, где передается флаг, что пришел remove на добавление элемента, а затем Add)
3. Проверка на пустоту формулы
4. Удалила logarithm.js

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@52790 954022d7-b5bf-4e40-9824-e11837661b57
parent e497be48
...@@ -7587,7 +7587,7 @@ ParaMath.prototype = ...@@ -7587,7 +7587,7 @@ ParaMath.prototype =
Is_Empty : function() Is_Empty : function()
{ {
return false; return this.Math.Is_Empty();
}, },
Remove : function(Order, bOnAddText) Remove : function(Order, bOnAddText)
...@@ -7608,12 +7608,18 @@ ParaMath.prototype = ...@@ -7608,12 +7608,18 @@ ParaMath.prototype =
Selection_SetStart : function(X, Y, PageNum) Selection_SetStart : function(X, Y, PageNum)
{ {
//console.log("Selection_SetStart");
this.Math.Selection_SetStart( X, Y, PageNum ); this.Math.Selection_SetStart( X, Y, PageNum );
//console.log("Selection_Draw: IsPlaceholder "+ bPlh);
}, },
Selection_SetEnd : function(X, Y, PageNum, MouseEvent) Selection_SetEnd : function(X, Y, PageNum, MouseEvent)
{ {
console.log("Selection_SetEnd");
var bPlh = this.Math.SelectContent.IsPlaceholder();
this.Math.Selection_SetEnd( X, Y, PageNum, MouseEvent ); this.Math.Selection_SetEnd( X, Y, PageNum, MouseEvent );
console.log("Selection_Draw: IsPlaceholder "+ bPlh);
}, },
Selection_Beginning : function(bStart) Selection_Beginning : function(bStart)
...@@ -7628,12 +7634,14 @@ ParaMath.prototype = ...@@ -7628,12 +7634,14 @@ ParaMath.prototype =
Selection_Draw : function() Selection_Draw : function()
{ {
var bPlh = this.Math.SelectContent.IsPlaceholder();
console.log("Selection_Draw: IsPlaceholder "+ bPlh);
this.Math.Selection_Draw(); this.Math.Selection_Draw();
}, },
Selection_IsEmpty : function() Selection_IsEmpty : function()
{ {
return this.Math.Selection_IsEmpty() return this.Math.Selection_IsEmpty();
}, },
Selection_IsUse : function() Selection_IsUse : function()
...@@ -7681,13 +7689,11 @@ ParaMath.prototype = ...@@ -7681,13 +7689,11 @@ ParaMath.prototype =
Cursor_MoveToStartPos : function() Cursor_MoveToStartPos : function()
{ {
console.log("cursor_MoveToStartPos");
this.Math.Cursor_MoveToStartPos(); this.Math.Cursor_MoveToStartPos();
}, },
Cursor_MoveToEndPos : function() Cursor_MoveToEndPos : function()
{ {
console.log("cursor_MoveToStartPos");
this.Math.Cursor_MoveToEndPos(); this.Math.Cursor_MoveToEndPos();
}, },
......
//var NameFunctions = ["min", "max", "lim", "log", "ln", "sin", "cos", "tg", "ctg", "ch", "sh", "th", "cth", "sec", "csc", "cot", "csch", "sech", "coth"];
//var NameFunctions = ["min", "max", "lim", "log", "ln", "sin", "cos", "tan", "ctg", "cosh", "sinh", "tanh", "cth", "sec", "csc", "cot", "csch", "sech", "coth"];
//var Diff = ["dx","dy","dθ"];
function CLogarithm()
{
CSubMathBase.call(this,1,2);
}
extend(CLogarithm, CSubMathBase);
CLogarithm.prototype.setContent = function()
{
var oBase = new CMathContent();
var GParams = Common_CopyObj(this.params);
GParams.bMText = false;
oBase.init(GParams);
oBase.relate(this);
oBase.addText("log");
//oBase.setContent.apply(oBase, NameFunctions.minimax[3] );
var oFunc = new CDegreeOrdinary(-1);
oFunc.init(this.params);
oFunc.relate(this);
oFunc.setContent(oBase); //здесь выставляется для Base, что родительский класс CDegree...
//todo
//проверить !!!
//var oArg = new CMathBase(1, 1);
var oArg = new CMathContent();
oArg.init(this.params);
oArg.relate(this);
oArg.fillPlaceholders();
CLogarithm.superclass.setContent.call(this, oFunc, oArg);
}
CLogarithm.prototype.getFunction = function()
{
return this.elements[0][0].getBase();
}
CLogarithm.prototype.getBase = function()
{
return this.elements[0][0].getIterator();
}
CLogarithm.prototype.getArgument = function()
{
return this.elements[0][1];
}
function CMinimaxFunc()
{
CMathBase.call(this);
}
extend(CMinimaxFunc, CMathBase);
CMinimaxFunc.prototype.init = function()
{
this.setDimension(2, 1);
var oBase = new CMathContent();
//oBase.mergeTxtPrp({Italic: false});
oBase.setOwnTPrp({Italic: false});
var oIter = new CMathContent();
oIter.setReduct(DEGR_REDUCT);
this.addMCToContent(oBase, oIter);
}
CMinimaxFunc.prototype.getCenter = function()
{
return this.elements[0][0].size.center;
}
CMinimaxFunc.prototype.getBase = function()
{
return this.elements[0][0];
}
CMinimaxFunc.prototype.getIterator = function()
{
return this.elements[1][0];
}
CMinimaxFunc.prototype.old_setDistance = function()
{
var iter = this.elements[1][0].size,
ascent = iter.center + this.params.font.metrics.Placeholder.Height*DIV_CENTER;
this.dH = this.params.font.metrics.Placeholder.Height - ascent;
this.dW = 0;
//this.dH = this.params.font.FontSize/16*g_dKoef_pt_to_mm;
}
CMinimaxFunc.prototype.setDistance = function()
{
this.dH = 0.03674768518518519*this.getTxtPrp().FontSize;
}
function CMinimax()
{
CSubMathBase.call(this);
}
extend(CMinimax, CSubMathBase);
CMinimax.prototype.init = function()
{
this.setDimension(1, 2);
var oFunc = new CMinimaxFunc();
oFunc.init();
var oArg = new CMathContent();
this.addMCToContent(oFunc, oArg);
}
CMinimax.prototype.getFunction = function()
{
return this.elements[0][0].getBase();
}
CMinimax.prototype.getIterator = function()
{
return this.elements[0][0].getIterator();
}
CMinimax.prototype.getArgument = function()
{
return this.elements[0][1];
}
CMinimax.prototype.setDistance = function()
{
this.dW = this.getTxtPrp().FontSize/6*g_dKoef_pt_to_mm;
this.dH = 0;
}
function CMathFunc()
{
CMathBase.call(this);
}
extend(CMathFunc, CMathBase);
CMathFunc.prototype.init = function()
{
this.setDimension(1, 2);
this.setContent();
this.elements[0][0].setOwnTPrp({Italic: false}); // trigonometrical function
//this.elements[0][0].mergeTxtPrp({Italic: false}); // trigonometrical function
}
CMathFunc.prototype.setDistance = function()
{
this.dW = this.getTxtPrp().FontSize/6*g_dKoef_pt_to_mm;
}
CMathFunc.prototype.getFName = function()
{
return this.elements[0][0];
}
CMathFunc.prototype.getArgument = function()
{
return this.elements[0][1];
}
function old_CDifferential(num)
{
this.num = num;
CSubMathBase.call(this, 1,1);
}
extend(old_CDifferential, CSubMathBase);
old_CDifferential.prototype.setContent = function()
{
var oDiff = new CMathContent();
oDiff.init(this.params);
oDiff.addText(Diff[this.num]);
old_CMathFunc.superclass.setContent.call(this, oDiff);
}
function old_CTrigFunc(num)
{
if(num != num + 0 || num < 0 || num > 14)
return;
this.num = num;
//CSubMathBase.call(this, 1, 2);
CMathBase.call(this, 1,2);
}
//extend(old_CTrigFunc,CSubMathBase);
extend(old_CTrigFunc, CMathBase);
old_CTrigFunc.prototype.setContent = function()
{
var oFunc = new CMathContent();
var GParms = Common_CopyObj(this.params);
GParms.bMText = false;
oFunc.init(GParms);
oFunc.setContent.apply(oFunc, NameFunctions.trig[this.num] );
var oArg = new CMathContent();
oArg.init(this.params);
oArg.fillPlaceholders();
old_CTrigFunc.superclass.setContent.call(this, oFunc, oArg);
}
old_CTrigFunc.prototype.setDistance = function()
{
//todo
//переделать!
this.dW = slashWidth(this.params.font);
this.dH = 0;
}
old_CTrigFunc.prototype.getFunction = function()
{
return this.elemens[0][0];
}
old_CTrigFunc.prototype.getArgument = function()
{
return this.elemens[0][1];
}
This diff is collapsed.
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