Commit 9416660a authored by Alexey.Musinov's avatar Alexey.Musinov

Merge branch 'develop' of https://github.com/ONLYOFFICE/sdkjs into develop

* 'develop' of https://github.com/ONLYOFFICE/sdkjs:
  MathToImageConverter
  fux bug with cursor
  add functions asc_setAttribute and asc_setColor from sparklines add c_oAscSparklineAttributes, c_oAscSparklineColors
parents 706fe16f 3d9f980b
......@@ -378,6 +378,34 @@ var c_oAscPopUpSelectorType = {
Custom: 2
};
var c_oAscSparklineAttributes = {
type: 1,
lineWeight: 2,
displayEmptyCellsAs: 4,
markers: 8,
high: 16,
low: 32,
first: 64,
last: 128,
negative: 256,
displayXAxis: 512,
displayHidden: 1024,
minAxisType: 2048,
maxAxisType: 4096,
rightToLeft: 8192
};
var c_oAscSparklineColors = {
Series: 1,
Negative: 2,
Axis: 4,
Markers: 8,
First: 16,
Last: 32,
High: 64,
Low: 128
};
//----------------------------------------------------------export----------------------------------------------------
window['AscCommonExcel'] = window['AscCommonExcel'] || {};
window['AscCommonExcel'].c_oAscAlignType = c_oAscAlignType;
......@@ -565,4 +593,30 @@ var c_oAscPopUpSelectorType = {
prot['Individual'] = prot.Individual;
prot['Group'] = prot.Group;
prot['Custom'] = prot.Custom;
window['Asc']['c_oAscSparklineAttributes'] = window['Asc'].c_oAscSparklineAttributes = c_oAscSparklineAttributes;
prot = c_oAscSparklineAttributes;
prot['type'] = prot.type;
prot['lineWeight'] = prot.lineWeight;
prot['displayEmptyCellsAs'] = prot.displayEmptyCellsAs;
prot['markers'] = prot.markers;
prot['high'] = prot.high;
prot['low'] = prot.low;
prot['first'] = prot.first;
prot['last'] = prot.last;
prot['negative'] = prot.negative;
prot['displayXAxis'] = prot.displayXAxis;
prot['displayHidden'] = prot.displayHidden;
prot['minAxisType'] = prot.minAxisType;
prot['maxAxisType'] = prot.maxAxisType;
prot['rightToLeft'] = prot.rightToLeft;
window['Asc']['c_oAscSparklineColors'] = window['Asc'].c_oAscSparklineColors = c_oAscSparklineColors;
prot = c_oAscSparklineColors;
prot['Series'] = prot.Series;
prot['Negative'] = prot.Negative;
prot['Axis'] = prot.Axis;
prot['Markers'] = prot.Markers;
prot['First'] = prot.First;
prot['Last'] = prot.Last;
prot['High'] = prot.High;
prot['Low'] = prot.Low;
})(window);
......@@ -443,6 +443,9 @@ var UndoRedoDataTypes = new function() {
this.DynamicFilter = 75;
this.Top10 = 76;
this.PropertyChanges = 79;
this.SparklineProps = 80;
this.Create = function(nType)
{
switch(nType)
......
......@@ -5696,7 +5696,7 @@ Woorksheet.prototype.updateSparklineCache = function(sheet, ranges) {
Woorksheet.prototype.getSparklineGroup = function(c, r) {
for (var i = 0; i < this.aSparklineGroups.length; ++i) {
if (-1 !== this.aSparklineGroups[i].contains(c, r)) {
return this.aSparklineGroups[i];
return this.aSparklineGroups[i].clone(true);
}
}
return null;
......
......@@ -4579,14 +4579,76 @@ CellArea.prototype = {
}
};
/** @constructor */
function propertyChanges() {
this.propertyObj = {};
}
propertyChanges.prototype.getType = function () {
return AscCommonExcel.UndoRedoDataTypes.PropertyChanges;
};
propertyChanges.prototype.getProperties = function () {
var res = {};
for (var i in this.propertyObj) {
res[i] = i;
}
return res;
};
propertyChanges.prototype.getProperty = function (nType) {
return this.propertyObj[nType];
};
propertyChanges.prototype.setProperty = function (nType, value) {
this.propertyObj[nType] = value;
};
/** @constructor */
function sparklineChanges() {
this.Properties = {
attributes: 0,
colors: 1
};
this.attributes = new propertyChanges();
this.colors = new propertyChanges();
}
sparklineChanges.prototype.getType = function () {
return AscCommonExcel.UndoRedoDataTypes.SparklineProps;
};
sparklineChanges.prototype.getProperties = function () {
return this.Properties;
};
sparklineChanges.prototype.getProperty = function (nType) {
switch (nType) {
case this.Properties.attributes:
return this.attributes;
break;
case this.Properties.colors:
return this.colors;
break;
}
return null;
};
sparklineChanges.prototype.setProperty = function (nType, value) {
switch (nType) {
case this.Properties.attributes:
this.attributes = value;
break;
case this.Properties.colors:
this.colors = value;
break;
}
};
sparklineChanges.prototype.setAttribute = function (type, value) {
this.attributes.setProperty(type, value);
};
sparklineChanges.prototype.setColor = function (type, value) {
this.colors.setProperty(type, value);
};
/** @constructor */
function sparklineGroup() {
// attributes
this.manualMax = undefined;
this.manualMin = undefined;
this.lineWeight = 0.75;
this.type = Asc.c_oAscSparklineType.Line;
this.dateAxis = false;
this.lineWeight = 0.75;
this.displayEmptyCellsAs = Asc.c_oAscEDispBlanksAs.Zero;
this.markers = false;
this.high = false;
......@@ -4600,6 +4662,10 @@ CellArea.prototype = {
this.maxAxisType = Asc.c_oAscSparklineAxisMinMax.Individual;
this.rightToLeft = false;
this.manualMax = undefined;
this.manualMin = undefined;
this.dateAxis = false;
// elements
this.colorSeries = null;
this.colorNegative = null;
......@@ -4609,6 +4675,7 @@ CellArea.prototype = {
this.colorLast = null;
this.colorHigh = null;
this.colorLow = null;
this.f = null;
this.arrSparklines = [];
this.arrCachedSparklines = [];
......@@ -4616,6 +4683,9 @@ CellArea.prototype = {
//for drawing preview
this.canvas = null;
this.sparklineView = null;
// for changes
this.sparklineChanges = null;
}
sparklineGroup.prototype.clone = function (onlyProps) {
......@@ -4692,6 +4762,20 @@ CellArea.prototype = {
}
return -1;
};
sparklineGroup.prototype.asc_setAttribute = function (type, value) {
if (!this.sparklineChanges) {
this.sparklineChanges = new sparklineChanges();
}
this.sparklineChanges.setAttribute(type, value);
};
sparklineGroup.prototype.asc_setColor = function (type, value) {
if (!this.sparklineChanges) {
this.sparklineChanges = new sparklineChanges();
}
this.sparklineChanges.setColor(type, value);
};
sparklineGroup.prototype.asc_getType = function () {
return this.type;
};
......@@ -4890,20 +4974,19 @@ CellArea.prototype = {
return aRet;
};
sparklineGroup.prototype.asc_setStyle = function(nStyleIndex){
var oStyle = AscFormat.aSparklinesStyles[nStyleIndex];
if(oStyle) {
this.colorSeries = this.createExcellColor(oStyle[0]);
this.colorNegative = this.createExcellColor(oStyle[1]);
this.colorAxis = this.createExcellColor(0xff000000);
this.colorMarkers = this.createExcellColor(oStyle[2]);
this.colorFirst = this.createExcellColor(oStyle[3]);
this.colorLast = this.createExcellColor(oStyle[4]);
this.colorHigh = this.createExcellColor(oStyle[5]);
this.colorLow = this.createExcellColor(oStyle[6]);
}
};
sparklineGroup.prototype.asc_setStyle = function (nStyleIndex) {
var oStyle = AscFormat.aSparklinesStyles[nStyleIndex];
if (oStyle) {
this.colorSeries = this.createExcellColor(oStyle[0]);
this.colorNegative = this.createExcellColor(oStyle[1]);
this.colorAxis = this.createExcellColor(0xff000000);
this.colorMarkers = this.createExcellColor(oStyle[2]);
this.colorFirst = this.createExcellColor(oStyle[3]);
this.colorLast = this.createExcellColor(oStyle[4]);
this.colorHigh = this.createExcellColor(oStyle[5]);
this.colorLow = this.createExcellColor(oStyle[6]);
}
};
/** @constructor */
function sparkline() {
this.sqref = null;
......@@ -7102,8 +7185,11 @@ function getCurrencyFormat(opt_cultureInfo, opt_fraction, opt_currency, opt_curr
window['AscCommonExcel'].RangeDataManagerElem = RangeDataManagerElem;
window['AscCommonExcel'].RangeDataManager = RangeDataManager;
window['AscCommonExcel'].CellArea = CellArea;
window["AscCommonExcel"].sparklineChanges = sparklineChanges;
window['AscCommonExcel'].sparklineGroup = sparklineGroup;
prot = sparklineGroup.prototype;
prot["asc_setAttribute"] = prot.asc_setAttribute;
prot["asc_setColor"] = prot.asc_setColor;
prot["asc_getType"] = prot.asc_getType;
prot["asc_getLineWeight"] = prot.asc_getLineWeight;
prot["asc_getDisplayEmpty"] = prot.asc_getDisplayEmpty;
......@@ -7145,7 +7231,7 @@ function getCurrencyFormat(opt_cultureInfo, opt_fraction, opt_currency, opt_curr
window['AscCommonExcel'].getShortDateFormat = getShortDateFormat;
window['AscCommonExcel'].getCurrencyFormatSimple = getCurrencyFormatSimple;
window['AscCommonExcel'].getCurrencyFormat = getCurrencyFormat;
window["Asc"]["CustomFilters"] = window["Asc"].CustomFilters = CustomFilters;
prot = CustomFilters.prototype;
prot["asc_getAnd"] = prot.asc_getAnd;
......
......@@ -1238,6 +1238,7 @@ function DrawingObjects() {
// При скролах нужно выполнить все задачи
_this.drawingDocument.CheckTargetShow();
var taskLen = aDrawTasks.length;
if ( taskLen ) {
var lastTask = aDrawTasks[taskLen - 1];
......@@ -1973,6 +1974,7 @@ function DrawingObjects() {
if ( (currTime - lastTask.time < 40) )
return;
}
aDrawTasks.push({ time: currTime, params: { clearCanvas: clearCanvas, graphicOption: graphicOption, printOptions: printOptions} });
};
......@@ -2064,7 +2066,6 @@ function DrawingObjects() {
if ( _this.controller.selectedObjects.length )
{
_this.OnUpdateOverlay();
_this.drawingDocument.CheckTargetShow();
_this.controller.updateSelectionState(true);
}
}
......
......@@ -2527,17 +2527,22 @@ ParaMath.prototype.MathToImageConverter = function(bCopy, _canvasInput, _widthPx
var oldDefTabStop = Default_Tab_Stop;
Default_Tab_Stop = 1;
var hdr = new CHeaderFooter(editor.WordControl.m_oLogicDocument.HdrFtr, editor.WordControl.m_oLogicDocument, editor.WordControl.m_oDrawingDocument, AscCommon.hdrftr_Header);
var _dc = hdr.Content;
var oApi = Asc['editor'] || editor;
if(!oApi){
return null;
}
var oShape = oApi.textArtPreviewManager.getShape();
//var hdr = new CHeaderFooter(editor.WordControl.m_oLogicDocument.HdrFtr, editor.WordControl.m_oLogicDocument, editor.WordControl.m_oDrawingDocument, AscCommon.hdrftr_Header);
var _dc = oShape.getDocContent();
var par = new Paragraph(editor.WordControl.m_oDrawingDocument, _dc, 0, 0, 0, 0, false);
var par = _dc.Content[0];
if (bCopy)
par.Internal_Content_Add(0, this.Copy(false), false);
else
par.Internal_Content_Add(0, this, false);
_dc.Internal_Content_Add(0, par, false);
// _dc.Internal_Content_Add(0, par, false);
par.Set_Align(align_Left);
par.Set_Tabs(new CParaTabs());
......@@ -2620,17 +2625,20 @@ ParaMath.prototype.MathToImageConverter = function(bCopy, _canvasInput, _widthPx
g.transform(1,0,0,1,0,0);
var isShowParaMarks = par.LogicDocument.Is_ShowParagraphMarks();
if(true == isShowParaMarks)
var bNeedSetParaMarks = false;
if(AscCommon.isRealObject(editor) && editor.ShowParaMarks)
{
par.LogicDocument.Set_ShowParagraphMarks(false, false);
bNeedSetParaMarks = true;
editor.ShowParaMarks = false;
}
par.Draw(0, g);
if (true === isShowParaMarks)
par.LogicDocument.Set_ShowParagraphMarks(true, false);
if(bNeedSetParaMarks)
{
editor.ShowParaMarks = true;
}
AscCommon.IsShapeToImageConverter = false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment