Commit 3ade76f3 authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander Trofimov

тц мукышщт

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@58367 954022d7-b5bf-4e40-9824-e11837661b57
parent 9ecab112
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -180006,6 +180006,7 @@ function ParaRun(Paragraph, bMathRun)
this.Type = para_Math_Run;
this.Parent = null;
this.ArgSize = 0;
this.bEqqArray = false;
this.size = new CMathSize();
this.MathPrp = new CMPrp();
......@@ -181429,7 +181430,67 @@ ParaRun.prototype.Recalculate_MeasureContent = function()
this.RecalcInfo.Recalc = true;
this.RecalcInfo.Measure = false;
};
ParaRun.prototype.Recalculate_MeasureContent_2 = function(WidthPoints)
{
if ( false === this.RecalcInfo.Measure )
return;
var Pr = this.Get_CompiledPr(true);
this.Parent.ParaMath.ApplyArgSize(Pr, this.ArgSize);
if(!this.IsNormalText()) // выставляем false, чтобы не применился наклон к спец символам
{
Pr.Italic = false;
Pr.Bold = false;
var defaultTxtPrp = this.Parent.ParaMath.Get_Default_TPrp();
Pr.FontFamily = defaultTxtPrp.FontFamily;
Pr.RFonts.Set_All(defaultTxtPrp.FontFamily.Name, defaultTxtPrp.FontFamily.Index);
}
this.size.SetZero();
var widthCurr = 0,
ascent = 0, descent = 0;
var Theme = this.Paragraph.Get_Theme();
g_oTextMeasurer.SetTextPr(Pr, Theme);
g_oTextMeasurer.SetFontSlot(fontslot_ASCII);
var ContentLength = this.Content.length;
for ( var Pos = 0; Pos < ContentLength; Pos++ )
{
var Item = this.Content[Pos];
var ItemType = Item.Type;
Item.Parent = this;
Item.Resize(g_oTextMeasurer);
var oSize = Item.size;
widthCurr = oSize.width;
this.size.width += widthCurr;
var oDescent = oSize.height - oSize.ascent;
ascent = ascent > oSize.ascent ? ascent : oSize.ascent;
descent = descent < oDescent ? oDescent : descent;
if(this.bEqqArray)
{
if(ItemType !== para_Math_Ampersand)
WidthPoints.UpdatePoint(widthCurr);
else
WidthPoints.AddNewAlignRange();
}
}
this.RecalcInfo.Recalc = true;
this.RecalcInfo.Measure = false;
}
ParaRun.prototype.Recalculate_Measure2 = function(Metrics)
{
var TAscent = Metrics.Ascent;
......@@ -181462,13 +181523,23 @@ ParaRun.prototype.Recalculate_Range = function(PRS, ParaPr, Depth)
if ( this.Paragraph !== PRS.Paragraph )
{
this.Paragraph = PRS.Paragraph;
if(this.Type == para_Math_Run)
{
this.ArgSize = PRS.ArgSize.value;
this.bEqqArray = PRS.bEqqArray;
this.Parent = PRS.Parent;
}
this.RecalcInfo.TextPr = true;
this.Paragraph.RecalcInfo.Set_Type_0_Spell( pararecalc_0_Spell_All );
}
// Сначала измеряем элементы (можно вызывать каждый раз, внутри разруливается, чтобы измерялось 1 раз)
if(this.Type !== para_Math_Run)
this.Recalculate_MeasureContent();
else
this.Recalculate_MeasureContent_2(PRS.WidthPoints);
var CurLine = PRS.Line - this.StartLine;
var CurRange = ( 0 === CurLine ? PRS.Range - this.StartRange : PRS.Range );
......@@ -184433,6 +184504,9 @@ ParaRun.prototype.Selection_IsEmpty = function(CheckEnd)
if ( true !== Selection.Use )
return true;
if(this.Type == para_Math_Run && this.IsPlaceholder())
return false;
var StartPos = Selection.StartPos;
var EndPos = Selection.EndPos;
......@@ -187741,6 +187815,8 @@ ParaRun.prototype.Math_Recalculate = function(oMeasure, Parent, Paragraph, RPI,
// обновляем позиции start и end для Range
//this.Lines[0].Add_Range(0, RangeStartPos, RangeEndPos);
this.protected_AddRange(0, 0);
this.protected_FillRange(0, 0, RangeStartPos, RangeEndPos);
var oWPrp = this.Get_CompiledPr(true);
......@@ -188483,6 +188559,10 @@ ParaMath.prototype =
var ArgSize = new CMathArgSize();
if(PRS.NewRange == false)
this.Root.Recalculate_Reset(PRS.Range, PRS.Line);
this.Root.Resize(g_oTextMeasurer, null, this, RPI/*recalculate properties info*/, ArgSize, TextPr);
//this.Root.Resize(null, this, g_oTextMeasurer, RPI/*recalculate properties info*/, TextPr);
......@@ -188598,8 +188678,7 @@ ParaMath.prototype =
}
}
if(PRS.NewRange == false)
this.Root.Recalculate_Reset(PRS.Range, PRS.Line);
......@@ -214161,10 +214240,10 @@ CDocument.prototype =
else
{
// Нам нужно пересчитать все изменения, начиная с текущего элемента
this.ContentLastChangePos = this.CurPos.ContentPos;
this.Recalculate(true);
}
Item.RecalculateCurPos();
Item.CurPos.RealX = Item.CurPos.X;
Item.CurPos.RealY = Item.CurPos.Y;
}
......@@ -227477,6 +227556,7 @@ CDocumentContent.prototype =
if ( type_Paragraph === ItemType )
{
Item.RecalculateCurPos();
Item.CurPos.RealX = Item.CurPos.X;
Item.CurPos.RealY = Item.CurPos.Y;
}
......@@ -232627,6 +232707,8 @@ CDocumentContent.prototype =
{
this.Selection_Remove();
this.Parent.Set_CurrentElement(true, this.Get_StartPage_Absolute() + this.CurPage);
// Прячем курсор
this.DrawingDocument.TargetEnd();
this.DrawingDocument.SetCurrentPage( this.Get_StartPage_Absolute() + this.CurPage );
......@@ -232648,8 +232730,6 @@ CDocumentContent.prototype =
this.LogicDocument.Selection.Start = false;
}
this.Parent.Set_CurrentElement(true, this.Get_StartPage_Absolute() + this.CurPage);
this.LogicDocument.DrawingObjects.selectById( Id, this.Get_StartPage_Absolute() + this.CurPage );
// TODO: Пока сделаем так, в будущем надо сделать функцию, которая у родительского класса обновляет Select
......@@ -252024,21 +252104,34 @@ CTable.prototype =
// Найдем промежуток строк по PageIndex среди которых нам надо искать
var PNum = PageIndex;// - this.PageNum;
if ( PNum < 0 || PNum >= this.Pages.length )
return;
var Row_start, Row_last;
if (PNum < 0)
{
Row_start = 0;
Row_last = 0;
}
else if (PNum >= this.Pages.length)
{
Row_start = this.Content.length - 1;
Row_last = this.Content.length - 1;
}
else
{
// Определим какие строки попадают на данную страницу
var Row_start = this.Pages[PNum].FirstRow;
var Row_last = Row_start;
Row_start = this.Pages[PNum].FirstRow;
Row_last = Row_start;
if ( PNum + 1 < this.Pages.length )
if (PNum + 1 < this.Pages.length)
{
Row_last = this.Pages[PNum + 1].FirstRow;
if ( Row_last != Row_start && false === this.RowsInfo[Row_last].FirstPage )
if (Row_last != Row_start && false === this.RowsInfo[Row_last].FirstPage)
Row_last--;
}
else
Row_last = this.Content.length - 1;
}
if ( Row_last < Row_start )
return { Row : 0, Cell : 0 };
......@@ -256771,6 +256864,7 @@ CTableCell.prototype =
this.Pr.TableCellW.Read_FromBinary( Reader );
}
this.Recalc_CompiledPr();
break;
}
......@@ -292333,6 +292427,10 @@ ScrollObject.prototype = {
if ( this.canvas.addEventListener )
this.canvas.addEventListener( 'DOMMouseScroll', this.evt_mousewheel, false );
this.context.fillStyle = this.settings.scrollBackgroundColor;
this.context.fillRect(0,0,this.canvasW,this.canvasH);
this._drawArrow();
this._draw();
......@@ -292812,8 +292910,9 @@ ScrollObject.prototype = {
}
if(img){
that.context.drawImage( img, x, y );
}
}
function fadeOut() {
......@@ -292928,8 +293027,9 @@ ScrollObject.prototype = {
}
if(img){
that.context.drawImage( img, x, y );
}
}
function drawScroller() {
......@@ -295213,7 +295313,6 @@ function CMathText(bJDraw)
this.rasterOffsetY = 0;
this.GapLeft = 0;
this.GapRight = 0;
this.WidthVisible = 0;
// TO DO
// убрать
......@@ -295679,17 +295778,13 @@ CMathText.prototype =
this.size.height = height;
this.size.ascent = ascent;
this.WidthVisible = this.size.width;
//this.size = {width: width, widthG: width, height: height, ascent: ascent};
},
/*ApplyGaps: function()
Get_WidthVisible: function()
{
this.size.SetZero();
this.size.width = this.GapLeft + this.GapRight;
this.WidthVisible = this.size.width;
},*/
return this.size.width;
},
draw: function(x, y, pGraphics)
{
var X = this.pos.x + x,
......@@ -295915,7 +296010,10 @@ CMathAmp.prototype =
};
}
this.WidthVisible = this.size.width;
},
Get_WidthVisible: function()
{
return this.size.width;
},
setPosition: function(pos)
{
......@@ -300021,7 +300119,11 @@ CMathContent.prototype =
this.InfoPoints.ContentPoints.UpdatePoint(this.content[pos].size.width);
}
else if(this.content[pos].Type == para_Math_Run)
{
//this.content[pos].Recalculate_Range();
this.content[pos].Math_Recalculate(oMeasure, this, ParaMath.Paragraph, RPI, this.Compiled_ArgSz, this.InfoPoints.ContentPoints);
}
this.WidthToElement[pos] = this.size.width;
......@@ -304733,6 +304835,7 @@ function CMathBase(bInside)
};
this.bSelectionUse = false;
this.bInsideUpperSelect = false;
this.nRow = 0;
this.nCol = 0;
......@@ -305326,28 +305429,13 @@ CMathBase.prototype =
{
if( bSelection )
{
//var SelectX, SelectY;
var oSelect;
if(bStart)
{
//SelectX = this.SelectStart_X;
//SelectY = this.SelectStart_Y;
oSelect = this.SelectStart;
//SelectX = this.SelectStart.X;
//SelectY = this.SelectStart.Y;
}
else
{
oSelect = this.SelectEnd;
//SelectX = this.SelectEnd.X;
//SelectY = this.SelectEnd.Y;
}
ContentPos.Add(oSelect.X);
ContentPos.Add(oSelect.Y);
......@@ -305413,16 +305501,20 @@ CMathBase.prototype =
var bJustDraw = this.elements[this.SelectStart.X][this.SelectStart.Y].IsJustDraw();
if(startX == endX && startY == endY && !bJustDraw)
if(startX == endX && startY == endY)
{
if(!bJustDraw)
this.elements[startX][startY].Set_SelectionContentPos(StartContentPos, EndContentPos, Depth, StartFlag, EndFlag);
}
else
{
this.elements[startX][startY].Set_SelectionContentPos(StartContentPos, null, Depth, StartFlag, -1);
}
}
/*if(this.constructor.name == "CDegreeSubSup")
{
console.log("startX " + startX + " startY " + startY + "; " + "endX " + endX + " endY " + endY);
}*/
this.bSelectionUse = true;
......@@ -305438,7 +305530,17 @@ CMathBase.prototype =
},
IsSelectEmpty: function()
{
return (!this.SelectStart.bOutside && !this.SelectEnd.bOutside) && (this.SelectStart.X == this.SelectEnd.X) && (this.SelectStart.Y == this.SelectEnd.Y);
var startX = this.SelectStart.X,
startY = this.SelectStart.Y;
var endX = this.SelectEnd.X,
endY = this.SelectEnd.Y;
var bEqual = (startX == endX) && (startY == endY);
var bInsideSelect = bEqual && this.elements[startX][startY].bInside == true && !this.elements[startX][startY].IsSelectEmpty();
return (!this.SelectStart.bOutside && !this.SelectEnd.bOutside) && bEqual && !bInsideSelect;
},
Recalculate_CurPos: function(_X, Y, CurrentRun, _CurRange, _CurLine, _CurPage, UpdateCurPos, UpdateTarget, ReturnTarget)
{
......@@ -305478,8 +305580,8 @@ CMathBase.prototype =
{
var start_X = this.SelectStart.X,
start_Y = this.SelectStart.Y;
if(!this.SelectStart.bOutside)
// проверка на bSelectionUse, чтобы избежать ситуации, когда селекта в этом элементе не было
if(!this.SelectStart.bOutside && this.bSelectionUse) // и нужно очистить селект у всех незаселекченных элементов контента (в тч и этом) в функции Selection_DrawRange. а стартовая и конечная позиции совпадают и в стартовой позиции находится JustDraw-элемент
this.elements[start_X][start_Y].Selection_Remove();
this.bSelectionUse = false;
......@@ -309567,20 +309669,6 @@ function CNaryUndOvr(bInside)
this.setDimension(3,1);
}
Asc.extendClass(CNaryUndOvr, CMathBase);
/*CNaryUndOvr.prototype.old_init = function(oSign)
{
this.setDimension(3,1);
var iter1 = new CMathContent();
iter1.decreaseArgSize();
var iter2 = new CMathContent();
iter2.decreaseArgSize();
var base = new CMathContent();
this.addMCToContent(iter1, base, iter2);
}*/
CNaryUndOvr.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
{
this.Parent = Parent;
......@@ -309628,11 +309716,11 @@ CNaryUndOvr.prototype.recalculateSize = function()
CNaryUndOvr.prototype.setPosition = function(pos, PosInfo)
{
this.pos.x = pos.x;
this.pos.y = pos.y - this.size.ascent;
this.pos.y = pos.y;
var PosUpIter = new CMathPosition();
PosUpIter.x = pos.x + this.GapLeft + this.align(0, 0).x;
PosUpIter.x = pos.x + this.GapLeft + this.align(0,0).x;
PosUpIter.y = pos.y;
......@@ -320293,7 +320381,7 @@ CPhantom.prototype.Get_Id = function()
this.docStylesImage = "";
this.docStyles = null;
this.styleThumbnailWidth = 104;
this.styleThumbnailWidth = 112;
this.styleThumbnailHeight = 38;
this.styleThumbnailWidthPt = this.styleThumbnailWidth * 72 / 96;
this.styleThumbnailHeightPt = this.styleThumbnailHeight * 72 / 96;
......@@ -352055,6 +352143,8 @@ asc_docs_api.prototype.SetPaintFormat = function(_value)
var value = ( true === _value ? c_oAscFormatPainterState.kOn : ( false === _value ? c_oAscFormatPainterState.kOff : _value ) );
this.isPaintFormat = value;
if (c_oAscFormatPainterState.kOff !== value)
this.WordControl.m_oLogicDocument.Document_Format_Copy();
};
......@@ -354579,6 +354669,13 @@ CDrawingDocument.prototype =
var drawingFirst = this.Native["GetDrawingFirstPage"]();
var drawingEnd = this.Native["GetDrawingEndPage"]();
if (-1 == drawingFirst || -1 == drawingEnd)
{
this.Native["DD_Overlay_UpdateEnd"]();
return true;
}
if (this.m_bIsSelection)
{
this.Native["DD_Overlay_StartDrawSelection"]();
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