Commit d1425a6d authored by Alexey.Musinov's avatar Alexey.Musinov Committed by Alexander.Trofimov

[ios] update

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@68863 954022d7-b5bf-4e40-9824-e11837661b57
parent 745b49cb
...@@ -540,6 +540,8 @@ CGraphics.prototype = ...@@ -540,6 +540,8 @@ CGraphics.prototype =
this.TextureFillTransformScaleX = 1 / this.m_oCoordTransform.sx; this.TextureFillTransformScaleX = 1 / this.m_oCoordTransform.sx;
this.TextureFillTransformScaleY = 1 / this.m_oCoordTransform.sy; this.TextureFillTransformScaleY = 1 / this.m_oCoordTransform.sy;
this.LastFontOriginInfo = { Name : "", Replace : null };
/* /*
if (this.IsThumbnail) if (this.IsThumbnail)
{ {
...@@ -553,6 +555,8 @@ CGraphics.prototype = ...@@ -553,6 +555,8 @@ CGraphics.prototype =
this.m_oContext.mozImageSmoothingEnabled = false; this.m_oContext.mozImageSmoothingEnabled = false;
*/ */
//this.ClearParams();
this.m_oLastFont.Clear(); this.m_oLastFont.Clear();
this.Native["PD_Save"](); this.Native["PD_Save"]();
...@@ -562,6 +566,18 @@ CGraphics.prototype = ...@@ -562,6 +566,18 @@ CGraphics.prototype =
{ {
}, },
ClearParams : function()
{
this.m_oTextPr = null;
this.m_oGrFonts = new CGrRFonts();
this.m_oLastFont = new CFontSetup();
this.IsUseFonts2 = false;
this.m_oLastFont2 = null;
this.m_bIntegerGrid = true;
},
put_GlobalAlpha : function(enable, alpha) put_GlobalAlpha : function(enable, alpha)
{ {
if (false === enable) if (false === enable)
...@@ -815,6 +831,10 @@ CGraphics.prototype = ...@@ -815,6 +831,10 @@ CGraphics.prototype =
if (!this.m_bIntegerGrid) if (!this.m_bIntegerGrid)
this.Native["PD_transform"](this.m_oCoordTransform.sx,0,0,this.m_oCoordTransform.sy,0, 0); this.Native["PD_transform"](this.m_oCoordTransform.sx,0,0,this.m_oCoordTransform.sy,0, 0);
//this.ClearParams();
this.Native["PD_reset"]();
}, },
transform3 : function(m, isNeedInvert) transform3 : function(m, isNeedInvert)
...@@ -1174,11 +1194,9 @@ CGraphics.prototype = ...@@ -1174,11 +1194,9 @@ CGraphics.prototype =
var _fontinfo = g_fontApplication.GetFontInfo(font.FontFamily.Name, oFontStyle, this.LastFontOriginInfo); var _fontinfo = g_fontApplication.GetFontInfo(font.FontFamily.Name, oFontStyle, this.LastFontOriginInfo);
var _info = GetLoadInfoForMeasurer(_fontinfo, oFontStyle); var _info = GetLoadInfoForMeasurer(_fontinfo, oFontStyle);
var _last_font = this.IsUseFonts2 ? this.m_oLastFont2 : this.m_oLastFont; this.m_oLastFont.SetUpName = font.FontFamily.Name;
this.m_oLastFont.SetUpSize = font.FontSize;
_last_font.SetUpName = font.FontFamily.Name; this.m_oLastFont.SetUpStyle = oFontStyle;
_last_font.SetUpSize = font.FontSize;
_last_font.SetUpStyle = oFontStyle;
var flag = 0; var flag = 0;
if (_info.NeedBold) flag |= 0x01; if (_info.NeedBold) flag |= 0x01;
...@@ -1186,6 +1204,8 @@ CGraphics.prototype = ...@@ -1186,6 +1204,8 @@ CGraphics.prototype =
if (_info.SrcBold) flag |= 0x04; if (_info.SrcBold) flag |= 0x04;
if (_info.SrcItalic) flag |= 0x08; if (_info.SrcItalic) flag |= 0x08;
g_oTextMeasurer.Measurer["LoadFont"](_info.Path, _info.FaceIndex, font.FontSize, flag);
this.Native["PD_LoadFont"](_info.Path, _info.FaceIndex, font.FontSize, flag); this.Native["PD_LoadFont"](_info.Path, _info.FaceIndex, font.FontSize, flag);
}, },
...@@ -1203,7 +1223,7 @@ CGraphics.prototype = ...@@ -1203,7 +1223,7 @@ CGraphics.prototype =
SetFontSlot : function(slot, fontSizeKoef) SetFontSlot : function(slot, fontSizeKoef)
{ {
var _rfonts = this.m_oTextPr.RFonts; var _rfonts = this.m_oTextPr.RFonts;
var _lastFont = this.IsUseFonts2 ? this.m_oLastFont2 : this.m_oLastFont; var _lastFont = this.m_oLastFont;
switch (slot) switch (slot)
{ {
...@@ -1255,20 +1275,25 @@ CGraphics.prototype = ...@@ -1255,20 +1275,25 @@ CGraphics.prototype =
if (_lastFont.Bold) if (_lastFont.Bold)
_style += 1; _style += 1;
_lastFont.SetUpName = _lastFont.Name; // if (_lastFont.Name != _lastFont.SetUpName || _lastFont.Size != _lastFont.SetUpSize || _style != _lastFont.SetUpStyle)
_lastFont.SetUpSize = _lastFont.Size; {
_lastFont.SetUpStyle = _style; _lastFont.SetUpName = _lastFont.Name;
_lastFont.SetUpSize = _lastFont.Size;
_lastFont.SetUpStyle = _style;
var _fontinfo = g_fontApplication.GetFontInfo(_lastFont.SetUpName, _lastFont.SetUpStyle, this.LastFontOriginInfo); var _fontinfo = g_fontApplication.GetFontInfo(_lastFont.SetUpName, _lastFont.SetUpStyle, this.LastFontOriginInfo);
var _info = GetLoadInfoForMeasurer(_fontinfo, _lastFont.SetUpStyle); var _info = GetLoadInfoForMeasurer(_fontinfo, _lastFont.SetUpStyle);
var flag = 0; var flag = 0;
if (_info.NeedBold) flag |= 0x01; if (_info.NeedBold) flag |= 0x01;
if (_info.NeedItalic) flag |= 0x02; if (_info.NeedItalic) flag |= 0x02;
if (_info.SrcBold) flag |= 0x04; if (_info.SrcBold) flag |= 0x04;
if (_info.SrcItalic) flag |= 0x08; if (_info.SrcItalic) flag |= 0x08;
g_oTextMeasurer.Measurer["LoadFont"](_info.Path, _info.FaceIndex, _lastFont.SetUpSize, flag);
this.Native["PD_LoadFont"](_info.Path, _info.FaceIndex, _lastFont.SetUpSize, flag); this.Native["PD_LoadFont"](_info.Path, _info.FaceIndex, _lastFont.SetUpSize, flag);
}
}, },
GetTextPr : function() GetTextPr : function()
...@@ -1282,7 +1307,10 @@ CGraphics.prototype = ...@@ -1282,7 +1307,10 @@ CGraphics.prototype =
if (null != this.LastFontOriginInfo.Replace) if (null != this.LastFontOriginInfo.Replace)
_code = g_fontApplication.GetReplaceGlyph(_code, this.LastFontOriginInfo.Replace); _code = g_fontApplication.GetReplaceGlyph(_code, this.LastFontOriginInfo.Replace);
this.Native["PD_FillText"](x,y,_code); // var _x = this.m_oInvertFullTransform.TransformPointX(x,y);
// var _y = this.m_oInvertFullTransform.TransformPointY(x,y);
this.Native["PD_FillText"](x, y, _code);
}, },
t : function(text,x,y) t : function(text,x,y)
{ {
......
window["Asc"].WorksheetView = WorksheetView; window["Asc"].WorksheetView = WorksheetView;
WorksheetView.prototype._drawColumnHeaders_Local = function (drawingCtx, start, end, style, offsetXForDraw, offsetYForDraw) { WorksheetView.prototype.__drawColumnHeaders = function (drawingCtx, start, end, style, offsetXForDraw, offsetYForDraw) {
if (undefined === drawingCtx && false === this.model.sheetViews[0].asc_getShowRowColHeaders()) if (undefined === drawingCtx && false === this.model.sheetViews[0].asc_getShowRowColHeaders())
return; return;
...@@ -33,12 +33,12 @@ WorksheetView.prototype._drawColumnHeaders_Local = function (drawingCtx, start, ...@@ -33,12 +33,12 @@ WorksheetView.prototype._drawColumnHeaders_Local = function (drawingCtx, start,
// draw column headers // draw column headers
for (var i = start; i <= end; ++i) { for (var i = start; i <= end; ++i) {
this._drawHeader_Local(drawingCtx, c[i].left - c[start].left - offsetX, offsetY, this.__drawHeader(drawingCtx, c[i].left - c[start].left - offsetX, offsetY,
c[i].width, this.headersHeight, style, true, i); c[i].width, this.headersHeight, style, true, i);
} }
}; };
WorksheetView.prototype._drawHeader_Local = function (drawingCtx, x, y, w, h, style, isColHeader, index) { WorksheetView.prototype.__drawHeader = function (drawingCtx, x, y, w, h, style, isColHeader, index) {
// Для отрисовки невидимого столбца/строки // Для отрисовки невидимого столбца/строки
var isZeroHeader = false; var isZeroHeader = false;
if (-1 !== index) { if (-1 !== index) {
...@@ -137,7 +137,7 @@ WorksheetView.prototype._drawHeader_Local = function (drawingCtx, x, y, w, h, st ...@@ -137,7 +137,7 @@ WorksheetView.prototype._drawHeader_Local = function (drawingCtx, x, y, w, h, st
} }
}; };
WorksheetView.prototype._drawRowHeaders_Local = function (drawingCtx, start, end, style, offsetXForDraw, offsetYForDraw) { WorksheetView.prototype.__drawRowHeaders = function (drawingCtx, start, end, style, offsetXForDraw, offsetYForDraw) {
if (undefined === drawingCtx && false === this.model.sheetViews[0].asc_getShowRowColHeaders()) if (undefined === drawingCtx && false === this.model.sheetViews[0].asc_getShowRowColHeaders())
return; return;
...@@ -169,18 +169,18 @@ WorksheetView.prototype._drawRowHeaders_Local = function (drawingCtx, start, end ...@@ -169,18 +169,18 @@ WorksheetView.prototype._drawRowHeaders_Local = function (drawingCtx, start, end
// draw row headers // draw row headers
for (var i = start; i <= end; ++i) { for (var i = start; i <= end; ++i) {
this._drawHeader_Local(drawingCtx, offsetX, r[i].top - r[start].top - offsetY, this.__drawHeader(drawingCtx, offsetX, r[i].top - r[start].top - offsetY,
this.headersWidth, r[i].height, style, false, i); this.headersWidth, r[i].height, style, false, i);
} }
}; };
WorksheetView.prototype._drawGrid_Local = function (drawingCtx, c1, r1, c2, r2, leftFieldInPt, topFieldInPt, width, height) { WorksheetView.prototype.__drawGrid = function (drawingCtx, c1, r1, c2, r2, leftFieldInPt, topFieldInPt, width, height) {
var range = new asc_Range(c1, r1, c2, r2); var range = new asc_Range(c1, r1, c2, r2);
this._prepareCellTextMetricsCache(range); this._prepareCellTextMetricsCache(range);
this._drawGrid(drawingCtx, range, leftFieldInPt, topFieldInPt, width, height); this._drawGrid(drawingCtx, range, leftFieldInPt, topFieldInPt, width, height);
}; };
WorksheetView.prototype._drawCellsAndBorders_Local = function (drawingCtx, c1, r1, c2, r2, offsetXForDraw, offsetYForDraw) { WorksheetView.prototype.__drawCellsAndBorders = function (drawingCtx, c1, r1, c2, r2, offsetXForDraw, offsetYForDraw) {
var range = new asc_Range(c1, r1, c2, r2); var range = new asc_Range(c1, r1, c2, r2);
this._drawCellsAndBorders(drawingCtx, range, offsetXForDraw, offsetYForDraw); this._drawCellsAndBorders(drawingCtx, range, offsetXForDraw, offsetYForDraw);
...@@ -201,6 +201,16 @@ WorksheetView.prototype._drawCellsAndBorders_Local = function (drawingCtx, c1, ...@@ -201,6 +201,16 @@ WorksheetView.prototype._drawCellsAndBorders_Local = function (drawingCtx, c1,
window.native["SwitchMemoryLayer"](); window.native["SwitchMemoryLayer"]();
g_oTextMeasurer.m_oFont = null;
g_oTextMeasurer.m_oTextPr = null;
g_oTextMeasurer.m_oGrFonts = new CGrRFonts();
g_oTextMeasurer.m_oLastFont = new CFontSetup();
g_oTextMeasurer.LastFontOriginInfo = { Name : "", Replace : null };
g_oTextMeasurer.Ascender = 0;
g_oTextMeasurer.Descender = 0;
g_oTextMeasurer.Height = 0;
g_oTextMeasurer.UnitsPerEm = 0;
this.objectRender.showDrawingObjectsEx(false); this.objectRender.showDrawingObjectsEx(false);
this.cellsLeft = cellsLeft_Local; this.cellsLeft = cellsLeft_Local;
...@@ -208,7 +218,7 @@ WorksheetView.prototype._drawCellsAndBorders_Local = function (drawingCtx, c1, ...@@ -208,7 +218,7 @@ WorksheetView.prototype._drawCellsAndBorders_Local = function (drawingCtx, c1,
this.visibleRange = oldrange; this.visibleRange = oldrange;
}; };
WorksheetView.prototype._getDrawSelection_Local = function (c1, r1, c2, r2, isFrozen) { WorksheetView.prototype.__selection = function (c1, r1, c2, r2, isFrozen) {
var native_selection = []; var native_selection = [];
...@@ -577,12 +587,7 @@ WorksheetView.prototype._getDrawSelection_Local = function (c1, r1, c2, r2, isFr ...@@ -577,12 +587,7 @@ WorksheetView.prototype._getDrawSelection_Local = function (c1, r1, c2, r2, isFr
//} //}
}; };
WorksheetView.prototype._updateCache = function(c1, r1, c2, r2) { WorksheetView.prototype.__changeSelectionTopLeft = function (x, y, isCoord, isSelectMode, isTopLeft) {
var range = new asc_Range(c1, r1, c2, r2);
this._prepareCellTextMetricsCache(range);
};
WorksheetView.prototype._changeSelectionTopLeft = function (x, y, isCoord, isSelectMode, isTopLeft) {
//var ar = (this.isFormulaEditMode) ? this.arrActiveFormulaRanges[this.arrActiveFormulaRanges.length - 1] : this.activeRange; //var ar = (this.isFormulaEditMode) ? this.arrActiveFormulaRanges[this.arrActiveFormulaRanges.length - 1] : this.activeRange;
var isMoveActiveCellToLeftTop = false; var isMoveActiveCellToLeftTop = false;
...@@ -772,10 +777,10 @@ WorksheetView.prototype.__drawFormulaRanges = function (arrRanges, offsetX, offs ...@@ -772,10 +777,10 @@ WorksheetView.prototype.__drawFormulaRanges = function (arrRanges, offsetX, offs
bottom = this.rows[Math.max(0,arrRanges[i].r2)].top + this.rows[Math.max(0,arrRanges[i].r2)].height - offsetY; bottom = this.rows[Math.max(0,arrRanges[i].r2)].top + this.rows[Math.max(0,arrRanges[i].r2)].height - offsetY;
} }
// else if (5 === type) { // range image // else if (5 === type) { // range image
// } // }
// else if (6 === type) { // range chart // else if (6 === type) { // range chart
// } // }
ranges.push(left); ranges.push(left);
ranges.push(top); ranges.push(top);
......
...@@ -777,7 +777,6 @@ var FT_Common = new _FT_Common(); ...@@ -777,7 +777,6 @@ var FT_Common = new _FT_Common();
var global_memory_stream_menu = CreateNativeMemoryStream(); var global_memory_stream_menu = CreateNativeMemoryStream();
function asc_menu_ReadColor(_params, _cursor) { function asc_menu_ReadColor(_params, _cursor) {
var _color = new asc_CColor(); var _color = new asc_CColor();
var _continue = true; var _continue = true;
...@@ -3032,7 +3031,7 @@ function OfflineEditor () { ...@@ -3032,7 +3031,7 @@ function OfflineEditor () {
region = this._updateRegion(worksheet, x, y, width, height); region = this._updateRegion(worksheet, x, y, width, height);
} }
this.selection = _api.wb.getWorksheet()._getDrawSelection_Local(region.columnBeg, region.rowBeg, region.columnEnd, region.rowEnd); this.selection = _api.wb.getWorksheet().__selection(region.columnBeg, region.rowBeg, region.columnEnd, region.rowEnd);
return this.selection; return this.selection;
}; };
...@@ -3168,13 +3167,13 @@ function OfflineEditor () { ...@@ -3168,13 +3167,13 @@ function OfflineEditor () {
var colRowHeaders = _api.asc_getSheetViewSettings(); var colRowHeaders = _api.asc_getSheetViewSettings();
if (colRowHeaders.asc_getShowGridLines()) { if (colRowHeaders.asc_getShowGridLines()) {
worksheet._drawGrid_Local(undefined, worksheet.__drawGrid(undefined,
region.columnBeg, region.rowBeg, region.columnEnd, region.rowEnd, region.columnBeg, region.rowBeg, region.columnEnd, region.rowEnd,
worksheet.cols[region.columnBeg].left + region.columnOff, worksheet.rows[region.rowBeg].top + region.rowOff, worksheet.cols[region.columnBeg].left + region.columnOff, worksheet.rows[region.rowBeg].top + region.rowOff,
width + region.columnOff, height + region.rowOff); width + region.columnOff, height + region.rowOff);
} }
worksheet._drawCellsAndBorders_Local(undefined, worksheet.__drawCellsAndBorders(undefined,
region.columnBeg, region.rowBeg, region.columnEnd, region.rowEnd, region.columnBeg, region.rowBeg, region.columnEnd, region.rowEnd,
worksheet.cols[region.columnBeg].left + region.columnOff, worksheet.rows[region.rowBeg].top + region.rowOff); worksheet.cols[region.columnBeg].left + region.columnOff, worksheet.rows[region.rowBeg].top + region.rowOff);
}; };
...@@ -3190,9 +3189,9 @@ function OfflineEditor () { ...@@ -3190,9 +3189,9 @@ function OfflineEditor () {
var isRow = type == PageType.PageLeftType || type == PageType.PageCornerType; var isRow = type == PageType.PageLeftType || type == PageType.PageCornerType;
if (!isColumn && isRow) if (!isColumn && isRow)
worksheet._drawRowHeaders_Local(undefined, region.rowBeg, region.rowEnd, undefined, 0, region.rowOff); worksheet.__drawRowHeaders(undefined, region.rowBeg, region.rowEnd, undefined, 0, region.rowOff);
else if (isColumn && !isRow) else if (isColumn && !isRow)
worksheet._drawColumnHeaders_Local(undefined, region.columnBeg, region.columnEnd, undefined, region.columnOff, 0); worksheet.__drawColumnHeaders(undefined, region.columnBeg, region.columnEnd, undefined, region.columnOff, 0);
else if (isColumn && isRow) else if (isColumn && isRow)
worksheet._drawCorner(); worksheet._drawCorner();
}; };
...@@ -4449,9 +4448,9 @@ function offline_mouse_move(x, y, isViewerMode, isRangeResize, isChartRange, ind ...@@ -4449,9 +4448,9 @@ function offline_mouse_move(x, y, isViewerMode, isRangeResize, isChartRange, ind
ws.enterCellRange(wb.cellEditor); ws.enterCellRange(wb.cellEditor);
} else { } else {
if (-1 == _s.cellPin) if (-1 == _s.cellPin)
ws._changeSelectionTopLeft(x, y, true, true, true); ws.__changeSelectionTopLeft(x, y, true, true, true);
else if (1 === _s.cellPin) else if (1 === _s.cellPin)
ws._changeSelectionTopLeft(x, y, true, true, false); ws.__changeSelectionTopLeft(x, y, true, true, false);
else { else {
ws.changeSelectionEndPoint(x, y, true, true); ws.changeSelectionEndPoint(x, y, true, true);
} }
......
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