init repo
This commit is contained in:
1880
OfficeWeb/sdk/Excel/model/DrawingObjects/Format/Chart.js
vendored
Normal file
1880
OfficeWeb/sdk/Excel/model/DrawingObjects/Format/Chart.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
175
OfficeWeb/sdk/Excel/model/DrawingObjects/Format/ChartLayout.js
Normal file
175
OfficeWeb/sdk/Excel/model/DrawingObjects/Format/ChartLayout.js
Normal file
@@ -0,0 +1,175 @@
|
||||
/*
|
||||
* (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();
|
||||
}
|
||||
}
|
||||
};
|
||||
238
OfficeWeb/sdk/Excel/model/DrawingObjects/Format/ChartLegend.js
Normal file
238
OfficeWeb/sdk/Excel/model/DrawingObjects/Format/ChartLegend.js
Normal file
@@ -0,0 +1,238 @@
|
||||
/*
|
||||
* (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);
|
||||
}
|
||||
}
|
||||
};
|
||||
977
OfficeWeb/sdk/Excel/model/DrawingObjects/Format/ChartTitle.js
Normal file
977
OfficeWeb/sdk/Excel/model/DrawingObjects/Format/ChartTitle.js
Normal file
@@ -0,0 +1,977 @@
|
||||
/*
|
||||
* (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();
|
||||
}
|
||||
}
|
||||
};
|
||||
5385
OfficeWeb/sdk/Excel/model/DrawingObjects/Format/DocumentContent.js
Normal file
5385
OfficeWeb/sdk/Excel/model/DrawingObjects/Format/DocumentContent.js
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,805 @@
|
||||
/*
|
||||
* (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();
|
||||
5734
OfficeWeb/sdk/Excel/model/DrawingObjects/Format/Format.js
Normal file
5734
OfficeWeb/sdk/Excel/model/DrawingObjects/Format/Format.js
Normal file
File diff suppressed because it is too large
Load Diff
1453
OfficeWeb/sdk/Excel/model/DrawingObjects/Format/Geometry.js
Normal file
1453
OfficeWeb/sdk/Excel/model/DrawingObjects/Format/Geometry.js
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* (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);
|
||||
}
|
||||
}
|
||||
};
|
||||
1854
OfficeWeb/sdk/Excel/model/DrawingObjects/Format/GroupShape.js
Normal file
1854
OfficeWeb/sdk/Excel/model/DrawingObjects/Format/GroupShape.js
Normal file
File diff suppressed because it is too large
Load Diff
1186
OfficeWeb/sdk/Excel/model/DrawingObjects/Format/Image.js
Normal file
1186
OfficeWeb/sdk/Excel/model/DrawingObjects/Format/Image.js
Normal file
File diff suppressed because it is too large
Load Diff
1479
OfficeWeb/sdk/Excel/model/DrawingObjects/Format/Numbering.js
Normal file
1479
OfficeWeb/sdk/Excel/model/DrawingObjects/Format/Numbering.js
Normal file
File diff suppressed because it is too large
Load Diff
8667
OfficeWeb/sdk/Excel/model/DrawingObjects/Format/Paragraph.js
Normal file
8667
OfficeWeb/sdk/Excel/model/DrawingObjects/Format/Paragraph.js
Normal file
File diff suppressed because it is too large
Load Diff
4907
OfficeWeb/sdk/Excel/model/DrawingObjects/Format/ParagraphContent.js
Normal file
4907
OfficeWeb/sdk/Excel/model/DrawingObjects/Format/ParagraphContent.js
Normal file
File diff suppressed because it is too large
Load Diff
1061
OfficeWeb/sdk/Excel/model/DrawingObjects/Format/Path.js
Normal file
1061
OfficeWeb/sdk/Excel/model/DrawingObjects/Format/Path.js
Normal file
File diff suppressed because it is too large
Load Diff
2828
OfficeWeb/sdk/Excel/model/DrawingObjects/Format/Shape.js
Normal file
2828
OfficeWeb/sdk/Excel/model/DrawingObjects/Format/Shape.js
Normal file
File diff suppressed because it is too large
Load Diff
4857
OfficeWeb/sdk/Excel/model/DrawingObjects/Format/Styles.js
Normal file
4857
OfficeWeb/sdk/Excel/model/DrawingObjects/Format/Styles.js
Normal file
File diff suppressed because it is too large
Load Diff
3847
OfficeWeb/sdk/Excel/model/DrawingObjects/Format/TextBody.js
Normal file
3847
OfficeWeb/sdk/Excel/model/DrawingObjects/Format/TextBody.js
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user