3.0 source code
This commit is contained in:
1880
OfficeWeb/sdk/Excel/model/DrawingObjects/Format/Chart.js
vendored
1880
OfficeWeb/sdk/Excel/model/DrawingObjects/Format/Chart.js
vendored
File diff suppressed because it is too large
Load Diff
@@ -1,175 +0,0 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
var LAYOUT_MODE_EDGE = 0;
|
||||
var LAYOUT_MODE_FACTOR = 1;
|
||||
var LAYOUT_TARGET_INNER = 0;
|
||||
var LAYOUT_TARGET_OUTER = 1;
|
||||
function CChartLayout() {
|
||||
this.isManual = false;
|
||||
this.layoutTarget = null;
|
||||
this.xMode = null;
|
||||
this.yMode = null;
|
||||
this.wMode = null;
|
||||
this.hMode = null;
|
||||
this.x = null;
|
||||
this.y = null;
|
||||
this.w = null;
|
||||
this.h = null;
|
||||
this.Id = g_oIdCounter.Get_NewId();
|
||||
g_oTableId.Add(this, this.Id, null);
|
||||
}
|
||||
CChartLayout.prototype = {
|
||||
Get_Id: function () {
|
||||
return this.Id;
|
||||
},
|
||||
getObjectType: function () {
|
||||
return CLASS_TYPE_CHART_LAYOUT;
|
||||
},
|
||||
setXMode: function (mode) {
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_Layout_Set_X_Mode, null, null, new UndoRedoDataGraphicObjects(this.Id, new UndoRedoDataGOSingleProp(this.xMode, mode)), null);
|
||||
this.xMode = mode;
|
||||
},
|
||||
setYMode: function (mode) {
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_Layout_Set_Y_Mode, null, null, new UndoRedoDataGraphicObjects(this.Id, new UndoRedoDataGOSingleProp(this.yMode, mode)), null);
|
||||
this.yMode = mode;
|
||||
},
|
||||
setX: function (x) {
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_Layout_Set_X, null, null, new UndoRedoDataGraphicObjects(this.Id, new UndoRedoDataGOSingleProp(this.x, x)), null);
|
||||
this.x = x;
|
||||
},
|
||||
setY: function (y) {
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_Layout_Set_Y, null, null, new UndoRedoDataGraphicObjects(this.Id, new UndoRedoDataGOSingleProp(this.y, y)), null);
|
||||
this.y = y;
|
||||
},
|
||||
setIsManual: function (isManual) {
|
||||
this.isManual = isManual;
|
||||
},
|
||||
Undo: function (type, data) {
|
||||
switch (type) {
|
||||
case historyitem_AutoShapes_Layout_Set_X_Mode:
|
||||
this.xMode = data.oldValue;
|
||||
break;
|
||||
case historyitem_AutoShapes_Layout_Set_Y_Mode:
|
||||
this.yMode = data.oldValue;
|
||||
break;
|
||||
case historyitem_AutoShapes_Layout_Set_X:
|
||||
this.x = data.oldValue;
|
||||
break;
|
||||
case historyitem_AutoShapes_Layout_Set_Y:
|
||||
this.y = data.oldValue;
|
||||
break;
|
||||
}
|
||||
},
|
||||
Redo: function (type, data) {
|
||||
switch (type) {
|
||||
case historyitem_AutoShapes_Layout_Set_X_Mode:
|
||||
this.xMode = data.newValue;
|
||||
break;
|
||||
case historyitem_AutoShapes_Layout_Set_Y_Mode:
|
||||
this.yMode = data.newValue;
|
||||
break;
|
||||
case historyitem_AutoShapes_Layout_Set_X:
|
||||
this.x = data.newValue;
|
||||
break;
|
||||
case historyitem_AutoShapes_Layout_Set_Y:
|
||||
this.y = data.newValue;
|
||||
break;
|
||||
}
|
||||
},
|
||||
writeToBinary: function (w) {
|
||||
w.WriteBool(isRealNumber(this.layoutTarget));
|
||||
if (isRealNumber(this.layoutTarget)) {
|
||||
w.WriteLong(this.layoutTarget);
|
||||
}
|
||||
w.WriteBool(isRealNumber(this.xMode));
|
||||
if (isRealNumber(this.xMode)) {
|
||||
w.WriteLong(this.xMode);
|
||||
}
|
||||
w.WriteBool(isRealNumber(this.yMode));
|
||||
if (isRealNumber(this.yMode)) {
|
||||
w.WriteLong(this.yMode);
|
||||
}
|
||||
w.WriteBool(isRealNumber(this.wMode));
|
||||
if (isRealNumber(this.wMode)) {
|
||||
w.WriteLong(this.wMode);
|
||||
}
|
||||
w.WriteBool(isRealNumber(this.hMode));
|
||||
if (isRealNumber(this.hMode)) {
|
||||
w.WriteLong(this.hMode);
|
||||
}
|
||||
w.WriteBool(isRealNumber(this.x));
|
||||
if (isRealNumber(this.x)) {
|
||||
w.WriteDouble(this.x);
|
||||
}
|
||||
w.WriteBool(isRealNumber(this.y));
|
||||
if (isRealNumber(this.y)) {
|
||||
w.WriteDouble(this.y);
|
||||
}
|
||||
w.WriteBool(isRealNumber(this.w));
|
||||
if (isRealNumber(this.w)) {
|
||||
w.WriteDouble(this.w);
|
||||
}
|
||||
w.WriteBool(isRealNumber(this.h));
|
||||
if (isRealNumber(this.h)) {
|
||||
w.WriteDouble(this.h);
|
||||
}
|
||||
},
|
||||
readFromBinary: function (r) {
|
||||
if (r.GetBool()) {
|
||||
this.layoutTarget = r.GetLong();
|
||||
}
|
||||
if (r.GetBool()) {
|
||||
this.setXMode(r.GetLong());
|
||||
}
|
||||
if (r.GetBool()) {
|
||||
this.setYMode(r.GetLong());
|
||||
}
|
||||
if (r.GetBool()) {
|
||||
this.wMode = r.GetLong();
|
||||
}
|
||||
if (r.GetBool()) {
|
||||
this.hMode = r.GetLong();
|
||||
}
|
||||
if (r.GetBool()) {
|
||||
this.setX(r.GetDouble());
|
||||
}
|
||||
if (r.GetBool()) {
|
||||
this.setY(r.GetDouble());
|
||||
}
|
||||
if (r.GetBool()) {
|
||||
this.w = r.GetDouble();
|
||||
}
|
||||
if (r.GetBool()) {
|
||||
this.h = r.GetDouble();
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,238 +0,0 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
var LEGEND_ELEMENT_TYPE_RECT = 0;
|
||||
var LEGEND_ELEMENT_TYPE_LINE = 1;
|
||||
function CLegendEntry() {
|
||||
this.bDelete = null;
|
||||
this.idx = null;
|
||||
this.txPr = null;
|
||||
this.Id = g_oIdCounter.Get_NewId();
|
||||
g_oTableId.Add(this, this.Id);
|
||||
}
|
||||
CLegendEntry.prototype = {
|
||||
Get_Id: function () {
|
||||
return this.Id;
|
||||
},
|
||||
getObjectType: function () {
|
||||
return CLASS_TYPE_LEGEND_ENTRY;
|
||||
}
|
||||
};
|
||||
function CChartLegend() {
|
||||
this.chartGroup = null;
|
||||
this.layout = null;
|
||||
this.legendEntries = [];
|
||||
this.legendPos = null;
|
||||
this.overlay = false;
|
||||
this.spPr = new CSpPr();
|
||||
this.txPr = null;
|
||||
this.x = null;
|
||||
this.y = null;
|
||||
this.extX = null;
|
||||
this.extY = null;
|
||||
this.calculatedEntry = [];
|
||||
this.Id = g_oIdCounter.Get_NewId();
|
||||
g_oTableId.Add(this, this.Id);
|
||||
}
|
||||
CChartLegend.prototype = {
|
||||
getObjectType: function () {
|
||||
return CLASS_TYPE_CHART_LEGEND;
|
||||
},
|
||||
Get_Id: function () {
|
||||
return this.Id;
|
||||
},
|
||||
getStyles: function (level) {
|
||||
var styles = new CStyles();
|
||||
var default_legend_style = new CStyle("defaultLegendStyle", styles.Default, null, styletype_Paragraph);
|
||||
default_legend_style.TextPr.FontSize = 10;
|
||||
default_legend_style.TextPr.themeFont = "Calibri";
|
||||
var tx_pr;
|
||||
if (isRealObject(this.txPr)) {}
|
||||
styles.Style[styles.Id] = default_legend_style;
|
||||
++styles.Id;
|
||||
return styles;
|
||||
},
|
||||
init: function () {
|
||||
this.setStartValues();
|
||||
return;
|
||||
var chart = this.chartGroup.chart;
|
||||
var chart_legend = chart.getLegendInfo();
|
||||
if (chart_legend.length > 0) {
|
||||
var shape_type = chart_legend[0].marker === c_oAscLegendMarkerType.Line ? "line" : "rect";
|
||||
for (var i = 0; i < chart_legend.length; ++i) {
|
||||
var legend_entry_obj = chart_legend[i];
|
||||
var entry_string = legend_entry_obj.text;
|
||||
var cur_legend_entry = new CLegendEntryGroup(this);
|
||||
cur_legend_entry.marker = chart_legend[0].marker;
|
||||
cur_legend_entry.drawingObjects = this.chartGroup.drawingObjects;
|
||||
cur_legend_entry.textBody = new CTextBody(cur_legend_entry);
|
||||
cur_legend_entry.idx = i;
|
||||
for (var key in entry_string) {
|
||||
cur_legend_entry.textBody.paragraphAdd(new ParaText(entry_string[key]), false);
|
||||
}
|
||||
cur_legend_entry.textBody.content.Reset(0, 0, 30, 30);
|
||||
cur_legend_entry.textBody.content.Recalculate_Page(0, true);
|
||||
cur_legend_entry.geometry = CreateGeometry(shape_type);
|
||||
cur_legend_entry.geometry.Init(5, 5);
|
||||
cur_legend_entry.brush = new CUniFill();
|
||||
cur_legend_entry.brush.fill = new CSolidFill();
|
||||
cur_legend_entry.brush.fill.color.color = new CRGBColor();
|
||||
cur_legend_entry.brush.fill.color.color.RGBA = {
|
||||
R: legend_entry_obj.color.R,
|
||||
G: legend_entry_obj.color.G,
|
||||
B: legend_entry_obj.color.B,
|
||||
A: 255
|
||||
};
|
||||
}
|
||||
}
|
||||
},
|
||||
draw: function (graphics) {
|
||||
for (var i = 0; i < this.calculatedEntry.length; ++i) {
|
||||
this.calculatedEntry[i].draw(graphics);
|
||||
}
|
||||
},
|
||||
setStartValues: function () {
|
||||
var is_on_history = History.Is_On();
|
||||
var is_on_table_id = !g_oTableId.m_bTurnOff;
|
||||
if (is_on_history) {
|
||||
History.TurnOff();
|
||||
}
|
||||
if (is_on_table_id) {
|
||||
g_oTableId.m_bTurnOff = true;
|
||||
}
|
||||
g_oTableId.m_bTurnOff = true;
|
||||
var chart = this.chartGroup.chart;
|
||||
var legend_info = chart.getLegendInfo();
|
||||
this.calculatedEntry.length = 0;
|
||||
if (legend_info.length > 0) {
|
||||
var bullet_type = legend_info[0].marker === c_oAscLegendMarkerType.Line ? "line" : "rect";
|
||||
for (var i = 0; i < legend_info.length; ++i) {
|
||||
var cur_legend_info = legend_info[i];
|
||||
var legend_entry = this.legendEntries[i];
|
||||
if (isRealObject(legend_entry) && legend_entry.bDelete === true) {
|
||||
continue;
|
||||
}
|
||||
var entry = new CLegendEntryGroup(this);
|
||||
entry.bullet = new CShape(null, this.chartGroup.drawingObjects, legend_entry);
|
||||
var uni_fill = new CUniFill();
|
||||
uni_fill.setFill(new CSolidFill());
|
||||
uni_fill.fill.setColor(new CUniColor());
|
||||
uni_fill.fill.color.setColor(new CRGBColor());
|
||||
uni_fill.fill.color.setColor(cur_legend_info.color.R * 256 * 256 + cur_legend_info.color.G * 256 + cur_legend_info.color.B);
|
||||
if (bullet_type === "line") {
|
||||
entry.bullet.setPresetGeometry("line");
|
||||
entry.bullet.setUniFill(uni_fill);
|
||||
} else {
|
||||
entry.bullet.setPresetGeometry("rect");
|
||||
var shape_fill = new CUniFill();
|
||||
shape_fill.setFill(new CNoFill());
|
||||
var shape_line = new CLn();
|
||||
var line_fill = new CUniFill();
|
||||
line_fill.setFill(new CNoFill());
|
||||
shape_line.setFill(line_fill);
|
||||
entry.bullet.setUniFill(shape_fill);
|
||||
entry.bullet.setUniLine(shape_line);
|
||||
entry.bullet.addTextBody(new CTextBody(entry.bullet));
|
||||
entry.bullet.paragraphAdd(new ParaTextPr({
|
||||
unifill: uni_fill
|
||||
}));
|
||||
entry.bullet.paragraphAdd(new ParaText(String.fromCharCode(167)));
|
||||
}
|
||||
entry.title = new CShape(null, this.chartGroup.drawingObjects);
|
||||
entry.title.addTextBody(new CTextBody(entry.title));
|
||||
for (var i in cur_legend_info.text) {
|
||||
entry.title.paragraphAdd(new ParaText(cur_legend_info.text[i]));
|
||||
}
|
||||
this.calculatedEntry.push(entry);
|
||||
}
|
||||
}
|
||||
if (is_on_history) {
|
||||
History.TurnOn();
|
||||
}
|
||||
if (is_on_table_id) {
|
||||
g_oTableId.m_bTurnOff = false;
|
||||
}
|
||||
},
|
||||
setChartGroup: function (chartGroup) {
|
||||
this.chartGroup = chartGroup;
|
||||
},
|
||||
recalculateInternalPositionsAndExtents: function () {
|
||||
this.extX = null;
|
||||
this.extY = null;
|
||||
if (isRealObject(this.layout) && isRealNumber(this.layout.w) && isRealNumber(this.layout.h)) {
|
||||
this.extX = this.chartGroup.extX * this.layout.w;
|
||||
this.extY = this.chartGroup.extY * this.layout.h;
|
||||
} else {
|
||||
switch (this.legendPos) {
|
||||
case c_oAscChartLegend.right:
|
||||
case c_oAscChartLegend.left:
|
||||
for (var i = 0; i < this.calculatedEntry.length; ++i) {
|
||||
var cur_legend_entry = this.calculatedEntry[i];
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
recalculateWithoutLayout: function () {}
|
||||
};
|
||||
function CLegendEntryGroup(legend) {
|
||||
this.legend = legend;
|
||||
this.bullet = null;
|
||||
this.title = null;
|
||||
}
|
||||
CLegendEntryGroup.prototype = {
|
||||
setLegendGroup: function (legendGroup) {},
|
||||
getStyles: function () {
|
||||
var styles = new CStyles();
|
||||
var default_style = new CStyle("defaultEntryStyle", null, null, styletype_Paragraph);
|
||||
default_style.TextPr.themeFont = "Calibri";
|
||||
default_style.TextPr.FontSize = 10;
|
||||
styles.Style[styles.Id] = default_style;
|
||||
++styles.Id;
|
||||
var legend_style = new CStyle("legend_style", styles.Id - 1, null, styletype_Paragraph);
|
||||
styles.Style[styles.Id] = legend_style;
|
||||
++styles.Id;
|
||||
var entry_style = new CStyle("entry_style", styles.Id - 1, null, styletype_Paragraph);
|
||||
if (isRealObject(this.legendGroup.legendEntries[this.idx]) && isRealObject(this.legendGroup.legendEntries[this.idx].txPr)) {}
|
||||
styles.Style[styles.Id] = entry_style;
|
||||
++styles.Id;
|
||||
return styles;
|
||||
},
|
||||
getBulletStyles: function () {},
|
||||
getTitleStyles: function () {},
|
||||
recalculateInternalPosition: function () {},
|
||||
draw: function (graphics) {
|
||||
if (isRealObject(this.bullet) && isRealObject(this.title)) {
|
||||
this.bullet.draw(graphics);
|
||||
this.title.draw(graphics);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,407 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2015
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
"use strict";
|
||||
function getChartTranslateManager() {
|
||||
return window["Asc"]["editor"].chartTranslate;
|
||||
}
|
||||
CChartSpace.prototype.addToDrawingObjects = CShape.prototype.addToDrawingObjects;
|
||||
CChartSpace.prototype.setDrawingObjects = CShape.prototype.setDrawingObjects;
|
||||
CChartSpace.prototype.setDrawingBase = CShape.prototype.setDrawingBase;
|
||||
CChartSpace.prototype.deleteDrawingBase = CShape.prototype.deleteDrawingBase;
|
||||
CChartSpace.prototype.getDrawingObjectsController = CShape.prototype.getDrawingObjectsController;
|
||||
CChartSpace.prototype.recalculateTransform = function () {
|
||||
CShape.prototype.recalculateTransform.call(this);
|
||||
this.localTransform.Reset();
|
||||
};
|
||||
CChartSpace.prototype.recalcText = function () {
|
||||
this.recalcInfo.recalculateAxisLabels = true;
|
||||
this.recalcTitles2();
|
||||
this.handleUpdateInternalChart();
|
||||
};
|
||||
CChartSpace.prototype.recalculateBounds = CShape.prototype.recalculateBounds;
|
||||
CChartSpace.prototype.deselect = CShape.prototype.deselect;
|
||||
CChartSpace.prototype.hitToHandles = CShape.prototype.hitToHandles;
|
||||
CChartSpace.prototype.hitInBoundingRect = CShape.prototype.hitInBoundingRect;
|
||||
CChartSpace.prototype.getRotateAngle = CShape.prototype.getRotateAngle;
|
||||
CChartSpace.prototype.getInvertTransform = CShape.prototype.getInvertTransform;
|
||||
CChartSpace.prototype.hit = CShape.prototype.hit;
|
||||
CChartSpace.prototype.hitInInnerArea = CShape.prototype.hitInInnerArea;
|
||||
CChartSpace.prototype.hitInPath = CShape.prototype.hitInPath;
|
||||
CChartSpace.prototype.hitInTextRect = CShape.prototype.hitInTextRect;
|
||||
CChartSpace.prototype.getNumByCardDirection = CShape.prototype.getNumByCardDirection;
|
||||
CChartSpace.prototype.getCardDirectionByNum = CShape.prototype.getCardDirectionByNum;
|
||||
CChartSpace.prototype.getResizeCoefficients = CShape.prototype.getResizeCoefficients;
|
||||
CChartSpace.prototype.check_bounds = CShape.prototype.check_bounds;
|
||||
CChartSpace.prototype.normalize = CShape.prototype.normalize;
|
||||
CChartSpace.prototype.getFullFlipH = CShape.prototype.getFullFlipH;
|
||||
CChartSpace.prototype.getFullFlipV = CShape.prototype.getFullFlipV;
|
||||
CChartSpace.prototype.setWorksheet = CShape.prototype.setWorksheet;
|
||||
CChartSpace.prototype.handleUpdateLn = function () {
|
||||
this.recalcInfo.recalculatePenBrush = true;
|
||||
this.addToRecalculate();
|
||||
};
|
||||
CChartSpace.prototype.setRecalculateInfo = function () {
|
||||
this.recalcInfo = {
|
||||
recalcTitle: null,
|
||||
bRecalculatedTitle: false,
|
||||
recalculateTransform: true,
|
||||
recalculateBounds: true,
|
||||
recalculateChart: true,
|
||||
recalculateBaseColors: true,
|
||||
recalculateSeriesColors: true,
|
||||
recalculateMarkers: true,
|
||||
recalculateGridLines: true,
|
||||
recalculateDLbls: true,
|
||||
recalculateAxisLabels: true,
|
||||
dataLbls: [],
|
||||
axisLabels: [],
|
||||
recalculateAxisVal: true,
|
||||
recalculateAxisTickMark: true,
|
||||
recalculateBrush: true,
|
||||
recalculatePen: true,
|
||||
recalculatePlotAreaBrush: true,
|
||||
recalculatePlotAreaPen: true,
|
||||
recalculateHiLowLines: true,
|
||||
recalculateUpDownBars: true,
|
||||
recalculateLegend: true,
|
||||
recalculateReferences: true,
|
||||
recalculateBBox: true,
|
||||
recalculateFormulas: true,
|
||||
recalculatePenBrush: true,
|
||||
recalculateTextPr: true,
|
||||
recalculateBBoxRange: true
|
||||
};
|
||||
this.baseColors = [];
|
||||
this.bounds = {
|
||||
l: 0,
|
||||
t: 0,
|
||||
r: 0,
|
||||
b: 0,
|
||||
w: 0,
|
||||
h: 0
|
||||
};
|
||||
this.chartObj = null;
|
||||
this.rectGeometry = ExecuteNoHistory(function () {
|
||||
return CreateGeometry("rect");
|
||||
},
|
||||
this, []);
|
||||
this.lockType = c_oAscLockTypes.kLockTypeNone;
|
||||
};
|
||||
CChartSpace.prototype.recalcTransform = function () {
|
||||
this.recalcInfo.recalculateTransform = true;
|
||||
};
|
||||
CChartSpace.prototype.recalcBounds = function () {
|
||||
this.recalcInfo.recalculateBounds = true;
|
||||
};
|
||||
CChartSpace.prototype.recalcChart = function () {
|
||||
this.recalcInfo.recalculateChart = true;
|
||||
};
|
||||
CChartSpace.prototype.recalcBaseColors = function () {
|
||||
this.recalcInfo.recalculateBaseColors = true;
|
||||
};
|
||||
CChartSpace.prototype.recalcSeriesColors = function () {
|
||||
this.recalcInfo.recalculateSeriesColors = true;
|
||||
};
|
||||
CChartSpace.prototype.recalcDLbls = function () {
|
||||
this.recalcInfo.recalculateDLbls = true;
|
||||
};
|
||||
CChartSpace.prototype.addToRecalculate = CShape.prototype.addToRecalculate;
|
||||
CChartSpace.prototype.handleUpdatePosition = function () {
|
||||
this.recalcTransform();
|
||||
this.recalcBounds();
|
||||
this.addToRecalculate();
|
||||
delete this.fromSerialize;
|
||||
};
|
||||
CChartSpace.prototype.handleUpdateExtents = function () {
|
||||
this.recalcChart();
|
||||
this.recalcBounds();
|
||||
this.recalcTransform();
|
||||
this.recalcTitles();
|
||||
this.handleUpdateInternalChart();
|
||||
delete this.fromSerialize;
|
||||
};
|
||||
CChartSpace.prototype.handleUpdateFlip = function () {
|
||||
this.recalcTransform();
|
||||
this.addToRecalculate();
|
||||
delete this.fromSerialize;
|
||||
};
|
||||
CChartSpace.prototype.handleUpdateChart = function () {
|
||||
this.recalcChart();
|
||||
this.setRecalculateInfo();
|
||||
this.addToRecalculate();
|
||||
};
|
||||
CChartSpace.prototype.handleUpdateStyle = function () {
|
||||
this.recalcInfo.recalculateSeriesColors = true;
|
||||
this.recalcInfo.recalculateLegend = true;
|
||||
this.recalcInfo.recalculatePlotAreaBrush = true;
|
||||
this.recalcInfo.recalculatePlotAreaPen = true;
|
||||
this.recalcInfo.recalculateBrush = true;
|
||||
this.recalcInfo.recalculatePen = true;
|
||||
this.recalcInfo.recalculateHiLowLines = true;
|
||||
this.recalcInfo.recalculateUpDownBars = true;
|
||||
this.handleTitlesAfterChangeTheme();
|
||||
this.recalcInfo.recalculateAxisLabels = true;
|
||||
this.recalcInfo.recalculateAxisVal = true;
|
||||
this.addToRecalculate();
|
||||
};
|
||||
CChartSpace.prototype.handleUpdateFill = function () {
|
||||
this.recalcInfo.recalculatePenBrush = true;
|
||||
this.recalcInfo.recalculateBrush = true;
|
||||
this.recalcInfo.recalculateChart = true;
|
||||
this.addToRecalculate();
|
||||
};
|
||||
CChartSpace.prototype.handleUpdateLn = function () {
|
||||
this.recalcInfo.recalculatePenBrush = true;
|
||||
this.recalcInfo.recalculatePen = true;
|
||||
this.recalcInfo.recalculateChart = true;
|
||||
this.addToRecalculate();
|
||||
};
|
||||
CChartSpace.prototype.canGroup = CShape.prototype.canGroup;
|
||||
CChartSpace.prototype.convertPixToMM = CShape.prototype.convertPixToMM;
|
||||
CChartSpace.prototype.getCanvasContext = CShape.prototype.getCanvasContext;
|
||||
CChartSpace.prototype.getHierarchy = CShape.prototype.getHierarchy;
|
||||
CChartSpace.prototype.getParentObjects = function () {
|
||||
var parents = {
|
||||
slide: null,
|
||||
layout: null,
|
||||
master: null,
|
||||
theme: window["Asc"]["editor"].wbModel.theme
|
||||
};
|
||||
if (this.clrMapOvr) {
|
||||
parents.slide = {
|
||||
clrMap: this.clrMapOvr
|
||||
};
|
||||
}
|
||||
return parents;
|
||||
};
|
||||
CChartSpace.prototype.recalculateTransform = CShape.prototype.recalculateTransform;
|
||||
CChartSpace.prototype.recalculateChart = function () {
|
||||
if (this.chartObj == null) {
|
||||
this.chartObj = new CChartsDrawer();
|
||||
}
|
||||
this.chartObj.reCalculate(this);
|
||||
};
|
||||
CChartSpace.prototype.canResize = CShape.prototype.canResize;
|
||||
CChartSpace.prototype.canMove = CShape.prototype.canMove;
|
||||
CChartSpace.prototype.canRotate = function () {
|
||||
return false;
|
||||
};
|
||||
CChartSpace.prototype.createResizeTrack = CShape.prototype.createResizeTrack;
|
||||
CChartSpace.prototype.createMoveTrack = CShape.prototype.createMoveTrack;
|
||||
CChartSpace.prototype.getAspect = CShape.prototype.getAspect;
|
||||
CChartSpace.prototype.getRectBounds = CShape.prototype.getRectBounds;
|
||||
CChartSpace.prototype.recalculateBounds = function () {
|
||||
var transform = this.transform;
|
||||
var a_x = [];
|
||||
var a_y = [];
|
||||
a_x.push(transform.TransformPointX(0, 0));
|
||||
a_y.push(transform.TransformPointY(0, 0));
|
||||
a_x.push(transform.TransformPointX(this.extX, 0));
|
||||
a_y.push(transform.TransformPointY(this.extX, 0));
|
||||
a_x.push(transform.TransformPointX(this.extX, this.extY));
|
||||
a_y.push(transform.TransformPointY(this.extX, this.extY));
|
||||
a_x.push(transform.TransformPointX(0, this.extY));
|
||||
a_y.push(transform.TransformPointY(0, this.extY));
|
||||
this.bounds.l = Math.min.apply(Math, a_x);
|
||||
this.bounds.t = Math.min.apply(Math, a_y);
|
||||
this.bounds.r = Math.max.apply(Math, a_x);
|
||||
this.bounds.b = Math.max.apply(Math, a_y);
|
||||
this.bounds.w = this.bounds.r - this.bounds.l;
|
||||
this.bounds.h = this.bounds.b - this.bounds.t;
|
||||
this.bounds.x = this.bounds.l;
|
||||
this.bounds.y = this.bounds.t;
|
||||
if (this.drawingBase && !this.group) {
|
||||
this.drawingBase.checkBoundsFromTo();
|
||||
}
|
||||
};
|
||||
CChartSpace.prototype.recalculate = function () {
|
||||
if (this.bDeleted) {
|
||||
return;
|
||||
}
|
||||
ExecuteNoHistory(function () {
|
||||
this.updateLinks();
|
||||
if (this.recalcInfo.recalcTitle) {
|
||||
this.recalculateChartTitleEditMode();
|
||||
this.recalcInfo.recalcTitle.updatePosition(this.transform.tx, this.transform.ty);
|
||||
this.recalcInfo.recalcTitle = null;
|
||||
this.recalcInfo.bRecalculatedTitle = true;
|
||||
}
|
||||
var b_transform = false;
|
||||
if (this.recalcInfo.recalculateTransform) {
|
||||
this.recalculateTransform();
|
||||
this.calculateSnapArrays();
|
||||
this.rectGeometry.Recalculate(this.extX, this.extY);
|
||||
this.recalcInfo.recalculateTransform = false;
|
||||
b_transform = true;
|
||||
}
|
||||
if (this.recalcInfo.recalculateReferences) {
|
||||
this.recalculateReferences();
|
||||
this.recalcInfo.recalculateReferences = false;
|
||||
}
|
||||
if (this.recalcInfo.recalculateBBox) {
|
||||
this.recalculateBBox();
|
||||
this.recalcInfo.recalculateBBox = false;
|
||||
}
|
||||
if (this.recalcInfo.recalculateBaseColors) {
|
||||
this.recalculateBaseColors();
|
||||
this.recalcInfo.recalculateBaseColors = false;
|
||||
}
|
||||
if (this.recalcInfo.recalculateMarkers) {
|
||||
this.recalculateMarkers();
|
||||
this.recalcInfo.recalculateMarkers = false;
|
||||
}
|
||||
if (this.recalcInfo.recalculateSeriesColors) {
|
||||
this.recalculateSeriesColors();
|
||||
this.recalcInfo.recalculateSeriesColors = false;
|
||||
}
|
||||
if (this.recalcInfo.recalculateGridLines) {
|
||||
this.recalculateGridLines();
|
||||
this.recalcInfo.recalculateGridLines = false;
|
||||
}
|
||||
if (this.recalcInfo.recalculateAxisTickMark) {
|
||||
this.recalculateAxisTickMark();
|
||||
this.recalcInfo.recalculateAxisTickMark = false;
|
||||
}
|
||||
if (this.recalcInfo.recalculateDLbls) {
|
||||
this.recalculateDLbls();
|
||||
this.recalcInfo.recalculateDLbls = false;
|
||||
}
|
||||
if (this.recalcInfo.recalculateBrush) {
|
||||
this.recalculateChartBrush();
|
||||
this.recalcInfo.recalculateBrush = false;
|
||||
}
|
||||
if (this.recalcInfo.recalculatePen) {
|
||||
this.recalculateChartPen();
|
||||
this.recalcInfo.recalculatePen = false;
|
||||
}
|
||||
if (this.recalcInfo.recalculateHiLowLines) {
|
||||
this.recalculateHiLowLines();
|
||||
this.recalcInfo.recalculateHiLowLines = false;
|
||||
}
|
||||
if (this.recalcInfo.recalculatePlotAreaBrush) {
|
||||
this.recalculatePlotAreaChartBrush();
|
||||
this.recalcInfo.recalculatePlotAreaBrush = false;
|
||||
}
|
||||
if (this.recalcInfo.recalculatePlotAreaPen) {
|
||||
this.recalculatePlotAreaChartPen();
|
||||
this.recalcInfo.recalculatePlotAreaPen = false;
|
||||
}
|
||||
if (this.recalcInfo.recalculateUpDownBars) {
|
||||
this.recalculateUpDownBars();
|
||||
this.recalcInfo.recalculateUpDownBars = false;
|
||||
}
|
||||
var b_recalc_legend = false;
|
||||
if (this.recalcInfo.recalculateLegend) {
|
||||
this.recalculateLegend();
|
||||
this.recalcInfo.recalculateLegend = false;
|
||||
b_recalc_legend = true;
|
||||
}
|
||||
var b_recalc_labels = false;
|
||||
if (this.recalcInfo.recalculateAxisLabels) {
|
||||
this.recalculateAxisLabels();
|
||||
this.recalcInfo.recalculateAxisLabels = false;
|
||||
b_recalc_labels = true;
|
||||
}
|
||||
if (this.recalcInfo.recalculateAxisVal) {
|
||||
this.recalculateAxis();
|
||||
this.recalcInfo.recalculateAxisVal = false;
|
||||
}
|
||||
if (this.recalcInfo.recalculatePenBrush) {
|
||||
this.recalculatePenBrush();
|
||||
this.recalcInfo.recalculatePenBrush = false;
|
||||
}
|
||||
if (this.recalcInfo.recalculateChart) {
|
||||
this.recalculateChart();
|
||||
this.recalcInfo.recalculateChart = false;
|
||||
}
|
||||
for (var i = 0; i < this.recalcInfo.dataLbls.length; ++i) {
|
||||
var series = this.chart.plotArea.chart.series;
|
||||
if (this.recalcInfo.dataLbls[i].series && this.recalcInfo.dataLbls[i].pt) {
|
||||
var ser_idx = this.recalcInfo.dataLbls[i].series.idx;
|
||||
for (var j = 0; j < series.length; ++j) {
|
||||
if (series[j].idx === this.recalcInfo.dataLbls[i].series.idx) {
|
||||
var pos = this.chartObj.reCalculatePositionText("dlbl", this, j, this.recalcInfo.dataLbls[i].pt.idx);
|
||||
this.recalcInfo.dataLbls[i].setPosition(pos.x, pos.y);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.recalcInfo.dataLbls.length = 0;
|
||||
if (b_recalc_labels) {
|
||||
if (this.chart && this.chart.title) {
|
||||
var pos = this.chartObj.reCalculatePositionText("title", this, this.chart.title);
|
||||
this.chart.title.setPosition(pos.x, pos.y);
|
||||
}
|
||||
if (this.chart && this.chart.plotArea && this.chart.plotArea) {
|
||||
var hor_axis = this.chart.plotArea.getHorizontalAxis();
|
||||
if (hor_axis && hor_axis.title) {
|
||||
var old_cat_ax = this.chart.plotArea.catAx;
|
||||
this.chart.plotArea.catAx = hor_axis;
|
||||
var pos = this.chartObj.reCalculatePositionText("catAx", this, hor_axis.title);
|
||||
hor_axis.title.setPosition(pos.x, pos.y);
|
||||
this.chart.plotArea.catAx = old_cat_ax;
|
||||
}
|
||||
var vert_axis = this.chart.plotArea.getVerticalAxis();
|
||||
if (vert_axis && vert_axis.title) {
|
||||
var old_val_ax = this.chart.plotArea.valAx;
|
||||
this.chart.plotArea.valAx = vert_axis;
|
||||
var pos = this.chartObj.reCalculatePositionText("valAx", this, vert_axis.title);
|
||||
vert_axis.title.setPosition(pos.x, pos.y);
|
||||
this.chart.plotArea.valAx = old_val_ax;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (b_recalc_legend && this.chart && this.chart.legend) {
|
||||
var pos = this.chartObj.reCalculatePositionText("legend", this, this.chart.legend);
|
||||
this.chart.legend.setPosition(pos.x, pos.y);
|
||||
}
|
||||
if (this.recalcInfo.recalculateBounds) {
|
||||
this.recalculateBounds();
|
||||
this.recalcInfo.recalculateBounds = false;
|
||||
}
|
||||
if (this.recalcInfo.recalculateTextPr) {
|
||||
this.recalculateTextPr();
|
||||
this.recalcInfo.recalculateTextPr = false;
|
||||
}
|
||||
this.updateChildLabelsTransform(this.transform.tx, this.transform.ty);
|
||||
this.recalcInfo.dataLbls.length = 0;
|
||||
this.recalcInfo.axisLabels.length = 0;
|
||||
this.bNeedUpdatePosition = true;
|
||||
},
|
||||
this, []);
|
||||
};
|
||||
CChartSpace.prototype.deselect = CShape.prototype.deselect;
|
||||
CChartSpace.prototype.getDrawingDocument = CShape.prototype.getDrawingDocument;
|
||||
CChartSpace.prototype.recalculateLocalTransform = CShape.prototype.recalculateLocalTransform;
|
||||
CChartSpace.prototype.Get_Theme = CShape.prototype.Get_Theme;
|
||||
CChartSpace.prototype.Get_ColorMap = CShape.prototype.Get_ColorMap;
|
||||
@@ -1,977 +0,0 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
var CHART_TITLE_TYPE_TITLE = 0;
|
||||
var CHART_TITLE_TYPE_H_AXIS = 1;
|
||||
var CHART_TITLE_TYPE_V_AXIS = 2;
|
||||
var paraDrawing;
|
||||
function CChartTitle(chartGroup, type) {
|
||||
this.layout = null;
|
||||
this.overlay = false;
|
||||
this.spPr = new CSpPr();
|
||||
this.txPr = null;
|
||||
this.isDefaultText = false;
|
||||
this.txBody = null;
|
||||
this.x = null;
|
||||
this.y = null;
|
||||
this.extX = null;
|
||||
this.extY = null;
|
||||
this.brush = null;
|
||||
this.pen = null;
|
||||
this.spPr.geometry = CreateGeometry("rect");
|
||||
this.spPr.geometry.Init(5, 5);
|
||||
this.invertTransform = new CMatrix();
|
||||
this.invertTransformText = new CMatrix();
|
||||
this.transform = new CMatrix();
|
||||
this.transformText = new CMatrix();
|
||||
this.recalculateInfo = {
|
||||
recalculateTransform: true,
|
||||
recalculateBrush: true,
|
||||
recalculatePen: true
|
||||
};
|
||||
this.selected = false;
|
||||
this.Id = g_oIdCounter.Get_NewId();
|
||||
g_oTableId.Add(this, this.Id);
|
||||
if (chartGroup) {
|
||||
this.setChartGroup(chartGroup);
|
||||
}
|
||||
if (isRealNumber(type)) {
|
||||
this.setType(type);
|
||||
}
|
||||
}
|
||||
CChartTitle.prototype = {
|
||||
getObjectType: function () {
|
||||
return CLASS_TYPE_CHART_TITLE;
|
||||
},
|
||||
Get_Id: function () {
|
||||
return this.Id;
|
||||
},
|
||||
getTitleType: function () {
|
||||
if (this === this.chartGroup.chartTitle) {
|
||||
return CHART_TITLE_TYPE_TITLE;
|
||||
}
|
||||
if (this === this.chartGroup.hAxisTitle) {
|
||||
return CHART_TITLE_TYPE_H_AXIS;
|
||||
}
|
||||
if (this === this.chartGroup.vAxisTitle) {
|
||||
return CHART_TITLE_TYPE_V_AXIS;
|
||||
}
|
||||
},
|
||||
setBodyPr: function (bodyPr) {
|
||||
if (isRealObject(this.txBody)) {
|
||||
this.txBody.bodyPr = bodyPr;
|
||||
}
|
||||
},
|
||||
isEmpty: function () {
|
||||
return isRealObject(this.txBody) ? this.txBody.isEmpty() : true;
|
||||
},
|
||||
setType: function (type) {
|
||||
var oldValue = this.type;
|
||||
var newValue = type;
|
||||
this.type = type;
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_SetChartTitleType, null, null, new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(oldValue, newValue)));
|
||||
},
|
||||
Get_Styles: function () {
|
||||
return new CStyles();
|
||||
},
|
||||
select: function () {
|
||||
this.selected = true;
|
||||
},
|
||||
deselect: function () {
|
||||
this.selected = false;
|
||||
if (isRealObject(this.txBody) && isRealObject(this.txBody.content)) {
|
||||
this.txBody.content.Selection_Remove();
|
||||
}
|
||||
},
|
||||
getParagraphParaPr: function () {
|
||||
if (this.txBody) {
|
||||
return this.txBody.content.Get_Paragraph_ParaPr();
|
||||
}
|
||||
return null;
|
||||
},
|
||||
getParagraphTextPr: function () {
|
||||
if (this.txBody) {
|
||||
return this.txBody.content.Get_Paragraph_TextPr();
|
||||
}
|
||||
return null;
|
||||
},
|
||||
getAllParagraphParaPr: function () {
|
||||
if (this.txBody) {
|
||||
this.txBody.content.Set_ApplyToAll(true);
|
||||
var paraPr = this.txBody.content.Get_Paragraph_ParaPr();
|
||||
this.txBody.content.Set_ApplyToAll(false);
|
||||
return paraPr;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
getAllParagraphTextPr: function () {
|
||||
if (this.txBody) {
|
||||
this.txBody.content.Set_ApplyToAll(true);
|
||||
var paraPr = this.txBody.content.Get_Paragraph_TextPr();
|
||||
this.txBody.content.Set_ApplyToAll(false);
|
||||
return paraPr;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
increaseFontSize: function () {
|
||||
if (isRealObject(this.txBody)) {
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
this.txBody.content.Paragraph_IncDecFontSize(true);
|
||||
this.chartGroup.recalculate();
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
}
|
||||
},
|
||||
decreaseFontSize: function () {
|
||||
if (isRealObject(this.txBody)) {
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
this.txBody.content.Paragraph_IncDecFontSize(false);
|
||||
this.chartGroup.recalculate();
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
}
|
||||
},
|
||||
increaseAllFontSize: function () {
|
||||
if (isRealObject(this.txBody)) {
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
this.txBody.content.Set_ApplyToAll(true);
|
||||
this.txBody.content.Paragraph_IncDecFontSize(true);
|
||||
this.txBody.content.Set_ApplyToAll(false);
|
||||
this.chartGroup.recalculate();
|
||||
this.calculateTransformTextMatrix();
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
}
|
||||
},
|
||||
decreaseAllFontSize: function () {
|
||||
if (isRealObject(this.txBody)) {
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
this.txBody.content.Set_ApplyToAll(true);
|
||||
this.txBody.content.Paragraph_IncDecFontSize(false);
|
||||
this.txBody.content.Set_ApplyToAll(false);
|
||||
this.chartGroup.recalculate();
|
||||
this.calculateTransformTextMatrix();
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
}
|
||||
},
|
||||
setCellFontName: function (fontName) {
|
||||
if (isRealObject(this.txBody)) {
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
var text_pr = new ParaTextPr();
|
||||
text_pr.Set_FontFamily({
|
||||
Name: fontName,
|
||||
Index: -1
|
||||
});
|
||||
this.txBody.paragraphAdd(text_pr);
|
||||
this.chartGroup.recalculate();
|
||||
this.drawingObjects.showDrawingObjects();
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
}
|
||||
},
|
||||
setCellFontSize: function (fontSize) {
|
||||
if (isRealObject(this.txBody)) {
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
var text_pr = new ParaTextPr();
|
||||
text_pr.Set_FontSize(fontSize);
|
||||
this.txBody.paragraphAdd(text_pr);
|
||||
this.chartGroup.recalculate();
|
||||
this.drawingObjects.showDrawingObjects();
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
}
|
||||
},
|
||||
setCellBold: function (isBold) {
|
||||
if (isRealObject(this.txBody)) {
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
var text_pr = new ParaTextPr();
|
||||
text_pr.Set_Bold(isBold);
|
||||
this.txBody.paragraphAdd(text_pr);
|
||||
this.chartGroup.recalculate();
|
||||
this.drawingObjects.showDrawingObjects();
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
}
|
||||
},
|
||||
setCellItalic: function (isItalic) {
|
||||
if (isRealObject(this.txBody)) {
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
var text_pr = new ParaTextPr();
|
||||
text_pr.Set_Italic(isItalic);
|
||||
this.txBody.paragraphAdd(text_pr);
|
||||
this.chartGroup.recalculate();
|
||||
this.drawingObjects.showDrawingObjects();
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
}
|
||||
},
|
||||
setCellUnderline: function (isUnderline) {
|
||||
if (isRealObject(this.txBody)) {
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
var text_pr = new ParaTextPr();
|
||||
text_pr.Set_Underline(isUnderline);
|
||||
this.txBody.paragraphAdd(text_pr);
|
||||
this.chartGroup.recalculate();
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
}
|
||||
},
|
||||
setCellStrikeout: function (isStrikeout) {
|
||||
if (isRealObject(this.txBody)) {
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
var text_pr = new ParaTextPr();
|
||||
text_pr.Set_Strikeout(isStrikeout);
|
||||
this.txBody.paragraphAdd(text_pr);
|
||||
this.chartGroup.recalculate();
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
}
|
||||
},
|
||||
setCellTextColor: function (color) {
|
||||
if (isRealObject(this.txBody)) {
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
var unifill = new CUniFill();
|
||||
unifill.setFill(new CSolidFill());
|
||||
unifill.fill.setColor(CorrectUniColor2(color, null));
|
||||
var text_pr = new ParaTextPr();
|
||||
text_pr.SetUniFill(unifill);
|
||||
this.txBody.paragraphAdd(text_pr);
|
||||
this.chartGroup.recalculate();
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
}
|
||||
},
|
||||
setCellAllFontName: function (fontName) {
|
||||
if (isRealObject(this.txBody)) {
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
var text_pr = new ParaTextPr();
|
||||
text_pr.Set_FontFamily({
|
||||
Name: fontName,
|
||||
Index: -1
|
||||
});
|
||||
this.txBody.content.Set_ApplyToAll(true);
|
||||
this.txBody.paragraphAdd(text_pr);
|
||||
this.txBody.content.Set_ApplyToAll(false);
|
||||
this.chartGroup.recalculate();
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
}
|
||||
},
|
||||
setCellAllFontSize: function (fontSize) {
|
||||
if (isRealObject(this.txBody)) {
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
var text_pr = new ParaTextPr();
|
||||
text_pr.Set_FontSize(fontSize);
|
||||
this.txBody.content.Set_ApplyToAll(true);
|
||||
this.txBody.paragraphAdd(text_pr);
|
||||
this.txBody.content.Set_ApplyToAll(false);
|
||||
this.chartGroup.recalculate();
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
}
|
||||
},
|
||||
setCellAllBold: function (isBold) {
|
||||
if (isRealObject(this.txBody)) {
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
var text_pr = new ParaTextPr();
|
||||
text_pr.Set_Bold(isBold);
|
||||
this.txBody.content.Set_ApplyToAll(true);
|
||||
this.txBody.paragraphAdd(text_pr);
|
||||
this.txBody.content.Set_ApplyToAll(false);
|
||||
this.chartGroup.recalculate();
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
}
|
||||
},
|
||||
setCellAllItalic: function (isItalic) {
|
||||
if (isRealObject(this.txBody)) {
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
var text_pr = new ParaTextPr();
|
||||
text_pr.Set_Italic(isItalic);
|
||||
this.txBody.content.Set_ApplyToAll(true);
|
||||
this.txBody.paragraphAdd(text_pr);
|
||||
this.txBody.content.Set_ApplyToAll(false);
|
||||
this.chartGroup.recalculate();
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
}
|
||||
},
|
||||
setCellAllUnderline: function (isUnderline) {
|
||||
if (isRealObject(this.txBody)) {
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
var text_pr = new ParaTextPr();
|
||||
text_pr.Set_Underline(isUnderline);
|
||||
this.txBody.content.Set_ApplyToAll(true);
|
||||
this.txBody.paragraphAdd(text_pr);
|
||||
this.txBody.content.Set_ApplyToAll(false);
|
||||
this.chartGroup.recalculate();
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
}
|
||||
},
|
||||
setCellAllStrikeout: function (isStrikeout) {
|
||||
if (isRealObject(this.txBody)) {
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
var text_pr = new ParaTextPr();
|
||||
text_pr.Set_Strikeout(isStrikeout);
|
||||
this.txBody.content.Set_ApplyToAll(true);
|
||||
this.txBody.paragraphAdd(text_pr);
|
||||
this.txBody.content.Set_ApplyToAll(false);
|
||||
this.chartGroup.recalculate();
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
}
|
||||
},
|
||||
setCellAllSubscript: function (isSubscript) {
|
||||
if (isRealObject(this.txBody)) {
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
var text_pr = new ParaTextPr();
|
||||
text_pr.Set_VertAlign(isSubscript ? vertalign_SubScript : vertalign_Baseline);
|
||||
this.txBody.content.Set_ApplyToAll(true);
|
||||
this.txBody.paragraphAdd(text_pr);
|
||||
this.txBody.content.Set_ApplyToAll(false);
|
||||
this.chartGroup.recalculate();
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
}
|
||||
},
|
||||
setCellAllSuperscript: function (isSuperscript) {
|
||||
if (isRealObject(this.txBody)) {
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
var text_pr = new ParaTextPr();
|
||||
text_pr.Set_VertAlign(isSubscript ? vertalign_SuperScript : vertalign_Baseline);
|
||||
this.txBody.content.Set_ApplyToAll(true);
|
||||
this.txBody.paragraphAdd(text_pr);
|
||||
this.txBody.content.Set_ApplyToAll(false);
|
||||
this.chartGroup.recalculate();
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
}
|
||||
},
|
||||
setCellAllTextColor: function (color) {
|
||||
if (isRealObject(this.txBody)) {
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
var unifill = new CUniFill();
|
||||
unifill.setFill(new CSolidFill());
|
||||
unifill.fill.setColor(CorrectUniColor2(color, null));
|
||||
var text_pr = new ParaTextPr();
|
||||
text_pr.SetUniFill(unifill);
|
||||
this.txBody.content.Set_ApplyToAll(true);
|
||||
this.txBody.paragraphAdd(text_pr);
|
||||
this.txBody.content.Set_ApplyToAll(false);
|
||||
this.chartGroup.recalculate();
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
}
|
||||
},
|
||||
setChartGroup: function (chartGroup) {
|
||||
var old_value = this.chartGroup ? this.chartGroup.Get_Id() : null;
|
||||
var new_value = chartGroup ? chartGroup.Get_Id() : null;
|
||||
this.chartGroup = chartGroup;
|
||||
this.setDrawingObjects(chartGroup ? chartGroup.drawingObjects : null);
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_AddChartGroup, null, null, new UndoRedoDataGraphicObjects(this.Id, new UndoRedoDataGOSingleProp(old_value, new_value)), null);
|
||||
},
|
||||
setDrawingObjects: function (drawingObjects) {
|
||||
if (isRealObject(drawingObjects) && drawingObjects.getWorksheet()) {
|
||||
var newValue = drawingObjects.getWorksheet().model.getId();
|
||||
var oldValue = isRealObject(this.drawingObjects) ? this.drawingObjects.getWorksheet().model.getId() : null;
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_SetDrawingObjects, null, null, new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(oldValue, newValue)));
|
||||
this.drawingObjects = drawingObjects;
|
||||
}
|
||||
},
|
||||
Get_Id: function () {
|
||||
return this.Id;
|
||||
},
|
||||
Undo: function (type, data) {
|
||||
switch (type) {
|
||||
case historyitem_AutoShapes_AddChartGroup:
|
||||
this.chartGroup = g_oTableId.Get_ById(data.oldValue);
|
||||
if (isRealObject(this.chartGroup)) {
|
||||
this.drawingObjects = this.chartGroup.drawingObjects;
|
||||
}
|
||||
break;
|
||||
case historyitem_AutoShapes_SetDrawingObjects:
|
||||
if (data.oldValue !== null) {
|
||||
var api = window["Asc"]["editor"];
|
||||
if (api.wb) {
|
||||
var ws = api.wb.getWorksheetById(data.oldValue);
|
||||
this.drawingObjects = ws.objectRender;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case historyitem_AutoShapes_AddTextBody:
|
||||
this.txBody = g_oTableId.Get_ById(data.oldValue);
|
||||
break;
|
||||
case historyitem_AutoShapes_SetChartTitleLayout:
|
||||
this.layout = g_oTableId.Get_ById(data.oldValue);
|
||||
break;
|
||||
case historyitem_AutoShapes_SetChartTitleType:
|
||||
this.type = data.oldValue;
|
||||
break;
|
||||
}
|
||||
},
|
||||
Redo: function (type, data) {
|
||||
switch (type) {
|
||||
case historyitem_AutoShapes_AddChartGroup:
|
||||
this.chartGroup = g_oTableId.Get_ById(data.newValue);
|
||||
if (isRealObject(this.chartGroup)) {
|
||||
this.drawingObjects = this.chartGroup.drawingObjects;
|
||||
}
|
||||
break;
|
||||
case historyitem_AutoShapes_SetDrawingObjects:
|
||||
if (data.oldValue !== null) {
|
||||
var api = window["Asc"]["editor"];
|
||||
if (api.wb) {
|
||||
var ws = api.wb.getWorksheetById(data.newValue);
|
||||
this.drawingObjects = ws.objectRender;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case historyitem_AutoShapes_AddTextBody:
|
||||
this.txBody = g_oTableId.Get_ById(data.newValue);
|
||||
break;
|
||||
case historyitem_AutoShapes_SetChartTitleLayout:
|
||||
this.layout = g_oTableId.Get_ById(data.newValue);
|
||||
break;
|
||||
case historyitem_AutoShapes_SetChartTitleType:
|
||||
this.type = data.newValue;
|
||||
break;
|
||||
}
|
||||
},
|
||||
getStyles: function () {
|
||||
var styles = new CStyles();
|
||||
var default_legend_style = new CStyle("defaultLegendStyle", styles.Default, null, styletype_Paragraph);
|
||||
default_legend_style.TextPr.themeFont = "Calibri";
|
||||
default_legend_style.TextPr.Bold = true;
|
||||
if (this.getTitleType() === CHART_TITLE_TYPE_TITLE) {
|
||||
default_legend_style.TextPr.FontSize = 18;
|
||||
} else {
|
||||
default_legend_style.TextPr.FontSize = 10;
|
||||
}
|
||||
default_legend_style.ParaPr.Spacing.After = 0;
|
||||
default_legend_style.ParaPr.Spacing.Before = 0;
|
||||
default_legend_style.ParaPr.Spacing.LineRule = linerule_AtLeast;
|
||||
default_legend_style.ParaPr.Spacing.Line = 1;
|
||||
default_legend_style.ParaPr.Jc = align_Center;
|
||||
var tx_pr;
|
||||
if (isRealObject(this.txPr)) {}
|
||||
styles.Style[styles.Id] = default_legend_style;
|
||||
++styles.Id;
|
||||
return styles;
|
||||
},
|
||||
initFromString: function (title) {
|
||||
this.textBody.initFromString(title);
|
||||
},
|
||||
setDefaultText: function (val) {
|
||||
this.isDefaultText = val;
|
||||
},
|
||||
recalculateTransform: function () {
|
||||
this.transform.Reset();
|
||||
global_MatrixTransformer.TranslateAppend(this.transform, this.x, this.y);
|
||||
global_MatrixTransformer.MultiplyAppend(this.transform, this.chartGroup.getTransform());
|
||||
this.invertTransform = global_MatrixTransformer.Invert(this.transform);
|
||||
},
|
||||
recalculateTransform2: function () {
|
||||
this.transform.Reset();
|
||||
global_MatrixTransformer.TranslateAppend(this.transform, this.x, this.y);
|
||||
global_MatrixTransformer.MultiplyAppend(this.transform, this.chartGroup.getTransform());
|
||||
},
|
||||
setTextBody: function (textBody) {
|
||||
var oldId = isRealObject(this.txBody) ? this.txBody.Get_Id() : null;
|
||||
var newId = isRealObject(textBody) ? textBody.Get_Id() : null;
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_AddTextBody, null, null, new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(oldId, newId)));
|
||||
this.txBody = textBody;
|
||||
},
|
||||
setLayoutX: function (x) {
|
||||
if (!isRealObject(this.layout)) {
|
||||
this.setLayout(new CChartLayout());
|
||||
}
|
||||
this.layout.setX(x);
|
||||
},
|
||||
setLayoutY: function (y) {
|
||||
if (!isRealObject(this.layout)) {
|
||||
this.setLayout(new CChartLayout());
|
||||
}
|
||||
this.layout.setY(y);
|
||||
},
|
||||
addTextBody: function (txBody) {
|
||||
this.txBody = txBody;
|
||||
},
|
||||
paragraphAdd: function (paraItem, bRecalculate) {
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
if (!isRealObject(this.txBody)) {
|
||||
this.txBody = new CTextBody(this);
|
||||
}
|
||||
this.txBody.paragraphAdd(paraItem);
|
||||
this.recalculatePosExt();
|
||||
this.txBody.recalculateCurPos();
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
return;
|
||||
},
|
||||
recalculatePosExt: function () {
|
||||
var old_cx = this.x + this.extX * 0.5;
|
||||
var old_cy = this.y + this.extY * 0.5;
|
||||
var bodyPr = this.txBody.getBodyPr();
|
||||
switch (this.type) {
|
||||
case CHART_TITLE_TYPE_TITLE:
|
||||
case CHART_TITLE_TYPE_H_AXIS:
|
||||
var max_title_width = this.chartGroup.extX * 0.8;
|
||||
var title_width = this.txBody.getRectWidth(max_title_width);
|
||||
this.extX = title_width;
|
||||
this.extY = this.txBody.getRectHeight(this.chartGroup.extY, title_width - (bodyPr.rIns + bodyPr.lIns));
|
||||
this.x = old_cx - this.extX * 0.5;
|
||||
if (this.x + this.extX > this.chartGroup.extX) {
|
||||
this.x = this.chartGroup.extX - this.extX;
|
||||
}
|
||||
if (this.x < 0) {
|
||||
this.x = 0;
|
||||
}
|
||||
this.y = old_cy - this.extY * 0.5;
|
||||
if (this.y + this.extY > this.chartGroup.extY) {
|
||||
this.y = this.chartGroup.extY - this.extY;
|
||||
}
|
||||
if (this.y < 0) {
|
||||
this.y = 0;
|
||||
}
|
||||
if (isRealObject(this.layout) && isRealNumber(this.layout.x)) {
|
||||
this.layout.setX(this.x / this.chartGroup.extX);
|
||||
}
|
||||
break;
|
||||
case CHART_TITLE_TYPE_V_AXIS:
|
||||
var max_title_height = this.chartGroup.extY * 0.8;
|
||||
var body_pr = this.txBody.getBodyPr();
|
||||
this.extY = this.txBody.getRectWidth(max_title_height) - body_pr.rIns - body_pr.lIns + body_pr.tIns + body_pr.bIns;
|
||||
this.extX = this.txBody.getRectHeight(this.chartGroup.extX, this.extY) - (-body_pr.rIns - body_pr.lIns + body_pr.tIns + body_pr.bIns);
|
||||
this.spPr.geometry.Recalculate(this.extX, this.extY);
|
||||
this.x = old_cx - this.extX * 0.5;
|
||||
if (this.x + this.extX > this.chartGroup.extX) {
|
||||
this.x = this.chartGroup.extX - this.extX;
|
||||
}
|
||||
if (this.x < 0) {
|
||||
this.x = 0;
|
||||
}
|
||||
this.y = old_cy - this.extY * 0.5;
|
||||
if (this.y + this.extY > this.chartGroup.extY) {
|
||||
this.y = this.chartGroup.extY - this.extY;
|
||||
}
|
||||
if (this.y < 0) {
|
||||
this.y = 0;
|
||||
}
|
||||
if (isRealObject(this.layout) && isRealNumber(this.layout.y)) {
|
||||
this.layout.setY(this.y / this.chartGroup.extY);
|
||||
}
|
||||
break;
|
||||
}
|
||||
this.spPr.geometry.Recalculate(this.extX, this.extY);
|
||||
this.recalculateTransform();
|
||||
this.calculateTransformTextMatrix();
|
||||
this.calculateContent();
|
||||
},
|
||||
getFullRotate: function () {
|
||||
return 0;
|
||||
},
|
||||
getFullFlip: function () {
|
||||
return {
|
||||
flipH: false,
|
||||
flipV: false
|
||||
};
|
||||
},
|
||||
addNewParagraph: function () {
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
this.txBody.addNewParagraph();
|
||||
this.recalculatePosExt();
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
},
|
||||
remove: function (direction, bOnlyText) {
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
this.txBody.remove(direction, bOnlyText);
|
||||
this.recalculatePosExt();
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.chartGroup.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
|
||||
},
|
||||
updateSelectionState: function (drawingDocument) {
|
||||
this.txBody.updateSelectionState(drawingDocument);
|
||||
},
|
||||
recalculateCurPos: function () {
|
||||
if (this.txBody) {
|
||||
this.txBody.recalculateCurPos();
|
||||
}
|
||||
},
|
||||
drawTextSelection: function () {
|
||||
if (isRealObject(this.txBody)) {
|
||||
this.txBody.drawTextSelection();
|
||||
}
|
||||
},
|
||||
calculateContent: function () {
|
||||
if (this.txBody) {
|
||||
this.txBody.calculateContent();
|
||||
}
|
||||
},
|
||||
getColorMap: function () {
|
||||
return this.chartGroup.drawingObjects.controller.getColorMap();
|
||||
},
|
||||
getTheme: function () {
|
||||
return this.chartGroup.drawingObjects.getWorkbook().theme;
|
||||
},
|
||||
calculateTransformTextMatrix: function () {
|
||||
if (this.txBody === null) {
|
||||
return;
|
||||
}
|
||||
this.transformText.Reset();
|
||||
var _text_transform = this.transformText;
|
||||
var _shape_transform = this.transform;
|
||||
var _body_pr = this.txBody.getBodyPr();
|
||||
var _content_height = this.txBody.getSummaryHeight();
|
||||
var _l, _t, _r, _b;
|
||||
var _t_x_lt, _t_y_lt, _t_x_rt, _t_y_rt, _t_x_lb, _t_y_lb, _t_x_rb, _t_y_rb;
|
||||
if (isRealObject(this.spPr.geometry) && isRealObject(this.spPr.geometry.rect)) {
|
||||
var _rect = this.spPr.geometry.rect;
|
||||
_l = _rect.l + _body_pr.lIns;
|
||||
_t = _rect.t + _body_pr.tIns;
|
||||
_r = _rect.r - _body_pr.rIns;
|
||||
_b = _rect.b - _body_pr.bIns;
|
||||
} else {
|
||||
_l = _body_pr.lIns;
|
||||
_t = _body_pr.tIns;
|
||||
_r = this.extX - _body_pr.rIns;
|
||||
_b = this.extY - _body_pr.bIns;
|
||||
}
|
||||
if (_l >= _r) {
|
||||
var _c = (_l + _r) * 0.5;
|
||||
_l = _c - 0.01;
|
||||
_r = _c + 0.01;
|
||||
}
|
||||
if (_t >= _b) {
|
||||
_c = (_t + _b) * 0.5;
|
||||
_t = _c - 0.01;
|
||||
_b = _c + 0.01;
|
||||
}
|
||||
_t_x_lt = _shape_transform.TransformPointX(_l, _t);
|
||||
_t_y_lt = _shape_transform.TransformPointY(_l, _t);
|
||||
_t_x_rt = _shape_transform.TransformPointX(_r, _t);
|
||||
_t_y_rt = _shape_transform.TransformPointY(_r, _t);
|
||||
_t_x_lb = _shape_transform.TransformPointX(_l, _b);
|
||||
_t_y_lb = _shape_transform.TransformPointY(_l, _b);
|
||||
_t_x_rb = _shape_transform.TransformPointX(_r, _b);
|
||||
_t_y_rb = _shape_transform.TransformPointY(_r, _b);
|
||||
var _dx_t, _dy_t;
|
||||
_dx_t = _t_x_rt - _t_x_lt;
|
||||
_dy_t = _t_y_rt - _t_y_lt;
|
||||
var _dx_lt_rb, _dy_lt_rb;
|
||||
_dx_lt_rb = _t_x_rb - _t_x_lt;
|
||||
_dy_lt_rb = _t_y_rb - _t_y_lt;
|
||||
var _vertical_shift;
|
||||
var _text_rect_height = _b - _t;
|
||||
var _text_rect_width = _r - _l;
|
||||
if (! (_body_pr.vert === nVertTTvert || _body_pr.vert === nVertTTvert270)) {
|
||||
if (_content_height < _text_rect_height) {
|
||||
switch (_body_pr.anchor) {
|
||||
case 0:
|
||||
_vertical_shift = _text_rect_height - _content_height;
|
||||
break;
|
||||
case 1:
|
||||
_vertical_shift = (_text_rect_height - _content_height) * 0.5;
|
||||
break;
|
||||
case 2:
|
||||
_vertical_shift = (_text_rect_height - _content_height) * 0.5;
|
||||
break;
|
||||
case 3:
|
||||
_vertical_shift = (_text_rect_height - _content_height) * 0.5;
|
||||
break;
|
||||
case 4:
|
||||
_vertical_shift = 0;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
_vertical_shift = 0;
|
||||
}
|
||||
global_MatrixTransformer.TranslateAppend(_text_transform, 0, _vertical_shift);
|
||||
if (_dx_lt_rb * _dy_t - _dy_lt_rb * _dx_t <= 0) {
|
||||
var alpha = Math.atan2(_dy_t, _dx_t);
|
||||
global_MatrixTransformer.RotateRadAppend(_text_transform, -alpha);
|
||||
global_MatrixTransformer.TranslateAppend(_text_transform, _t_x_lt, _t_y_lt);
|
||||
} else {
|
||||
alpha = Math.atan2(_dy_t, _dx_t);
|
||||
global_MatrixTransformer.RotateRadAppend(_text_transform, Math.PI - alpha);
|
||||
global_MatrixTransformer.TranslateAppend(_text_transform, _t_x_rt, _t_y_rt);
|
||||
}
|
||||
} else {
|
||||
if (_content_height < _text_rect_width) {
|
||||
switch (_body_pr.anchor) {
|
||||
case 0:
|
||||
_vertical_shift = _text_rect_width - _content_height;
|
||||
break;
|
||||
case 1:
|
||||
_vertical_shift = (_text_rect_width - _content_height) * 0.5;
|
||||
break;
|
||||
case 2:
|
||||
_vertical_shift = (_text_rect_width - _content_height) * 0.5;
|
||||
break;
|
||||
case 3:
|
||||
_vertical_shift = (_text_rect_width - _content_height) * 0.5;
|
||||
break;
|
||||
case 4:
|
||||
_vertical_shift = 0;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
_vertical_shift = 0;
|
||||
}
|
||||
global_MatrixTransformer.TranslateAppend(_text_transform, 0, _vertical_shift);
|
||||
var _alpha;
|
||||
_alpha = Math.atan2(_dy_t, _dx_t);
|
||||
if (_body_pr.vert === nVertTTvert) {
|
||||
if (_dx_lt_rb * _dy_t - _dy_lt_rb * _dx_t <= 0) {
|
||||
global_MatrixTransformer.RotateRadAppend(_text_transform, -_alpha - Math.PI * 0.5);
|
||||
global_MatrixTransformer.TranslateAppend(_text_transform, _t_x_rt, _t_y_rt);
|
||||
} else {
|
||||
global_MatrixTransformer.RotateRadAppend(_text_transform, Math.PI * 0.5 - _alpha);
|
||||
global_MatrixTransformer.TranslateAppend(_text_transform, _t_x_lt, _t_y_lt);
|
||||
}
|
||||
} else {
|
||||
if (_dx_lt_rb * _dy_t - _dy_lt_rb * _dx_t <= 0) {
|
||||
global_MatrixTransformer.RotateRadAppend(_text_transform, -_alpha - Math.PI * 1.5);
|
||||
global_MatrixTransformer.TranslateAppend(_text_transform, _t_x_lb, _t_y_lb);
|
||||
} else {
|
||||
global_MatrixTransformer.RotateRadAppend(_text_transform, -Math.PI * 0.5 - _alpha);
|
||||
global_MatrixTransformer.TranslateAppend(_text_transform, _t_x_rb, _t_y_rb);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isRealObject(this.spPr.geometry) && isRealObject(this.spPr.geometry.rect)) {
|
||||
var rect = this.spPr.geometry.rect;
|
||||
this.clipRect = {
|
||||
x: rect.l,
|
||||
y: rect.t,
|
||||
w: rect.r - rect.l,
|
||||
h: rect.b - rect.t
|
||||
};
|
||||
} else {
|
||||
this.clipRect = {
|
||||
x: 0,
|
||||
y: 0,
|
||||
w: this.absExtX,
|
||||
h: this.absExtY
|
||||
};
|
||||
}
|
||||
this.invertTransformText = global_MatrixTransformer.Invert(this.transformText);
|
||||
},
|
||||
recalculateAfterTextAdd: function () {
|
||||
switch (this.type) {
|
||||
case CHART_TITLE_TYPE_TITLE:
|
||||
var body_pr = this.txBody.bodyPr;
|
||||
var r_ins = isRealNumber(body_pr.rIns) ? body_pr.rIns : 1.27;
|
||||
var l_ins = isRealNumber(body_pr.lIns) ? body_pr.lIns : 2.54;
|
||||
var t_ins = isRealNumber(body_pr.tIns) ? body_pr.tIns : 1.27;
|
||||
var b_ins = isRealNumber(body_pr.bIns) ? body_pr.bIns : 1.27;
|
||||
var max_width = this.chartGroup.extX * 0.8 - r_ins - l_ins;
|
||||
var title_content = this.txBody.content;
|
||||
title_content.Reset(0, 0, max_width, 20000);
|
||||
title_content.Recalculate_Page(0);
|
||||
var result_width;
|
||||
if (! (title_content.Content.length > 1 || title_content.Content[0].Lines.length > 1)) {
|
||||
if (title_content.Content[0].Lines[0].Ranges[0].W < max_width) {
|
||||
title_content.Reset(0, 0, title_content.Content[0].Lines[0].Ranges[0].W, 20000);
|
||||
title_content.Recalculate_Page(0);
|
||||
}
|
||||
result_width = title_content.Content[0].Lines[0].Ranges[0].W + r_ins + l_ins;
|
||||
} else {
|
||||
var width = 0;
|
||||
for (var i = 0; i < title_content.Content.length; ++i) {
|
||||
var par = title_content.Content[i];
|
||||
for (var j = 0; j < par.Lines.length; ++j) {
|
||||
if (par.Lines[j].Ranges[0].W > width) {
|
||||
width = par.Lines[j].Ranges[0].W;
|
||||
}
|
||||
}
|
||||
}
|
||||
result_width = width + r_ins + l_ins;
|
||||
}
|
||||
this.extX = result_width;
|
||||
this.extY = title_content.Get_SummaryHeight() + r_ins + l_ins;
|
||||
this.x = this.chartGroup.extX - this.extX * 0.5;
|
||||
this.y = 2.5;
|
||||
break;
|
||||
}
|
||||
},
|
||||
recalculateBrush: function () {},
|
||||
recalculatePen: function () {},
|
||||
draw: function (graphics) {
|
||||
if (! (graphics.ClearMode === true)) {
|
||||
graphics.SetIntegerGrid(false);
|
||||
graphics.transform3(this.transformText);
|
||||
this.txBody.draw(graphics);
|
||||
graphics.reset();
|
||||
graphics.SetIntegerGrid(true);
|
||||
}
|
||||
},
|
||||
selectionSetStart: function (e, x, y) {
|
||||
var t_x, t_y;
|
||||
t_x = this.invertTransformText.TransformPointX(x, y);
|
||||
t_y = this.invertTransformText.TransformPointY(x, y);
|
||||
var event = new CMouseEventHandler();
|
||||
event.fromJQueryEvent(e);
|
||||
this.txBody.selectionSetStart(event, t_x, t_y);
|
||||
},
|
||||
selectionSetEnd: function (e, x, y) {
|
||||
var t_x, t_y;
|
||||
t_x = this.invertTransformText.TransformPointX(x, y);
|
||||
t_y = this.invertTransformText.TransformPointY(x, y);
|
||||
var event = new CMouseEventHandler();
|
||||
event.fromJQueryEvent(e);
|
||||
this.txBody.selectionSetEnd(event, t_x, t_y);
|
||||
},
|
||||
setPosition: function (x, y) {
|
||||
if (!isRealObject(this.layout)) {
|
||||
this.setLayout(new CChartLayout());
|
||||
}
|
||||
this.layout.setIsManual(true);
|
||||
this.layout.setXMode(LAYOUT_MODE_EDGE);
|
||||
this.layout.setX(x / this.chartGroup.extX);
|
||||
this.layout.setYMode(LAYOUT_MODE_EDGE);
|
||||
this.layout.setY(y / this.chartGroup.extY);
|
||||
},
|
||||
setLayout: function (layout) {
|
||||
var oldValue = this.layout ? this.layout.Get_Id() : null;
|
||||
var newValue = layout ? layout.Get_Id() : null;
|
||||
this.layout = layout;
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_SetChartTitleLayout, null, null, new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(oldValue, newValue)));
|
||||
},
|
||||
setOverlay: function (overlay) {
|
||||
var oldValue = this.overlay;
|
||||
var newValue = overlay;
|
||||
this.overlay = overlay;
|
||||
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_SetChartOverlay, null, null, new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(oldValue, newValue)));
|
||||
},
|
||||
getRectBounds: function () {
|
||||
var transform = this.getTransform();
|
||||
var w = this.extX;
|
||||
var h = this.extY;
|
||||
var rect_points = [{
|
||||
x: 0,
|
||||
y: 0
|
||||
},
|
||||
{
|
||||
x: w,
|
||||
y: 0
|
||||
},
|
||||
{
|
||||
x: w,
|
||||
y: h
|
||||
},
|
||||
{
|
||||
x: 0,
|
||||
y: h
|
||||
}];
|
||||
var min_x, max_x, min_y, max_y;
|
||||
min_x = transform.TransformPointX(rect_points[0].x, rect_points[0].y);
|
||||
min_y = transform.TransformPointY(rect_points[0].x, rect_points[0].y);
|
||||
max_x = min_x;
|
||||
max_y = min_y;
|
||||
var cur_x, cur_y;
|
||||
for (var i = 1; i < 4; ++i) {
|
||||
cur_x = transform.TransformPointX(rect_points[i].x, rect_points[i].y);
|
||||
cur_y = transform.TransformPointY(rect_points[i].x, rect_points[i].y);
|
||||
if (cur_x < min_x) {
|
||||
min_x = cur_x;
|
||||
}
|
||||
if (cur_x > max_x) {
|
||||
max_x = cur_x;
|
||||
}
|
||||
if (cur_y < min_y) {
|
||||
min_y = cur_y;
|
||||
}
|
||||
if (cur_y > max_y) {
|
||||
max_y = cur_y;
|
||||
}
|
||||
}
|
||||
return {
|
||||
minX: min_x,
|
||||
maxX: max_x,
|
||||
minY: min_y,
|
||||
maxY: max_y
|
||||
};
|
||||
},
|
||||
hit: function (x, y) {
|
||||
return this.hitInInnerArea(x, y) || this.hitInPath(x, y) || this.hitInTextRect(x, y);
|
||||
},
|
||||
hitInPath: function (x, y) {
|
||||
var invert_transform = this.getInvertTransform();
|
||||
var x_t = invert_transform.TransformPointX(x, y);
|
||||
var y_t = invert_transform.TransformPointY(x, y);
|
||||
if (isRealObject(this.spPr.geometry)) {
|
||||
return this.spPr.geometry.hitInPath(this.drawingObjects.getCanvasContext(), x_t, y_t);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
hitInInnerArea: function (x, y) {
|
||||
var invert_transform = this.getInvertTransform();
|
||||
var x_t = invert_transform.TransformPointX(x, y);
|
||||
var y_t = invert_transform.TransformPointY(x, y);
|
||||
if (isRealObject(this.spPr.geometry)) {
|
||||
return this.spPr.geometry.hitInInnerArea(this.drawingObjects.getCanvasContext(), x_t, y_t);
|
||||
}
|
||||
return x_t > 0 && x_t < this.extX && y_t > 0 && y_t < this.extY;
|
||||
},
|
||||
hitInTextRect: function (x, y) {
|
||||
if (isRealObject(this.txBody)) {
|
||||
var t_x, t_y;
|
||||
t_x = this.invertTransformText.TransformPointX(x, y);
|
||||
t_y = this.invertTransformText.TransformPointY(x, y);
|
||||
return t_x > 0 && t_x < this.txBody.contentWidth && t_y > 0 && t_y < this.txBody.contentHeight;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
hitInBoundingRect: function (x, y) {
|
||||
var invert_transform = this.getInvertTransform();
|
||||
var x_t = invert_transform.TransformPointX(x, y);
|
||||
var y_t = invert_transform.TransformPointY(x, y);
|
||||
var _hit_context = this.drawingObjects.getCanvasContext();
|
||||
return (HitInLine(_hit_context, x_t, y_t, 0, 0, this.extX, 0) || HitInLine(_hit_context, x_t, y_t, this.extX, 0, this.extX, this.extY) || HitInLine(_hit_context, x_t, y_t, this.extX, this.extY, 0, this.extY) || HitInLine(_hit_context, x_t, y_t, 0, this.extY, 0, 0));
|
||||
},
|
||||
getInvertTransform: function () {
|
||||
return this.invertTransform;
|
||||
},
|
||||
getAllFonts: function (AllFonts) {
|
||||
if (this.txBody && this.txBody.content) {
|
||||
this.txBody.content.Document_Get_AllFontNames(AllFonts);
|
||||
}
|
||||
},
|
||||
writeToBinary: function (w) {
|
||||
w.WriteBool(isRealObject(this.layout));
|
||||
if (isRealObject(this.layout)) {
|
||||
this.layout.writeToBinary(w);
|
||||
}
|
||||
w.WriteBool(this.overlay);
|
||||
this.spPr.Write_ToBinary2(w);
|
||||
w.WriteBool(isRealObject(this.txBody));
|
||||
if (isRealObject(this.txBody)) {
|
||||
this.txBody.writeToBinary(w);
|
||||
}
|
||||
},
|
||||
readFromBinary: function (r) {
|
||||
if (r.GetBool()) {
|
||||
this.setLayout(new CChartLayout());
|
||||
this.layout.readFromBinary(r);
|
||||
}
|
||||
this.setOverlay(r.GetBool());
|
||||
this.spPr.Read_FromBinary2(r);
|
||||
if (r.GetBool()) {
|
||||
this.setTextBody(new CTextBody(this));
|
||||
this.txBody.readFromBinary(r);
|
||||
}
|
||||
},
|
||||
OnContentRecalculate: function () {
|
||||
if (this.chartGroup) {
|
||||
this.chartGroup.recalculate();
|
||||
}
|
||||
}
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,805 +0,0 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
var fontslot_ASCII = 0;
|
||||
var fontslot_EastAsia = 1;
|
||||
var fontslot_CS = 2;
|
||||
var fontslot_HAnsi = 3;
|
||||
var fonthint_Default = 0;
|
||||
var fonthint_CS = 1;
|
||||
var fonthint_EastAsia = 2;
|
||||
var lcid_unknown = 0;
|
||||
var lcid_ar = 1;
|
||||
var lcid_bg = 2;
|
||||
var lcid_ca = 3;
|
||||
var lcid_zhHans = 4;
|
||||
var lcid_cs = 5;
|
||||
var lcid_da = 6;
|
||||
var lcid_de = 7;
|
||||
var lcid_el = 8;
|
||||
var lcid_en = 9;
|
||||
var lcid_es = 10;
|
||||
var lcid_fi = 11;
|
||||
var lcid_fr = 12;
|
||||
var lcid_he = 13;
|
||||
var lcid_hu = 14;
|
||||
var lcid_is = 15;
|
||||
var lcid_it = 16;
|
||||
var lcid_ja = 17;
|
||||
var lcid_ko = 18;
|
||||
var lcid_nl = 19;
|
||||
var lcid_no = 20;
|
||||
var lcid_pl = 21;
|
||||
var lcid_pt = 22;
|
||||
var lcid_rm = 23;
|
||||
var lcid_ro = 24;
|
||||
var lcid_ru = 25;
|
||||
var lcid_hr = 26;
|
||||
var lcid_sk = 27;
|
||||
var lcid_sq = 28;
|
||||
var lcid_sv = 29;
|
||||
var lcid_th = 30;
|
||||
var lcid_tr = 31;
|
||||
var lcid_ur = 32;
|
||||
var lcid_id = 33;
|
||||
var lcid_uk = 34;
|
||||
var lcid_be = 35;
|
||||
var lcid_sl = 36;
|
||||
var lcid_et = 37;
|
||||
var lcid_lv = 38;
|
||||
var lcid_lt = 39;
|
||||
var lcid_tg = 40;
|
||||
var lcid_fa = 41;
|
||||
var lcid_vi = 42;
|
||||
var lcid_hy = 43;
|
||||
var lcid_az = 44;
|
||||
var lcid_eu = 45;
|
||||
var lcid_hsb = 46;
|
||||
var lcid_mk = 47;
|
||||
var lcid_tn = 50;
|
||||
var lcid_xh = 52;
|
||||
var lcid_zu = 53;
|
||||
var lcid_af = 54;
|
||||
var lcid_ka = 55;
|
||||
var lcid_fo = 56;
|
||||
var lcid_hi = 57;
|
||||
var lcid_mt = 58;
|
||||
var lcid_se = 59;
|
||||
var lcid_ga = 60;
|
||||
var lcid_ms = 62;
|
||||
var lcid_kk = 63;
|
||||
var lcid_ky = 64;
|
||||
var lcid_sw = 65;
|
||||
var lcid_tk = 66;
|
||||
var lcid_uz = 67;
|
||||
var lcid_tt = 68;
|
||||
var lcid_bn = 69;
|
||||
var lcid_pa = 70;
|
||||
var lcid_gu = 71;
|
||||
var lcid_or = 72;
|
||||
var lcid_ta = 73;
|
||||
var lcid_te = 74;
|
||||
var lcid_kn = 75;
|
||||
var lcid_ml = 76;
|
||||
var lcid_as = 77;
|
||||
var lcid_mr = 78;
|
||||
var lcid_sa = 79;
|
||||
var lcid_mn = 80;
|
||||
var lcid_bo = 81;
|
||||
var lcid_cy = 82;
|
||||
var lcid_km = 83;
|
||||
var lcid_lo = 84;
|
||||
var lcid_gl = 86;
|
||||
var lcid_kok = 87;
|
||||
var lcid_syr = 90;
|
||||
var lcid_si = 91;
|
||||
var lcid_iu = 93;
|
||||
var lcid_am = 94;
|
||||
var lcid_tzm = 95;
|
||||
var lcid_ne = 97;
|
||||
var lcid_fy = 98;
|
||||
var lcid_ps = 99;
|
||||
var lcid_fil = 100;
|
||||
var lcid_dv = 101;
|
||||
var lcid_ha = 104;
|
||||
var lcid_yo = 106;
|
||||
var lcid_quz = 107;
|
||||
var lcid_nso = 108;
|
||||
var lcid_ba = 109;
|
||||
var lcid_lb = 110;
|
||||
var lcid_kl = 111;
|
||||
var lcid_ig = 112;
|
||||
var lcid_ii = 120;
|
||||
var lcid_arn = 122;
|
||||
var lcid_moh = 124;
|
||||
var lcid_br = 126;
|
||||
var lcid_ug = 128;
|
||||
var lcid_mi = 129;
|
||||
var lcid_oc = 130;
|
||||
var lcid_co = 131;
|
||||
var lcid_gsw = 132;
|
||||
var lcid_sah = 133;
|
||||
var lcid_qut = 134;
|
||||
var lcid_rw = 135;
|
||||
var lcid_wo = 136;
|
||||
var lcid_prs = 140;
|
||||
var lcid_gd = 145;
|
||||
var lcid_arSA = 1025;
|
||||
var lcid_bgBG = 1026;
|
||||
var lcid_caES = 1027;
|
||||
var lcid_zhTW = 1028;
|
||||
var lcid_csCZ = 1029;
|
||||
var lcid_daDK = 1030;
|
||||
var lcid_deDE = 1031;
|
||||
var lcid_elGR = 1032;
|
||||
var lcid_enUS = 1033;
|
||||
var lcid_esES_tradnl = 1034;
|
||||
var lcid_fiFI = 1035;
|
||||
var lcid_frFR = 1036;
|
||||
var lcid_heIL = 1037;
|
||||
var lcid_huHU = 1038;
|
||||
var lcid_isIS = 1039;
|
||||
var lcid_itIT = 1040;
|
||||
var lcid_jaJP = 1041;
|
||||
var lcid_koKR = 1042;
|
||||
var lcid_nlNL = 1043;
|
||||
var lcid_nbNO = 1044;
|
||||
var lcid_plPL = 1045;
|
||||
var lcid_ptBR = 1046;
|
||||
var lcid_rmCH = 1047;
|
||||
var lcid_roRO = 1048;
|
||||
var lcid_ruRU = 1049;
|
||||
var lcid_hrHR = 1050;
|
||||
var lcid_skSK = 1051;
|
||||
var lcid_sqAL = 1052;
|
||||
var lcid_svSE = 1053;
|
||||
var lcid_thTH = 1054;
|
||||
var lcid_trTR = 1055;
|
||||
var lcid_urPK = 1056;
|
||||
var lcid_idID = 1057;
|
||||
var lcid_ukUA = 1058;
|
||||
var lcid_beBY = 1059;
|
||||
var lcid_slSI = 1060;
|
||||
var lcid_etEE = 1061;
|
||||
var lcid_lvLV = 1062;
|
||||
var lcid_ltLT = 1063;
|
||||
var lcid_tgCyrlTJ = 1064;
|
||||
var lcid_faIR = 1065;
|
||||
var lcid_viVN = 1066;
|
||||
var lcid_hyAM = 1067;
|
||||
var lcid_azLatnAZ = 1068;
|
||||
var lcid_euES = 1069;
|
||||
var lcid_wenDE = 1070;
|
||||
var lcid_mkMK = 1071;
|
||||
var lcid_stZA = 1072;
|
||||
var lcid_tsZA = 1073;
|
||||
var lcid_tnZA = 1074;
|
||||
var lcid_venZA = 1075;
|
||||
var lcid_xhZA = 1076;
|
||||
var lcid_zuZA = 1077;
|
||||
var lcid_afZA = 1078;
|
||||
var lcid_kaGE = 1079;
|
||||
var lcid_foFO = 1080;
|
||||
var lcid_hiIN = 1081;
|
||||
var lcid_mtMT = 1082;
|
||||
var lcid_seNO = 1083;
|
||||
var lcid_msMY = 1086;
|
||||
var lcid_kkKZ = 1087;
|
||||
var lcid_kyKG = 1088;
|
||||
var lcid_swKE = 1089;
|
||||
var lcid_tkTM = 1090;
|
||||
var lcid_uzLatnUZ = 1091;
|
||||
var lcid_ttRU = 1092;
|
||||
var lcid_bnIN = 1093;
|
||||
var lcid_paIN = 1094;
|
||||
var lcid_guIN = 1095;
|
||||
var lcid_orIN = 1096;
|
||||
var lcid_taIN = 1097;
|
||||
var lcid_teIN = 1098;
|
||||
var lcid_knIN = 1099;
|
||||
var lcid_mlIN = 1100;
|
||||
var lcid_asIN = 1101;
|
||||
var lcid_mrIN = 1102;
|
||||
var lcid_saIN = 1103;
|
||||
var lcid_mnMN = 1104;
|
||||
var lcid_boCN = 1105;
|
||||
var lcid_cyGB = 1106;
|
||||
var lcid_kmKH = 1107;
|
||||
var lcid_loLA = 1108;
|
||||
var lcid_myMM = 1109;
|
||||
var lcid_glES = 1110;
|
||||
var lcid_kokIN = 1111;
|
||||
var lcid_mni = 1112;
|
||||
var lcid_sdIN = 1113;
|
||||
var lcid_syrSY = 1114;
|
||||
var lcid_siLK = 1115;
|
||||
var lcid_chrUS = 1116;
|
||||
var lcid_iuCansCA = 1117;
|
||||
var lcid_amET = 1118;
|
||||
var lcid_tmz = 1119;
|
||||
var lcid_neNP = 1121;
|
||||
var lcid_fyNL = 1122;
|
||||
var lcid_psAF = 1123;
|
||||
var lcid_filPH = 1124;
|
||||
var lcid_dvMV = 1125;
|
||||
var lcid_binNG = 1126;
|
||||
var lcid_fuvNG = 1127;
|
||||
var lcid_haLatnNG = 1128;
|
||||
var lcid_ibbNG = 1129;
|
||||
var lcid_yoNG = 1130;
|
||||
var lcid_quzBO = 1131;
|
||||
var lcid_nsoZA = 1132;
|
||||
var lcid_baRU = 1133;
|
||||
var lcid_lbLU = 1134;
|
||||
var lcid_klGL = 1135;
|
||||
var lcid_igNG = 1136;
|
||||
var lcid_krNG = 1137;
|
||||
var lcid_gazET = 1138;
|
||||
var lcid_tiER = 1139;
|
||||
var lcid_gnPY = 1140;
|
||||
var lcid_hawUS = 1141;
|
||||
var lcid_soSO = 1143;
|
||||
var lcid_iiCN = 1144;
|
||||
var lcid_papAN = 1145;
|
||||
var lcid_arnCL = 1146;
|
||||
var lcid_mohCA = 1148;
|
||||
var lcid_brFR = 1150;
|
||||
var lcid_ugCN = 1152;
|
||||
var lcid_miNZ = 1153;
|
||||
var lcid_ocFR = 1154;
|
||||
var lcid_coFR = 1155;
|
||||
var lcid_gswFR = 1156;
|
||||
var lcid_sahRU = 1157;
|
||||
var lcid_qutGT = 1158;
|
||||
var lcid_rwRW = 1159;
|
||||
var lcid_woSN = 1160;
|
||||
var lcid_prsAF = 1164;
|
||||
var lcid_pltMG = 1165;
|
||||
var lcid_gdGB = 1169;
|
||||
var lcid_arIQ = 2049;
|
||||
var lcid_zhCN = 2052;
|
||||
var lcid_deCH = 2055;
|
||||
var lcid_enGB = 2057;
|
||||
var lcid_esMX = 2058;
|
||||
var lcid_frBE = 2060;
|
||||
var lcid_itCH = 2064;
|
||||
var lcid_nlBE = 2067;
|
||||
var lcid_nnNO = 2068;
|
||||
var lcid_ptPT = 2070;
|
||||
var lcid_roMO = 2072;
|
||||
var lcid_ruMO = 2073;
|
||||
var lcid_srLatnCS = 2074;
|
||||
var lcid_svFI = 2077;
|
||||
var lcid_urIN = 2080;
|
||||
var lcid_azCyrlAZ = 2092;
|
||||
var lcid_dsbDE = 2094;
|
||||
var lcid_seSE = 2107;
|
||||
var lcid_gaIE = 2108;
|
||||
var lcid_msBN = 2110;
|
||||
var lcid_uzCyrlUZ = 2115;
|
||||
var lcid_bnBD = 2117;
|
||||
var lcid_paPK = 2118;
|
||||
var lcid_mnMongCN = 2128;
|
||||
var lcid_boBT = 2129;
|
||||
var lcid_sdPK = 2137;
|
||||
var lcid_iuLatnCA = 2141;
|
||||
var lcid_tzmLatnDZ = 2143;
|
||||
var lcid_neIN = 2145;
|
||||
var lcid_quzEC = 2155;
|
||||
var lcid_tiET = 2163;
|
||||
var lcid_arEG = 3073;
|
||||
var lcid_zhHK = 3076;
|
||||
var lcid_deAT = 3079;
|
||||
var lcid_enAU = 3081;
|
||||
var lcid_esES = 3082;
|
||||
var lcid_frCA = 3084;
|
||||
var lcid_srCyrlCS = 3098;
|
||||
var lcid_seFI = 3131;
|
||||
var lcid_tmzMA = 3167;
|
||||
var lcid_quzPE = 3179;
|
||||
var lcid_arLY = 4097;
|
||||
var lcid_zhSG = 4100;
|
||||
var lcid_deLU = 4103;
|
||||
var lcid_enCA = 4105;
|
||||
var lcid_esGT = 4106;
|
||||
var lcid_frCH = 4108;
|
||||
var lcid_hrBA = 4122;
|
||||
var lcid_smjNO = 4155;
|
||||
var lcid_arDZ = 5121;
|
||||
var lcid_zhMO = 5124;
|
||||
var lcid_deLI = 5127;
|
||||
var lcid_enNZ = 5129;
|
||||
var lcid_esCR = 5130;
|
||||
var lcid_frLU = 5132;
|
||||
var lcid_bsLatnBA = 5146;
|
||||
var lcid_smjSE = 5179;
|
||||
var lcid_arMA = 6145;
|
||||
var lcid_enIE = 6153;
|
||||
var lcid_esPA = 6154;
|
||||
var lcid_frMC = 6156;
|
||||
var lcid_srLatnBA = 6170;
|
||||
var lcid_smaNO = 6203;
|
||||
var lcid_arTN = 7169;
|
||||
var lcid_enZA = 7177;
|
||||
var lcid_esDO = 7178;
|
||||
var lcid_frWest = 7180;
|
||||
var lcid_srCyrlBA = 7194;
|
||||
var lcid_smaSE = 7227;
|
||||
var lcid_arOM = 8193;
|
||||
var lcid_enJM = 8201;
|
||||
var lcid_esVE = 8202;
|
||||
var lcid_frRE = 8204;
|
||||
var lcid_bsCyrlBA = 8218;
|
||||
var lcid_smsFI = 8251;
|
||||
var lcid_arYE = 9217;
|
||||
var lcid_enCB = 9225;
|
||||
var lcid_esCO = 9226;
|
||||
var lcid_frCG = 9228;
|
||||
var lcid_srLatnRS = 9242;
|
||||
var lcid_smnFI = 9275;
|
||||
var lcid_arSY = 10241;
|
||||
var lcid_enBZ = 10249;
|
||||
var lcid_esPE = 10250;
|
||||
var lcid_frSN = 10252;
|
||||
var lcid_srCyrlRS = 10266;
|
||||
var lcid_arJO = 11265;
|
||||
var lcid_enTT = 11273;
|
||||
var lcid_esAR = 11274;
|
||||
var lcid_frCM = 11276;
|
||||
var lcid_srLatnME = 11290;
|
||||
var lcid_arLB = 12289;
|
||||
var lcid_enZW = 12297;
|
||||
var lcid_esEC = 12298;
|
||||
var lcid_frCI = 12300;
|
||||
var lcid_srCyrlME = 12314;
|
||||
var lcid_arKW = 13313;
|
||||
var lcid_enPH = 13321;
|
||||
var lcid_esCL = 13322;
|
||||
var lcid_frML = 13324;
|
||||
var lcid_arAE = 14337;
|
||||
var lcid_enID = 14345;
|
||||
var lcid_esUY = 14346;
|
||||
var lcid_frMA = 14348;
|
||||
var lcid_arBH = 15361;
|
||||
var lcid_enHK = 15369;
|
||||
var lcid_esPY = 15370;
|
||||
var lcid_frHT = 15372;
|
||||
var lcid_arQA = 16385;
|
||||
var lcid_enIN = 16393;
|
||||
var lcid_esBO = 16394;
|
||||
var lcid_enMY = 17417;
|
||||
var lcid_esSV = 17418;
|
||||
var lcid_enSG = 18441;
|
||||
var lcid_esHN = 18442;
|
||||
var lcid_esNI = 19466;
|
||||
var lcid_esPR = 20490;
|
||||
var lcid_esUS = 21514;
|
||||
var lcid_bsCyrl = 25626;
|
||||
var lcid_bsLatn = 26650;
|
||||
var lcid_srCyrl = 27674;
|
||||
var lcid_srLatn = 28698;
|
||||
var lcid_smn = 28731;
|
||||
var lcid_azCyrl = 29740;
|
||||
var lcid_sms = 29755;
|
||||
var lcid_zh = 30724;
|
||||
var lcid_nn = 30740;
|
||||
var lcid_bs = 30746;
|
||||
var lcid_azLatn = 30764;
|
||||
var lcid_sma = 30779;
|
||||
var lcid_uzCyrl = 30787;
|
||||
var lcid_mnCyrl = 30800;
|
||||
var lcid_iuCans = 30813;
|
||||
var lcid_zhHant = 31748;
|
||||
var lcid_nb = 31764;
|
||||
var lcid_sr = 31770;
|
||||
var lcid_tgCyrl = 31784;
|
||||
var lcid_dsb = 31790;
|
||||
var lcid_smj = 31803;
|
||||
var lcid_uzLatn = 31811;
|
||||
var lcid_mnMong = 31824;
|
||||
var lcid_iuLatn = 31837;
|
||||
var lcid_tzmLatn = 31839;
|
||||
var lcid_haLatn = 31848;
|
||||
(function (document) {
|
||||
function CDetectFontUse() {
|
||||
this.DetectData = null;
|
||||
this.TableChunkLen = 65536;
|
||||
this.TableChunks = 4;
|
||||
this.TableChunkMain = 0;
|
||||
this.TableChunkHintEA = this.TableChunkLen;
|
||||
this.TableChunkHintZH = 2 * this.TableChunkLen;
|
||||
this.TableChunkHintEACS = 3 * this.TableChunkLen;
|
||||
this.Init = function () {
|
||||
this.DetectData = g_memory.Alloc(this.TableChunkLen * this.TableChunks);
|
||||
var _data = this.DetectData.data;
|
||||
var i, j;
|
||||
j = 0;
|
||||
for (i = 0; i <= 127; i++) {
|
||||
_data[i + j] = fontslot_ASCII;
|
||||
}
|
||||
for (i = 160; i <= 1279; i++) {
|
||||
_data[i + j] = fontslot_HAnsi;
|
||||
}
|
||||
for (i = 1424; i <= 1983; i++) {
|
||||
_data[i + j] = fontslot_ASCII;
|
||||
}
|
||||
for (i = 4352; i <= 4607; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 7680; i <= 7935; i++) {
|
||||
_data[i + j] = fontslot_HAnsi;
|
||||
}
|
||||
for (i = 7936; i <= 10175; i++) {
|
||||
_data[i + j] = fontslot_HAnsi;
|
||||
}
|
||||
for (i = 11904; i <= 12703; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 12800; i <= 19855; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 19968; i <= 40879; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 40960; i <= 42191; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 44032; i <= 55215; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 55296; i <= 57343; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 57344; i <= 63743; i++) {
|
||||
_data[i + j] = fontslot_HAnsi;
|
||||
}
|
||||
for (i = 63744; i <= 64255; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 64256; i <= 64284; i++) {
|
||||
_data[i + j] = fontslot_HAnsi;
|
||||
}
|
||||
for (i = 64285; i <= 65023; i++) {
|
||||
_data[i + j] = fontslot_ASCII;
|
||||
}
|
||||
for (i = 65072; i <= 65135; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 65136; i <= 65278; i++) {
|
||||
_data[i + j] = fontslot_ASCII;
|
||||
}
|
||||
for (i = 65280; i <= 65519; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
j = this.TableChunkHintEA;
|
||||
for (i = 0; i <= 127; i++) {
|
||||
_data[i + j] = fontslot_ASCII;
|
||||
}
|
||||
for (i = 160; i <= 1279; i++) {
|
||||
_data[i + j] = fontslot_HAnsi;
|
||||
}
|
||||
_data[161 + j] = fontslot_EastAsia;
|
||||
_data[164 + j] = fontslot_EastAsia;
|
||||
_data[167 + j] = fontslot_EastAsia;
|
||||
_data[168 + j] = fontslot_EastAsia;
|
||||
_data[170 + j] = fontslot_EastAsia;
|
||||
_data[173 + j] = fontslot_EastAsia;
|
||||
_data[175 + j] = fontslot_EastAsia;
|
||||
_data[176 + j] = fontslot_EastAsia;
|
||||
_data[177 + j] = fontslot_EastAsia;
|
||||
_data[178 + j] = fontslot_EastAsia;
|
||||
_data[179 + j] = fontslot_EastAsia;
|
||||
_data[180 + j] = fontslot_EastAsia;
|
||||
_data[182 + j] = fontslot_EastAsia;
|
||||
_data[183 + j] = fontslot_EastAsia;
|
||||
_data[184 + j] = fontslot_EastAsia;
|
||||
_data[185 + j] = fontslot_EastAsia;
|
||||
_data[186 + j] = fontslot_EastAsia;
|
||||
_data[188 + j] = fontslot_EastAsia;
|
||||
_data[189 + j] = fontslot_EastAsia;
|
||||
_data[190 + j] = fontslot_EastAsia;
|
||||
_data[191 + j] = fontslot_EastAsia;
|
||||
_data[215 + j] = fontslot_EastAsia;
|
||||
_data[247 + j] = fontslot_EastAsia;
|
||||
for (i = 688; i <= 1279; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 1424; i <= 1983; i++) {
|
||||
_data[i + j] = fontslot_ASCII;
|
||||
}
|
||||
for (i = 4352; i <= 4607; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 7680; i <= 7935; i++) {
|
||||
_data[i + j] = fontslot_HAnsi;
|
||||
}
|
||||
for (i = 7936; i <= 8191; i++) {
|
||||
_data[i + j] = fontslot_HAnsi;
|
||||
}
|
||||
for (i = 8192; i <= 10175; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 11904; i <= 12703; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 12800; i <= 19855; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 19968; i <= 40879; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 40960; i <= 42191; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 44032; i <= 55215; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 55296; i <= 57343; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 57344; i <= 63743; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 63744; i <= 64255; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 64256; i <= 64284; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 64285; i <= 65023; i++) {
|
||||
_data[i + j] = fontslot_ASCII;
|
||||
}
|
||||
for (i = 65072; i <= 65135; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 65136; i <= 65278; i++) {
|
||||
_data[i + j] = fontslot_ASCII;
|
||||
}
|
||||
for (i = 65280; i <= 65519; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
j = this.TableChunkHintZH;
|
||||
for (i = 0; i <= 127; i++) {
|
||||
_data[i + j] = fontslot_ASCII;
|
||||
}
|
||||
for (i = 160; i <= 255; i++) {
|
||||
_data[i + j] = fontslot_HAnsi;
|
||||
}
|
||||
_data[161 + j] = fontslot_EastAsia;
|
||||
_data[164 + j] = fontslot_EastAsia;
|
||||
_data[167 + j] = fontslot_EastAsia;
|
||||
_data[168 + j] = fontslot_EastAsia;
|
||||
_data[170 + j] = fontslot_EastAsia;
|
||||
_data[173 + j] = fontslot_EastAsia;
|
||||
_data[175 + j] = fontslot_EastAsia;
|
||||
_data[176 + j] = fontslot_EastAsia;
|
||||
_data[177 + j] = fontslot_EastAsia;
|
||||
_data[178 + j] = fontslot_EastAsia;
|
||||
_data[179 + j] = fontslot_EastAsia;
|
||||
_data[180 + j] = fontslot_EastAsia;
|
||||
_data[182 + j] = fontslot_EastAsia;
|
||||
_data[183 + j] = fontslot_EastAsia;
|
||||
_data[184 + j] = fontslot_EastAsia;
|
||||
_data[185 + j] = fontslot_EastAsia;
|
||||
_data[186 + j] = fontslot_EastAsia;
|
||||
_data[188 + j] = fontslot_EastAsia;
|
||||
_data[189 + j] = fontslot_EastAsia;
|
||||
_data[190 + j] = fontslot_EastAsia;
|
||||
_data[191 + j] = fontslot_EastAsia;
|
||||
_data[215 + j] = fontslot_EastAsia;
|
||||
_data[247 + j] = fontslot_EastAsia;
|
||||
_data[224 + j] = fontslot_EastAsia;
|
||||
_data[225 + j] = fontslot_EastAsia;
|
||||
_data[232 + j] = fontslot_EastAsia;
|
||||
_data[233 + j] = fontslot_EastAsia;
|
||||
_data[234 + j] = fontslot_EastAsia;
|
||||
_data[236 + j] = fontslot_EastAsia;
|
||||
_data[237 + j] = fontslot_EastAsia;
|
||||
_data[242 + j] = fontslot_EastAsia;
|
||||
_data[243 + j] = fontslot_EastAsia;
|
||||
_data[249 + j] = fontslot_EastAsia;
|
||||
_data[250 + j] = fontslot_EastAsia;
|
||||
_data[252 + j] = fontslot_EastAsia;
|
||||
for (i = 256; i <= 687; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 688; i <= 1279; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 1424; i <= 1983; i++) {
|
||||
_data[i + j] = fontslot_ASCII;
|
||||
}
|
||||
for (i = 4352; i <= 4607; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 7680; i <= 7935; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 7936; i <= 8191; i++) {
|
||||
_data[i + j] = fontslot_HAnsi;
|
||||
}
|
||||
for (i = 8192; i <= 10175; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 11904; i <= 12703; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 12800; i <= 19855; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 19968; i <= 40879; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 40960; i <= 42191; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 44032; i <= 55215; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 55296; i <= 57343; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 57344; i <= 63743; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 63744; i <= 64255; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 64256; i <= 64284; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 64285; i <= 65023; i++) {
|
||||
_data[i + j] = fontslot_ASCII;
|
||||
}
|
||||
for (i = 65072; i <= 65135; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 65136; i <= 65278; i++) {
|
||||
_data[i + j] = fontslot_ASCII;
|
||||
}
|
||||
for (i = 65280; i <= 65519; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
j = this.TableChunkHintEACS;
|
||||
for (i = 0; i <= 127; i++) {
|
||||
_data[i + j] = fontslot_ASCII;
|
||||
}
|
||||
for (i = 160; i <= 255; i++) {
|
||||
_data[i + j] = fontslot_HAnsi;
|
||||
}
|
||||
_data[161 + j] = fontslot_EastAsia;
|
||||
_data[164 + j] = fontslot_EastAsia;
|
||||
_data[167 + j] = fontslot_EastAsia;
|
||||
_data[168 + j] = fontslot_EastAsia;
|
||||
_data[170 + j] = fontslot_EastAsia;
|
||||
_data[173 + j] = fontslot_EastAsia;
|
||||
_data[175 + j] = fontslot_EastAsia;
|
||||
_data[176 + j] = fontslot_EastAsia;
|
||||
_data[177 + j] = fontslot_EastAsia;
|
||||
_data[178 + j] = fontslot_EastAsia;
|
||||
_data[179 + j] = fontslot_EastAsia;
|
||||
_data[180 + j] = fontslot_EastAsia;
|
||||
_data[182 + j] = fontslot_EastAsia;
|
||||
_data[183 + j] = fontslot_EastAsia;
|
||||
_data[184 + j] = fontslot_EastAsia;
|
||||
_data[185 + j] = fontslot_EastAsia;
|
||||
_data[186 + j] = fontslot_EastAsia;
|
||||
_data[188 + j] = fontslot_EastAsia;
|
||||
_data[189 + j] = fontslot_EastAsia;
|
||||
_data[190 + j] = fontslot_EastAsia;
|
||||
_data[191 + j] = fontslot_EastAsia;
|
||||
_data[215 + j] = fontslot_EastAsia;
|
||||
_data[247 + j] = fontslot_EastAsia;
|
||||
for (i = 256; i <= 687; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 688; i <= 1279; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 1424; i <= 1983; i++) {
|
||||
_data[i + j] = fontslot_ASCII;
|
||||
}
|
||||
for (i = 4352; i <= 4607; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 7680; i <= 7935; i++) {
|
||||
_data[i + j] = fontslot_HAnsi;
|
||||
}
|
||||
for (i = 7936; i <= 8191; i++) {
|
||||
_data[i + j] = fontslot_HAnsi;
|
||||
}
|
||||
for (i = 8192; i <= 10175; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 11904; i <= 12703; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 12800; i <= 19855; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 19968; i <= 40879; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 40960; i <= 42191; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 44032; i <= 55215; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 55296; i <= 57343; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 57344; i <= 63743; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 63744; i <= 64255; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 64256; i <= 64284; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 64285; i <= 65023; i++) {
|
||||
_data[i + j] = fontslot_ASCII;
|
||||
}
|
||||
for (i = 65072; i <= 65135; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
for (i = 65136; i <= 65278; i++) {
|
||||
_data[i + j] = fontslot_ASCII;
|
||||
}
|
||||
for (i = 65280; i <= 65519; i++) {
|
||||
_data[i + j] = fontslot_EastAsia;
|
||||
}
|
||||
};
|
||||
this.Get_FontClass = function (nUnicode, nHint, nEastAsia_lcid, bCS, bRTL) {
|
||||
var _glyph_slot = fontslot_ASCII;
|
||||
if (nHint != fonthint_EastAsia) {
|
||||
_glyph_slot = this.DetectData.data[nUnicode];
|
||||
} else {
|
||||
if (nEastAsia_lcid == lcid_zh) {
|
||||
_glyph_slot = this.DetectData.data[this.TableChunkHintZH + nUnicode];
|
||||
} else {
|
||||
_glyph_slot = this.DetectData.data[this.TableChunkHintEA + nUnicode];
|
||||
}
|
||||
if (_glyph_slot == fontslot_EastAsia) {
|
||||
return _glyph_slot;
|
||||
}
|
||||
}
|
||||
if (bCS || bRTL) {
|
||||
return fontslot_CS;
|
||||
}
|
||||
return _glyph_slot;
|
||||
};
|
||||
}
|
||||
window["CDetectFontUse"] = CDetectFontUse;
|
||||
})(window.document);
|
||||
var g_font_detector = new CDetectFontUse();
|
||||
g_font_detector.Init();
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,55 +0,0 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
function CGraphicFrame(drawingBase, drawingObjects) {
|
||||
this.drawingBase = drawingBase;
|
||||
this.drawingObjects = drawingObjects;
|
||||
this.obj = null;
|
||||
this.spPr = new CSpPr();
|
||||
this.transform = new CMatrix();
|
||||
this.group = null;
|
||||
}
|
||||
CGraphicFrame.prototype = {
|
||||
recalculate: function () {},
|
||||
recalculateTransform: function () {
|
||||
var xfrm = this.spPr.xfrm;
|
||||
this.transform.Reset();
|
||||
global_MatrixTransformer.TranslateAppend(this.transform, xfrm.offX, xfrm.offY);
|
||||
if (isRealObject(this.group)) {
|
||||
global_MatrixTransformer.MultiplyAppend(this.transform, this.group.getTransform());
|
||||
}
|
||||
},
|
||||
draw: function (graphics) {
|
||||
if (isRealObject(this.obj)) {
|
||||
this.obj.draw(graphics);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,222 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2015
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
"use strict";
|
||||
CGroupShape.prototype.addToRecalculate = function () {
|
||||
if (this.drawingObjects && this.drawingObjects.controller) {
|
||||
this.drawingObjects.controller.objectsForRecalculate[this.Id] = this;
|
||||
}
|
||||
};
|
||||
CGroupShape.prototype.handleUpdateFill = function () {
|
||||
for (var i = 0; i < this.spTree.length; ++i) {
|
||||
this.spTree[i].handleUpdateFill();
|
||||
}
|
||||
this.addToRecalculate();
|
||||
};
|
||||
CGroupShape.prototype.handleUpdateLn = function () {
|
||||
for (var i = 0; i < this.spTree.length; ++i) {
|
||||
this.spTree[i].handleUpdateLn();
|
||||
}
|
||||
this.addToRecalculate();
|
||||
};
|
||||
CGroupShape.prototype.recalcText = function () {
|
||||
if (this.spTree) {
|
||||
for (var i = 0; i < this.spTree.length; ++i) {
|
||||
if (this.spTree[i].recalcText) {
|
||||
this.spTree[i].recalcText();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
CGroupShape.prototype.setRecalculateInfo = function () {
|
||||
var recalcInfo = this.recalcInfo;
|
||||
this.recalcInfo = {
|
||||
recalculateBrush: true,
|
||||
recalculatePen: true,
|
||||
recalculateTransform: true,
|
||||
recalculateArrGraphicObjects: true,
|
||||
recalculateBounds: true,
|
||||
recalculateScaleCoefficients: true
|
||||
};
|
||||
this.localTransform = new CMatrix();
|
||||
this.bounds = {
|
||||
l: 0,
|
||||
t: 0,
|
||||
r: 0,
|
||||
b: 0,
|
||||
w: 0,
|
||||
h: 0
|
||||
};
|
||||
this.lockType = c_oAscLockTypes.kLockTypeNone;
|
||||
};
|
||||
CGroupShape.prototype.recalcTransform = function () {
|
||||
this.recalcInfo.recalculateScaleCoefficients = true;
|
||||
this.recalcInfo.recalculateTransform = true;
|
||||
for (var i = 0; i < this.spTree.length; ++i) {
|
||||
this.spTree[i].recalcTransform();
|
||||
}
|
||||
};
|
||||
CGroupShape.prototype.recalcBounds = function () {
|
||||
this.recalcInfo.recalculateBounds = true;
|
||||
};
|
||||
CGroupShape.prototype.addToDrawingObjects = CShape.prototype.addToDrawingObjects;
|
||||
CGroupShape.prototype.getDrawingObjectsController = CShape.prototype.getDrawingObjectsController;
|
||||
CGroupShape.prototype.setDrawingObjects = function (drawingObjects) {
|
||||
this.drawingObjects = drawingObjects;
|
||||
for (var i = 0; i < this.spTree.length; ++i) {
|
||||
this.spTree[i].setDrawingObjects(drawingObjects);
|
||||
}
|
||||
};
|
||||
CGroupShape.prototype.setWorksheet = function (worksheet) {
|
||||
History.Add(this, {
|
||||
Type: historyitem_AutoShapes_SetWorksheet,
|
||||
oldPr: this.worksheet,
|
||||
newPr: worksheet
|
||||
});
|
||||
this.worksheet = worksheet;
|
||||
for (var i = 0; i < this.spTree.length; ++i) {
|
||||
this.spTree[i].setWorksheet(worksheet);
|
||||
}
|
||||
};
|
||||
CGroupShape.prototype.setDrawingBase = CShape.prototype.setDrawingBase;
|
||||
CGroupShape.prototype.deleteDrawingBase = CShape.prototype.deleteDrawingBase;
|
||||
CGroupShape.prototype.addToRecalculate = CShape.prototype.addToRecalculate;
|
||||
CGroupShape.prototype.convertPixToMM = CShape.prototype.convertPixToMM;
|
||||
CGroupShape.prototype.getCanvasContext = CShape.prototype.getCanvasContext;
|
||||
CGroupShape.prototype.getHierarchy = CShape.prototype.getHierarchy;
|
||||
CGroupShape.prototype.getParentObjects = CShape.prototype.getParentObjects;
|
||||
CGroupShape.prototype.recalculateTransform = CShape.prototype.recalculateTransform;
|
||||
CGroupShape.prototype.recalculateBounds = function () {
|
||||
var sp_tree = this.spTree;
|
||||
var x_arr_max = [],
|
||||
y_arr_max = [],
|
||||
x_arr_min = [],
|
||||
y_arr_min = [];
|
||||
for (var i = 0; i < sp_tree.length; ++i) {
|
||||
sp_tree[i].recalculate();
|
||||
var bounds = sp_tree[i].bounds;
|
||||
var l = bounds.l;
|
||||
var r = bounds.r;
|
||||
var t = bounds.t;
|
||||
var b = bounds.b;
|
||||
x_arr_max.push(r);
|
||||
x_arr_min.push(l);
|
||||
y_arr_max.push(b);
|
||||
y_arr_min.push(t);
|
||||
}
|
||||
if (!this.group) {
|
||||
var tr = this.localTransform;
|
||||
var arr_p_x = [];
|
||||
var arr_p_y = [];
|
||||
arr_p_x.push(tr.TransformPointX(0, 0));
|
||||
arr_p_y.push(tr.TransformPointY(0, 0));
|
||||
arr_p_x.push(tr.TransformPointX(this.extX, 0));
|
||||
arr_p_y.push(tr.TransformPointY(this.extX, 0));
|
||||
arr_p_x.push(tr.TransformPointX(this.extX, this.extY));
|
||||
arr_p_y.push(tr.TransformPointY(this.extX, this.extY));
|
||||
arr_p_x.push(tr.TransformPointX(0, this.extY));
|
||||
arr_p_y.push(tr.TransformPointY(0, this.extY));
|
||||
x_arr_max = x_arr_max.concat(arr_p_x);
|
||||
x_arr_min = x_arr_min.concat(arr_p_x);
|
||||
y_arr_max = y_arr_max.concat(arr_p_y);
|
||||
y_arr_min = y_arr_min.concat(arr_p_y);
|
||||
}
|
||||
this.bounds.x = Math.min.apply(Math, x_arr_min);
|
||||
this.bounds.y = Math.min.apply(Math, y_arr_min);
|
||||
this.bounds.l = this.bounds.x;
|
||||
this.bounds.t = this.bounds.y;
|
||||
this.bounds.r = Math.max.apply(Math, x_arr_max);
|
||||
this.bounds.b = Math.max.apply(Math, y_arr_max);
|
||||
this.bounds.w = this.bounds.r - this.bounds.l;
|
||||
this.bounds.h = this.bounds.b - this.bounds.t;
|
||||
if (this.drawingBase && !this.group) {
|
||||
this.drawingBase.checkBoundsFromTo();
|
||||
}
|
||||
};
|
||||
CGroupShape.prototype.deselect = CShape.prototype.deselect;
|
||||
CGroupShape.prototype.hitToHandles = CShape.prototype.hitToHandles;
|
||||
CGroupShape.prototype.hitInBoundingRect = CShape.prototype.hitInBoundingRect;
|
||||
CGroupShape.prototype.getRotateAngle = CShape.prototype.getRotateAngle;
|
||||
CGroupShape.prototype.handleUpdatePosition = function () {
|
||||
this.recalcTransform();
|
||||
this.addToRecalculate();
|
||||
for (var i = 0; i < this.spTree.length; ++i) {
|
||||
if (this.spTree[i].handleUpdatePosition) {
|
||||
this.spTree[i].handleUpdatePosition();
|
||||
}
|
||||
}
|
||||
this.recalcBounds();
|
||||
this.addToRecalculate();
|
||||
delete this.fromSerialize;
|
||||
};
|
||||
CGroupShape.prototype.handleUpdateExtents = function () {
|
||||
this.recalcTransform();
|
||||
this.recalcBounds();
|
||||
this.addToRecalculate();
|
||||
delete this.fromSerialize;
|
||||
};
|
||||
CGroupShape.prototype.handleUpdateRot = CGroupShape.prototype.handleUpdatePosition;
|
||||
CGroupShape.prototype.handleUpdateFlip = CGroupShape.prototype.handleUpdatePosition;
|
||||
CGroupShape.prototype.handleUpdateChildOffset = CGroupShape.prototype.handleUpdatePosition;
|
||||
CGroupShape.prototype.handleUpdateChildExtents = CGroupShape.prototype.handleUpdatePosition;
|
||||
CGroupShape.prototype.updatePosition = CShape.prototype.updatePosition;
|
||||
CGroupShape.prototype.recalculate = function () {
|
||||
if (this.bDeleted) {
|
||||
return;
|
||||
}
|
||||
ExecuteNoHistory(function () {
|
||||
if (this.recalcInfo.recalculateBrush) {
|
||||
this.recalculateBrush();
|
||||
this.recalcInfo.recalculateBrush = false;
|
||||
}
|
||||
if (this.recalcInfo.recalculatePen) {
|
||||
this.recalculatePen();
|
||||
this.recalcInfo.recalculatePen = false;
|
||||
}
|
||||
if (this.recalcInfo.recalculateTransform) {
|
||||
this.recalculateTransform();
|
||||
this.calculateSnapArrays();
|
||||
this.recalcInfo.recalculateTransform = false;
|
||||
}
|
||||
if (this.recalcInfo.recalculateArrGraphicObjects) {
|
||||
this.recalculateArrGraphicObjects();
|
||||
this.recalcInfo.recalculateArrGraphicObjects = false;
|
||||
}
|
||||
for (var i = 0; i < this.spTree.length; ++i) {
|
||||
this.spTree[i].recalculate();
|
||||
}
|
||||
if (this.recalcInfo.recalculateBounds) {
|
||||
this.recalculateBounds();
|
||||
this.recalcInfo.recalculateBounds = false;
|
||||
}
|
||||
},
|
||||
this, []);
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,179 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2015
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
"use strict";
|
||||
CImageShape.prototype.addToDrawingObjects = CShape.prototype.addToDrawingObjects;
|
||||
CImageShape.prototype.setDrawingObjects = CShape.prototype.setDrawingObjects;
|
||||
CImageShape.prototype.setDrawingBase = CShape.prototype.setDrawingBase;
|
||||
CImageShape.prototype.deleteDrawingBase = CShape.prototype.deleteDrawingBase;
|
||||
CImageShape.prototype.addToRecalculate = CShape.prototype.addToRecalculate;
|
||||
CImageShape.prototype.convertPixToMM = CShape.prototype.convertPixToMM;
|
||||
CImageShape.prototype.getCanvasContext = CShape.prototype.getCanvasContext;
|
||||
CImageShape.prototype.getHierarchy = CShape.prototype.getHierarchy;
|
||||
CImageShape.prototype.getParentObjects = CShape.prototype.getParentObjects;
|
||||
CImageShape.prototype.recalculateTransform = CShape.prototype.recalculateTransform;
|
||||
CImageShape.prototype.recalculateBounds = CShape.prototype.recalculateBounds;
|
||||
CImageShape.prototype.deselect = CShape.prototype.deselect;
|
||||
CImageShape.prototype.hitToHandles = CShape.prototype.hitToHandles;
|
||||
CImageShape.prototype.hitInBoundingRect = CShape.prototype.hitInBoundingRect;
|
||||
CImageShape.prototype.getRotateAngle = CShape.prototype.getRotateAngle;
|
||||
CImageShape.prototype.setWorksheet = CShape.prototype.setWorksheet;
|
||||
CImageShape.prototype.getDrawingObjectsController = CShape.prototype.getDrawingObjectsController;
|
||||
CImageShape.prototype.setRecalculateInfo = function () {
|
||||
this.recalcInfo = {
|
||||
recalculateBrush: true,
|
||||
recalculatePen: true,
|
||||
recalculateTransform: true,
|
||||
recalculateBounds: true,
|
||||
recalculateGeometry: true,
|
||||
recalculateStyle: true,
|
||||
recalculateFill: true,
|
||||
recalculateLine: true,
|
||||
recalculateTransparent: true
|
||||
};
|
||||
this.bounds = {
|
||||
l: 0,
|
||||
t: 0,
|
||||
r: 0,
|
||||
b: 0,
|
||||
w: 0,
|
||||
h: 0
|
||||
};
|
||||
this.lockType = c_oAscLockTypes.kLockTypeNone;
|
||||
};
|
||||
CImageShape.prototype.recalcBrush = function () {
|
||||
this.recalcInfo.recalculateBrush = true;
|
||||
};
|
||||
CImageShape.prototype.recalcPen = function () {
|
||||
this.recalcInfo.recalculatePen = true;
|
||||
};
|
||||
CImageShape.prototype.recalcTransform = function () {
|
||||
this.recalcInfo.recalculateTransform = true;
|
||||
};
|
||||
CImageShape.prototype.recalcBounds = function () {
|
||||
this.recalcInfo.recalculateBounds = true;
|
||||
};
|
||||
CImageShape.prototype.recalcGeometry = function () {
|
||||
this.recalcInfo.recalculateGeometry = true;
|
||||
};
|
||||
CImageShape.prototype.recalcStyle = function () {
|
||||
this.recalcInfo.recalculateStyle = true;
|
||||
};
|
||||
CImageShape.prototype.recalcFill = function () {
|
||||
this.recalcInfo.recalculateFill = true;
|
||||
};
|
||||
CImageShape.prototype.recalcLine = function () {
|
||||
this.recalcInfo.recalculateLine = true;
|
||||
};
|
||||
CImageShape.prototype.recalcTransparent = function () {
|
||||
this.recalcInfo.recalculateTransparent = true;
|
||||
};
|
||||
CImageShape.prototype.handleUpdatePosition = function () {
|
||||
this.recalcTransform();
|
||||
this.recalcBounds();
|
||||
this.addToRecalculate();
|
||||
delete this.fromSerialize;
|
||||
};
|
||||
CImageShape.prototype.handleUpdateExtents = function () {
|
||||
this.recalcGeometry();
|
||||
this.recalcBounds();
|
||||
this.recalcTransform();
|
||||
this.addToRecalculate();
|
||||
delete this.fromSerialize;
|
||||
};
|
||||
CImageShape.prototype.handleUpdateRot = function () {
|
||||
this.recalcTransform();
|
||||
this.recalcBounds();
|
||||
this.addToRecalculate();
|
||||
delete this.fromSerialize;
|
||||
};
|
||||
CImageShape.prototype.handleUpdateFlip = function () {
|
||||
this.recalcTransform();
|
||||
this.addToRecalculate();
|
||||
delete this.fromSerialize;
|
||||
};
|
||||
CImageShape.prototype.handleUpdateFill = function () {
|
||||
this.recalcBrush();
|
||||
this.addToRecalculate();
|
||||
};
|
||||
CImageShape.prototype.handleUpdateLn = function () {
|
||||
this.recalcLine();
|
||||
this.addToRecalculate();
|
||||
};
|
||||
CImageShape.prototype.handleUpdateGeometry = function () {
|
||||
this.recalcBounds();
|
||||
this.recalcGeometry();
|
||||
this.addToRecalculate();
|
||||
};
|
||||
CImageShape.prototype.convertPixToMM = CShape.prototype.convertPixToMM;
|
||||
CImageShape.prototype.getCanvasContext = CShape.prototype.getCanvasContext;
|
||||
CImageShape.prototype.getCompiledStyle = CShape.prototype.getCompiledStyle;
|
||||
CImageShape.prototype.getHierarchy = CShape.prototype.getHierarchy;
|
||||
CImageShape.prototype.getParentObjects = CShape.prototype.getParentObjects;
|
||||
CImageShape.prototype.recalculate = function () {
|
||||
if (this.bDeleted) {
|
||||
return;
|
||||
}
|
||||
ExecuteNoHistory(function () {
|
||||
if (this.recalcInfo.recalculateBrush) {
|
||||
this.recalculateBrush();
|
||||
this.recalcInfo.recalculateBrush = false;
|
||||
}
|
||||
if (this.recalcInfo.recalculatePen) {
|
||||
this.recalculatePen();
|
||||
this.recalcInfo.recalculatePen = false;
|
||||
}
|
||||
if (this.recalcInfo.recalculateTransform) {
|
||||
this.recalculateTransform();
|
||||
this.calculateSnapArrays();
|
||||
this.recalcInfo.recalculateTransform = false;
|
||||
}
|
||||
if (this.recalcInfo.recalculateGeometry) {
|
||||
this.recalculateGeometry();
|
||||
this.recalcInfo.recalculateGeometry = false;
|
||||
}
|
||||
if (this.recalcInfo.recalculateBounds) {
|
||||
this.recalculateBounds();
|
||||
this.recalcInfo.recalculateBounds = false;
|
||||
}
|
||||
},
|
||||
this, []);
|
||||
};
|
||||
CImageShape.prototype.recalculateBounds = CShape.prototype.recalculateBounds;
|
||||
CImageShape.prototype.hitInInnerArea = CShape.prototype.hitInInnerArea;
|
||||
CImageShape.prototype.hitInPath = CShape.prototype.hitInPath;
|
||||
CImageShape.prototype.hitToHandles = CShape.prototype.hitToHandles;
|
||||
CImageShape.prototype.hitInBoundingRect = CShape.prototype.hitInBoundingRect;
|
||||
CImageShape.prototype.getNumByCardDirection = CShape.prototype.getNumByCardDirection;
|
||||
CImageShape.prototype.getCardDirectionByNum = CShape.prototype.getCardDirectionByNum;
|
||||
CImageShape.prototype.getResizeCoefficients = CShape.prototype.getResizeCoefficients;
|
||||
CImageShape.prototype.check_bounds = CShape.prototype.check_bounds;
|
||||
CImageShape.prototype.normalize = CShape.prototype.normalize;
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,428 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2015
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
"use strict";
|
||||
var G_O_DEFAULT_COLOR_MAP = GenerateDefaultColorMap();
|
||||
CShape.prototype.setDrawingObjects = function (drawingObjects) {};
|
||||
CShape.prototype.setWorksheet = function (worksheet) {
|
||||
History.Add(this, {
|
||||
Type: historyitem_AutoShapes_SetWorksheet,
|
||||
oldPr: this.worksheet,
|
||||
newPr: worksheet
|
||||
});
|
||||
this.worksheet = worksheet;
|
||||
if (this.spTree) {
|
||||
for (var i = 0; i < this.spTree.length; ++i) {
|
||||
this.spTree[i].setWorksheet(worksheet);
|
||||
}
|
||||
}
|
||||
};
|
||||
CShape.prototype.setDrawingBase = function (drawingBase) {
|
||||
this.drawingBase = drawingBase;
|
||||
if (Array.isArray(this.spTree)) {
|
||||
for (var i = 0; i < this.spTree.length; ++i) {
|
||||
this.spTree[i].setDrawingBase(drawingBase);
|
||||
}
|
||||
}
|
||||
};
|
||||
CShape.prototype.getDrawingObjectsController = function () {
|
||||
var wsViews = Asc["editor"] && Asc["editor"].wb && Asc["editor"].wb.wsViews;
|
||||
if (wsViews) {
|
||||
for (var i = 0; i < wsViews.length; ++i) {
|
||||
if (wsViews[i] && wsViews[i].model === this.worksheet && wsViews[i].objectRender) {
|
||||
return wsViews[i].objectRender.controller;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
function addToDrawings(worksheet, graphic, position, lockByDefault, anchor) {
|
||||
var drawingObjects;
|
||||
var wsViews = Asc["editor"].wb.wsViews;
|
||||
for (var i = 0; i < wsViews.length; ++i) {
|
||||
if (wsViews[i] && wsViews[i].model === worksheet) {
|
||||
drawingObjects = wsViews[i].objectRender;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!drawingObjects) {
|
||||
drawingObjects = new DrawingObjects();
|
||||
}
|
||||
var oldDrawingBase = graphic.drawingBase;
|
||||
var drawingObject = drawingObjects.createDrawingObject(anchor);
|
||||
drawingObject.graphicObject = graphic;
|
||||
graphic.setDrawingBase(drawingObject);
|
||||
if (!worksheet) {
|
||||
return;
|
||||
}
|
||||
var ret, aObjects = worksheet.Drawings;
|
||||
if (isRealNumber(position)) {
|
||||
aObjects.splice(position, 0, drawingObject);
|
||||
ret = position;
|
||||
} else {
|
||||
ret = aObjects.length;
|
||||
aObjects.push(drawingObject);
|
||||
}
|
||||
if (oldDrawingBase) {
|
||||
drawingObject.from.col = oldDrawingBase.from.col;
|
||||
drawingObject.from.colOff = oldDrawingBase.from.colOff;
|
||||
drawingObject.from.row = oldDrawingBase.from.row;
|
||||
drawingObject.from.rowOff = oldDrawingBase.from.rowOff;
|
||||
drawingObject.to.col = oldDrawingBase.to.col;
|
||||
drawingObject.to.colOff = oldDrawingBase.to.colOff;
|
||||
drawingObject.to.row = oldDrawingBase.to.row;
|
||||
drawingObject.to.rowOff = oldDrawingBase.to.rowOff;
|
||||
}
|
||||
if (graphic.recalcTransform) {
|
||||
graphic.recalcTransform();
|
||||
if (graphic.recalcBounds) {
|
||||
graphic.recalcBounds();
|
||||
}
|
||||
graphic.addToRecalculate();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
function deleteDrawingBase(aObjects, graphicId) {
|
||||
var position = null;
|
||||
for (var i = 0; i < aObjects.length; i++) {
|
||||
if (aObjects[i].graphicObject.Get_Id() == graphicId) {
|
||||
aObjects.splice(i, 1);
|
||||
position = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return position;
|
||||
}
|
||||
CShape.prototype.addToDrawingObjects = function (pos) {
|
||||
var controller = this.getDrawingObjectsController();
|
||||
var position = addToDrawings(this.worksheet, this, pos, undefined, undefined);
|
||||
var data = {
|
||||
Type: historyitem_AutoShapes_AddToDrawingObjects,
|
||||
Pos: position
|
||||
};
|
||||
History.Add(this, data);
|
||||
this.worksheet.addContentChanges(new CContentChangesElement(contentchanges_Add, data.Pos, 1, data));
|
||||
};
|
||||
CShape.prototype.deleteDrawingBase = function () {
|
||||
var position = deleteDrawingBase(this.worksheet.Drawings, this.Get_Id());
|
||||
if (isRealNumber(position)) {
|
||||
var data = {
|
||||
Type: historyitem_AutoShapes_RemoveFromDrawingObjects,
|
||||
Pos: position
|
||||
};
|
||||
History.Add(this, data);
|
||||
this.worksheet.addContentChanges(new CContentChangesElement(contentchanges_Remove, data.Pos, 1, data));
|
||||
}
|
||||
return position;
|
||||
};
|
||||
function getDrawingObjects_Sp(sp) {
|
||||
var controller = sp.getDrawingObjectsController();
|
||||
return controller && controller.drawingObjects;
|
||||
}
|
||||
CShape.prototype.setRecalculateInfo = function () {
|
||||
this.recalcInfo = {
|
||||
recalculateContent: true,
|
||||
recalculateBrush: true,
|
||||
recalculatePen: true,
|
||||
recalculateTransform: true,
|
||||
recalculateTransformText: true,
|
||||
recalculateBounds: true,
|
||||
recalculateGeometry: true,
|
||||
recalculateStyle: true,
|
||||
recalculateFill: true,
|
||||
recalculateLine: true,
|
||||
recalculateTransparent: true,
|
||||
recalculateTextStyles: [true, true, true, true, true, true, true, true, true]
|
||||
};
|
||||
this.compiledStyles = [];
|
||||
this.textPropsForRecalc = [];
|
||||
this.bounds = {
|
||||
l: 0,
|
||||
t: 0,
|
||||
r: 0,
|
||||
b: 0,
|
||||
w: 0,
|
||||
h: 0
|
||||
};
|
||||
this.lockType = c_oAscLockTypes.kLockTypeNone;
|
||||
};
|
||||
CShape.prototype.recalcContent = function () {
|
||||
this.recalcInfo.recalculateContent = true;
|
||||
};
|
||||
CShape.prototype.getDrawingDocument = function () {
|
||||
if (this.worksheet) {
|
||||
return this.worksheet.DrawingDocument;
|
||||
}
|
||||
var drawingObjects = getDrawingObjects_Sp(this);
|
||||
return drawingObjects && drawingObjects.drawingDocument;
|
||||
};
|
||||
CShape.prototype.recalcBrush = function () {
|
||||
this.recalcInfo.recalculateBrush = true;
|
||||
};
|
||||
CShape.prototype.recalcPen = function () {
|
||||
this.recalcInfo.recalculatePen = true;
|
||||
};
|
||||
CShape.prototype.recalcTransform = function () {
|
||||
this.recalcInfo.recalculateTransform = true;
|
||||
};
|
||||
CShape.prototype.recalcTransformText = function () {
|
||||
this.recalcInfo.recalculateTransformText = true;
|
||||
};
|
||||
CShape.prototype.recalcBounds = function () {
|
||||
this.recalcInfo.recalculateBounds = true;
|
||||
};
|
||||
CShape.prototype.recalcGeometry = function () {
|
||||
this.recalcInfo.recalculateGeometry = true;
|
||||
};
|
||||
CShape.prototype.recalcStyle = function () {
|
||||
this.recalcInfo.recalculateStyle = true;
|
||||
};
|
||||
CShape.prototype.recalcFill = function () {
|
||||
this.recalcInfo.recalculateFill = true;
|
||||
};
|
||||
CShape.prototype.recalcLine = function () {
|
||||
this.recalcInfo.recalculateLine = true;
|
||||
};
|
||||
CShape.prototype.recalcTransparent = function () {
|
||||
this.recalcInfo.recalculateTransparent = true;
|
||||
};
|
||||
CShape.prototype.recalcTextStyles = function () {
|
||||
this.recalcInfo.recalculateTextStyles = [true, true, true, true, true, true, true, true, true];
|
||||
};
|
||||
CShape.prototype.addToRecalculate = function () {
|
||||
var controller = this.getDrawingObjectsController && this.getDrawingObjectsController();
|
||||
if (controller) {
|
||||
controller.objectsForRecalculate[this.Id] = this;
|
||||
}
|
||||
};
|
||||
CShape.prototype.handleUpdatePosition = function () {
|
||||
this.recalcTransform();
|
||||
this.recalcBounds();
|
||||
this.recalcTransformText();
|
||||
this.addToRecalculate();
|
||||
delete this.fromSerialize;
|
||||
};
|
||||
CShape.prototype.handleUpdateExtents = function () {
|
||||
this.recalcContent();
|
||||
this.recalcGeometry();
|
||||
this.recalcBounds();
|
||||
this.recalcTransform();
|
||||
this.recalcContent();
|
||||
this.addToRecalculate();
|
||||
delete this.fromSerialize;
|
||||
};
|
||||
CShape.prototype.handleUpdateRot = function () {
|
||||
this.recalcTransform();
|
||||
if (this.txBody && this.txBody.bodyPr && this.txBody.bodyPr.upright) {
|
||||
this.recalcContent();
|
||||
}
|
||||
this.recalcTransformText();
|
||||
this.recalcBounds();
|
||||
this.addToRecalculate();
|
||||
delete this.fromSerialize;
|
||||
};
|
||||
CShape.prototype.handleUpdateFlip = function () {
|
||||
this.recalcTransform();
|
||||
this.recalcTransformText();
|
||||
this.recalcContent();
|
||||
this.addToRecalculate();
|
||||
delete this.fromSerialize;
|
||||
};
|
||||
CShape.prototype.handleUpdateFill = function () {
|
||||
this.recalcBrush();
|
||||
this.recalcFill();
|
||||
this.recalcTransparent();
|
||||
this.addToRecalculate();
|
||||
};
|
||||
CShape.prototype.handleUpdateLn = function () {
|
||||
this.recalcPen();
|
||||
this.recalcLine();
|
||||
this.addToRecalculate();
|
||||
};
|
||||
CShape.prototype.handleUpdateGeometry = function () {
|
||||
this.recalcBounds();
|
||||
this.recalcGeometry();
|
||||
this.addToRecalculate();
|
||||
};
|
||||
CShape.prototype.convertPixToMM = function (pix) {
|
||||
var drawingObjects = getDrawingObjects_Sp(this);
|
||||
return drawingObjects ? drawingObjects.convertMetric(pix, 0, 3) : 0;
|
||||
};
|
||||
CShape.prototype.getCanvasContext = function () {
|
||||
var drawingObjects = getDrawingObjects_Sp(this);
|
||||
return drawingObjects ? drawingObjects.getCanvasContext() : null;
|
||||
};
|
||||
CShape.prototype.getCompiledStyle = function () {
|
||||
return this.style;
|
||||
};
|
||||
CShape.prototype.getHierarchy = function () {
|
||||
return [];
|
||||
};
|
||||
CShape.prototype.getParentObjects = function () {
|
||||
return {
|
||||
slide: null,
|
||||
layout: null,
|
||||
master: null,
|
||||
theme: window["Asc"]["editor"].wbModel.theme
|
||||
};
|
||||
};
|
||||
CShape.prototype.recalcText = function () {
|
||||
this.recalcInfo.recalculateContent = true;
|
||||
this.recalcInfo.recalculateTransformText = true;
|
||||
};
|
||||
CShape.prototype.recalculate = function () {
|
||||
if (this.bDeleted) {
|
||||
return;
|
||||
}
|
||||
ExecuteNoHistory(function () {
|
||||
if (this.recalcInfo.recalculateBrush) {
|
||||
this.recalculateBrush();
|
||||
this.recalcInfo.recalculateBrush = false;
|
||||
}
|
||||
if (this.recalcInfo.recalculatePen) {
|
||||
this.recalculatePen();
|
||||
this.recalcInfo.recalculatePen = false;
|
||||
}
|
||||
if (this.recalcInfo.recalculateTransform) {
|
||||
this.recalculateTransform();
|
||||
this.calculateSnapArrays();
|
||||
this.recalcInfo.recalculateTransform = false;
|
||||
}
|
||||
if (this.recalcInfo.recalculateGeometry) {
|
||||
this.recalculateGeometry();
|
||||
this.recalcInfo.recalculateGeometry = false;
|
||||
}
|
||||
if (this.recalcInfo.recalculateContent) {
|
||||
this.recalculateContent();
|
||||
this.recalcInfo.recalculateContent = false;
|
||||
}
|
||||
if (this.recalcInfo.recalculateTransformText) {
|
||||
this.recalculateTransformText();
|
||||
}
|
||||
if (this.recalcInfo.recalculateBounds) {
|
||||
this.recalculateBounds();
|
||||
this.recalcInfo.recalculateBounds = false;
|
||||
}
|
||||
},
|
||||
this, []);
|
||||
};
|
||||
CShape.prototype.recalculateBounds = function () {
|
||||
var boundsChecker = new CSlideBoundsChecker();
|
||||
this.draw(boundsChecker);
|
||||
boundsChecker.CorrectBounds();
|
||||
this.bounds.x = boundsChecker.Bounds.min_x;
|
||||
this.bounds.y = boundsChecker.Bounds.min_y;
|
||||
this.bounds.l = boundsChecker.Bounds.min_x;
|
||||
this.bounds.t = boundsChecker.Bounds.min_y;
|
||||
this.bounds.r = boundsChecker.Bounds.max_x;
|
||||
this.bounds.b = boundsChecker.Bounds.max_y;
|
||||
this.bounds.w = boundsChecker.Bounds.max_x - boundsChecker.Bounds.min_x;
|
||||
this.bounds.h = boundsChecker.Bounds.max_y - boundsChecker.Bounds.min_y;
|
||||
if (this.drawingBase && !this.group) {
|
||||
this.drawingBase.checkBoundsFromTo();
|
||||
}
|
||||
};
|
||||
CShape.prototype.recalculateContent = function () {
|
||||
var content = this.getDocContent();
|
||||
if (content) {
|
||||
var w, h;
|
||||
var l_ins, t_ins, r_ins, b_ins;
|
||||
var body_pr = this.getBodyPr();
|
||||
if (body_pr) {
|
||||
l_ins = isRealNumber(body_pr.lIns) ? body_pr.lIns : 2.54;
|
||||
r_ins = isRealNumber(body_pr.rIns) ? body_pr.rIns : 2.54;
|
||||
t_ins = isRealNumber(body_pr.tIns) ? body_pr.tIns : 1.27;
|
||||
b_ins = isRealNumber(body_pr.bIns) ? body_pr.bIns : 1.27;
|
||||
} else {
|
||||
l_ins = 2.54;
|
||||
r_ins = 2.54;
|
||||
t_ins = 1.27;
|
||||
b_ins = 1.27;
|
||||
}
|
||||
if (this.spPr.geometry && this.spPr.geometry.rect && isRealNumber(this.spPr.geometry.rect.l) && isRealNumber(this.spPr.geometry.rect.t) && isRealNumber(this.spPr.geometry.rect.r) && isRealNumber(this.spPr.geometry.rect.r)) {
|
||||
w = this.spPr.geometry.rect.r - this.spPr.geometry.rect.l - (l_ins + r_ins);
|
||||
h = this.spPr.geometry.rect.b - this.spPr.geometry.rect.t - (t_ins + b_ins);
|
||||
} else {
|
||||
w = this.extX - (l_ins + r_ins);
|
||||
h = this.extY - (t_ins + b_ins);
|
||||
}
|
||||
if (this.txBody) {
|
||||
if (!body_pr.upright) {
|
||||
if (! (body_pr.vert === nVertTTvert || body_pr.vert === nVertTTvert270)) {
|
||||
this.txBody.contentWidth = w;
|
||||
this.txBody.contentHeight = h;
|
||||
} else {
|
||||
this.txBody.contentWidth = h;
|
||||
this.txBody.contentHeight = w;
|
||||
}
|
||||
} else {
|
||||
var _full_rotate = this.getFullRotate();
|
||||
if (checkNormalRotate(_full_rotate)) {
|
||||
if (! (body_pr.vert === nVertTTvert || body_pr.vert === nVertTTvert270)) {
|
||||
this.txBody.contentWidth = w;
|
||||
this.txBody.contentHeight = h;
|
||||
} else {
|
||||
this.txBody.contentWidth = h;
|
||||
this.txBody.contentHeight = w;
|
||||
}
|
||||
} else {
|
||||
if (! (body_pr.vert === nVertTTvert || body_pr.vert === nVertTTvert270)) {
|
||||
this.txBody.contentWidth = h;
|
||||
this.txBody.contentHeight = w;
|
||||
} else {
|
||||
this.txBody.contentWidth = w;
|
||||
this.txBody.contentHeight = h;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.contentWidth = this.txBody.contentWidth;
|
||||
this.contentHeight = this.txBody.contentHeight;
|
||||
content.Set_StartPage(0);
|
||||
content.Reset(0, 0, w, 20000);
|
||||
content.Recalculate_Page(content.StartPage, true);
|
||||
}
|
||||
};
|
||||
CShape.prototype.Get_ColorMap = function () {
|
||||
return G_O_DEFAULT_COLOR_MAP;
|
||||
};
|
||||
CShape.prototype.getStyles = function (index) {
|
||||
return this.Get_Styles(index);
|
||||
};
|
||||
CShape.prototype.Get_Worksheet = function () {
|
||||
return this.worksheet;
|
||||
};
|
||||
CTextBody.prototype.Get_Worksheet = function () {
|
||||
return this.parent && this.parent.Get_Worksheet && this.parent.Get_Worksheet();
|
||||
};
|
||||
CTextBody.prototype.getDrawingDocument = function () {
|
||||
return this.parent && this.parent.getDrawingDocument && this.parent.getDrawingDocument();
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user