Commit f28fbfc5 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

CChangeTableData

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56555 954022d7-b5bf-4e40-9824-e11837661b57
parent a71d0d2d
......@@ -2596,6 +2596,15 @@ prot["asc_getIndex"] = prot.asc_getIndex;
// Manager
//-----------------------------------------------------------------------------------
function CChangeTableData(changedRange, added, hided, removed)
{
this.changedRange = changedRange;
this.added = added;
this.hided = hided;
this.removed = removed;
}
function GraphicOption(ws, type, range, aId) {
var _this = this;
......@@ -4299,22 +4308,8 @@ function DrawingObjects() {
}
};
_this.rebuildChartGraphicObjects = function(range) {
/*var bRebuild = true;
for (var i = 0; i < aObjects.length; i++) {
var graphicObject = aObjects[i].graphicObject;
if ( graphicObject.isChart() && graphicObject.chart.range.intervalObject ) {
bRebuild = true;
if ( range ) {
if ( !range.intersection(graphicObject.chart.range.intervalObject.bbox) )
bRebuild = false;
}
if ( bRebuild ) {
graphicObject.chart.rebuildSeries();
graphicObject.recalculate();
}
}
}*/
_this.rebuildChartGraphicObjects = function(data) {
};
_this.updateDrawingObject = function(bInsert, operType, updateRange) {
......@@ -4687,7 +4682,7 @@ function DrawingObjects() {
if ( oBBoxFrom && oBBoxTo )
{
var selected_objects = this.controller.groupSelection ? this.controller.groupSelection.selectedObjects : this.controller.selectedObjects;
var selected_objects = this.controller.selection.groupSelection ? this.controller.selection.groupSelection.selectedObjects : this.controller.selectedObjects;
var chart;
if(selected_objects.length === 1 && selected_objects[0].getObjectType() === historyitem_type_ChartSpace)
{
......
......@@ -142,6 +142,10 @@ function getTargetTextObject(controller)
{
return controller.selection.groupSelection.selection.textSelection;
}
else if(controller.selection.chartSelection && controller.selection.chartSelection.textSelection)
{
return controller.selection.chartSelection.textSelection;
}
return null;
}
......@@ -236,6 +240,11 @@ DrawingObjectsController.prototype =
content && content.Selection_Remove();
this.selection.textSelection = null;
}
if(this.selection.chartSelection)
{
this.selection.chartSelection.resetSelection();
this.selection.chartSelection = null;
}
if(this.selection.wrapPolygonSelection)
{
this.selection.wrapPolygonSelection = null;
......@@ -350,6 +359,8 @@ DrawingObjectsController.prototype =
return {objectId: object.Get_Id(), cursorType: "move", bMarker: bInSelect};
}
},
recalculateCurPos: function()
{
if(this.selection.textSelection)
......@@ -725,6 +736,42 @@ DrawingObjectsController.prototype =
}
else if(this.selection.chartSelection)
{
if(this.selection.chartSelection.selectStartPage === pageIndex)
{
drawingDocument.DrawTrack(TYPE_TRACK_SHAPE, this.selection.chartSelection.getTransformMatrix(), 0, 0, this.selection.chartSelection.extX, this.selection.chartSelection.extY, false, this.selection.chartSelection.canRotate());
if(this.selection.chartSelection.selection.textSelection)
{
drawingDocument.DrawTrack(TYPE_TRACK_TEXT, this.selection.chartSelection.selection.textSelection.transform, 0, 0, this.selection.chartSelection.selection.textSelection.extX, this.selection.chartSelection.selection.textSelection.extY, false, false);
}
else if(this.selection.chartSelection.selection.title)
{
drawingDocument.DrawTrack(TYPE_TRACK_SHAPE, this.selection.chartSelection.selection.title.transform, 0, 0, this.selection.chartSelection.selection.title.extX, this.selection.chartSelection.selection.title.extY, false, false);
}
else if(this.selection.chartSelection.selection.dataLbls)
{
for(i = 0; i < this.selection.chartSelection.selection.dataLbls.length; ++i)
{
drawingDocument.DrawTrack(TYPE_TRACK_SHAPE, this.selection.chartSelection.selection.dataLbls[i].transform, 0, 0, this.selection.chartSelection.selection.dataLbls[i].extX, this.selection.chartSelection.selection.dataLbls[i].extY, false, false);
}
}
else if(this.selection.chartSelection.selection.dataLbl)
{
drawingDocument.DrawTrack(TYPE_TRACK_SHAPE, this.selection.chartSelection.selection.dataLbl.transform, 0, 0, this.selection.chartSelection.selection.dataLbl.extX, this.selection.chartSelection.selection.dataLbl.extY, false, false);
}
else if(this.selection.chartSelection.selection.legend)
{
drawingDocument.DrawTrack(TYPE_TRACK_SHAPE, this.selection.chartSelection.selection.legend.transform, 0, 0, this.selection.chartSelection.selection.legend.extX, this.selection.chartSelection.selection.legend.extY, false, false);
}
else if(this.selection.chartSelection.selection.legendEntry)
{
drawingDocument.DrawTrack(TYPE_TRACK_SHAPE, this.selection.chartSelection.selection.legendEntry.transform, 0, 0, this.selection.chartSelection.selection.legendEntry.extX, this.selection.chartSelection.selection.legendEntry.extY, false, false);
}
else if(this.selection.chartSelection.selection.axisLbls)
{
drawingDocument.DrawTrack(TYPE_TRACK_SHAPE, this.selection.chartSelection.selection.axisLbls.transform, 0, 0, this.selection.chartSelection.selection.axisLbls.extX, this.selection.chartSelection.selection.axisLbls.extY, false, false);
}
}
}
else if(this.selection.wrapPolygonSelection)
{
......@@ -1652,8 +1699,9 @@ DrawingObjectsController.prototype =
}
}
if(isRealNumber(style_index) && style_index > 0 && style_index < 49)
if(isRealNumber(style_index) && style_index > 0 && style_index < 49 && chart_space.style !== style_index)
{
chart_space.clearFormatting();
chart_space.setStyle(style_index);
}
//Title Settings
......@@ -1697,6 +1745,19 @@ DrawingObjectsController.prototype =
{
hor_axis.setTitle(new CTitle());
}
if(!hor_axis.title.txPr)
{
hor_axis.title.setTxPr(new CTextBody());
}
if(!hor_axis.title.txPr.bodyPr)
{
hor_axis.title.txPr.setBodyPr(new CBodyPr());
}
if( hor_axis.title.txPr.content)
{
hor_axis.title.txPr.setContent(new CDocumentContent(vert_axis.title.txPr, chart_space.getDrawingDocument(), 0, 0, 100, 500, false, false, true));
}
hor_axis.title.txPr.bodyPr.reset();
if(hor_axis.title.overlay)
hor_axis.title.setOverlay(false);
break;
......@@ -1747,6 +1808,10 @@ DrawingObjectsController.prototype =
{
vert_axis.title.txPr.setBodyPr(new CBodyPr());
}
if( vert_axis.title.txPr.content)
{
vert_axis.title.txPr.setContent(new CDocumentContent(vert_axis.title.txPr, chart_space.getDrawingDocument(), 0, 0, 100, 500, false, false, true));
}
vert_axis.title.txPr.bodyPr.reset();
if(vert_axis_labels_settings === c_oAscChartVertAxisLabelShowSettings.rotated)
vert_axis.title.txPr.bodyPr.setVert(nVertTTvert);
......
......@@ -178,7 +178,54 @@ function handleGroup(drawing, drawingObjectsController, e, x, y, group, pageInde
function handleChart(drawing, drawingObjectsController, e, x, y, group, pageIndex, bWord)
{
var ret = handleShapeImage(drawing, drawingObjectsController, e, x, y, group, pageIndex, bWord);
var ret, i, title;
var chart_titles = drawing.getAllTitles();
var selector = group ? group : drawingObjectsController;
for(i = 0; i < chart_titles.length; ++i)
{
title = chart_titles[i];
var hit_in_inner_area = title.hitInInnerArea(x, y);
var hit_in_path = title.hitInPath(x, y);
var hit_in_text_rect = title.hitInTextRect(x, y);
if(hit_in_inner_area && !hit_in_text_rect || hit_in_path)
{
if(drawingObjectsController.handleEventMode === HANDLE_EVENT_MODE_HANDLE)
{
var is_selected = drawing.selected;
selector.resetSelection();
selector.selectObject(drawing, pageIndex);
selector.selection.chartSelection = drawing;
drawing.selectTitle(title, pageIndex);
drawingObjectsController.updateSelectionState();
return true;
}
else
{
return {objectId: drawing.Get_Id(), cursorType: "move", bMarker: false};
}
}
else if(hit_in_text_rect)
{
if(drawingObjectsController.handleEventMode === HANDLE_EVENT_MODE_HANDLE)
{
drawingObjectsController.resetSelection();
selector.selectObject(drawing, pageIndex);
selector.selection.chartSelection = drawing;
drawing.selectTitle(title, pageIndex);
drawing.selection.textSelection = title;
title.selectionSetStart(e, x, y, pageIndex);
drawingObjectsController.changeCurrentState(new TextAddState(drawingObjectsController, title));
drawingObjectsController.updateSelectionState();
return true;
}
else
{
return {objectId: drawing.Get_Id(), cursorType: "text"};
}
}
}
ret = handleShapeImage(drawing, drawingObjectsController, e, x, y, group, pageIndex, bWord);
if(ret)
return ret;
return false;
......@@ -188,7 +235,7 @@ function handleChart(drawing, drawingObjectsController, e, x, y, group, pageInde
function handleInlineShapeImage(drawing, drawingObjectsController, e, x, y, pageIndex)
{
var _hit = drawing.hit && drawing.hit(x, y);
var _hit_to_path = drawing.hitToPath && drawing.hitToPath(x, y);
var _hit_to_path = drawing.hitInPath && drawing.hitInPath(x, y);
var b_hit_to_text = drawing.hitInTextRect && drawing.hitInTextRect(x, y);
if((_hit && !b_hit_to_text) || _hit_to_path)
{
......
......@@ -13,6 +13,18 @@ function findPrAndRemove(arr, pr)
}
function removeDPtsFromSeries(series)
{
if(Array.isArray(series.dPt))
{
for(var i = series.dPt.length - 1; i > -1; --i)
{
series.removeDPt(i);
}
}
}
var TYPE_SUBTYPE_BY_TYPE = [];
TYPE_SUBTYPE_BY_TYPE[c_oAscChartTypeSettings.barNormal ] = {type: "Bar", subtype: "normal"};
TYPE_SUBTYPE_BY_TYPE[c_oAscChartTypeSettings.barStacked ] = {type: "Bar", subtype: "stacked"};
......@@ -934,6 +946,9 @@ CDLbl.prototype =
this.extY = max_width + 2*SCALE_INSET_COEFF;
this.x = 0;
this.y = 0;
this.txBody.contentWidth = this.extY;
this.txBody.contentHeight = this.extX;
break;
}
default:
......@@ -957,9 +972,13 @@ CDLbl.prototype =
this.extY = Math.max(y0, y1, y2, y3) - Math.min(y0, y1, y2, y3) + SCALE_INSET_COEFF;
this.x = 0;
this.y = 0;
this.txBody.contentWidth = this.extX;
this.txBody.contentHeight = this.extY;
break;
}
}
}
},
......@@ -3216,6 +3235,16 @@ CAreaSeries.prototype =
History.Add(this, {Type: historyitem_AreaSeries_SetDPt, newPr: pr});
this.dPt.push(pr);
},
removeDPt: function(idx)
{
if(this.dPt[idx])
{
History.Add(this, {Type: historyitem_CommonSeries_RemoveDPt, idx: idx, pt: this.dPt[idx]});
this.dPt.splice(idx, 1);
}
},
setErrBars: function(pr)
{
History.Add(this, {Type: historyitem_AreaSeries_SetErrBars, oldPr: this.errBars, newPr: pr});
......@@ -3261,6 +3290,11 @@ CAreaSeries.prototype =
{
switch (data.Type)
{
case historyitem_CommonSeries_RemoveDPt:
{
this.dPt.splice(data.idx, 0, data.pt);
break;
}
case historyitem_AreaSeries_SetCat:
{
this.cat = data.oldPr;
......@@ -3313,6 +3347,11 @@ CAreaSeries.prototype =
{
switch (data.Type)
{
case historyitem_CommonSeries_RemoveDPt:
{
this.dPt.splice(data.idx, 1);
break;
}
case historyitem_AreaSeries_SetCat:
{
this.cat = data.newPr;
......@@ -3383,6 +3422,11 @@ CAreaSeries.prototype =
writeLong(w, data.newPr);
break;
}
case historyitem_CommonSeries_RemoveDPt:
{
writeLong(w, data.idx);
break;
}
}
},
......@@ -3436,6 +3480,15 @@ CAreaSeries.prototype =
this.trendline = readObject(r);
break;
}
case historyitem_CommonSeries_RemoveDPt:
{
var pos = readLong(r);
if(isRealNumber(pos))
{
this.dPt.splice(pos, 1);
}
break;
}
}
}
};
......@@ -6675,6 +6728,15 @@ CBarSeries.prototype =
Refresh_RecalcData: function()
{},
removeDPt: function(idx)
{
if(this.dPt[idx])
{
History.Add(this, {Type: historyitem_CommonSeries_RemoveDPt, idx: idx, pt: this.dPt[idx]});
this.dPt.splice(idx, 1);
}
},
getObjectType: function()
{
return historyitem_type_BarSeries;
......@@ -6861,6 +6923,11 @@ CBarSeries.prototype =
{
switch (data.Type)
{
case historyitem_CommonSeries_RemoveDPt:
{
this.dPt.splice(data.idx, 0, data.pt);
break;
}
case historyitem_BarSeries_SetCat:
{
this.cat = data.oldPr;
......@@ -6933,6 +7000,11 @@ CBarSeries.prototype =
{
switch (data.Type)
{
case historyitem_CommonSeries_RemoveDPt:
{
this.dPt.splice(data.idx, 1);
break;
}
case historyitem_BarSeries_SetCat:
{
this.cat = data.newPr;
......@@ -7032,6 +7104,11 @@ CBarSeries.prototype =
writeBool(w, data.newPr);
break;
}
case historyitem_CommonSeries_RemoveDPt:
{
writeLong(w, data.idx);
break;
}
}
},
......@@ -7105,6 +7182,15 @@ CBarSeries.prototype =
this.val = readObject(r);
break;
}
case historyitem_CommonSeries_RemoveDPt:
{
var pos = readLong(r);
if(isRealNumber(pos))
{
this.dPt.splice(pos, 1);
}
break;
}
}
}
};
......@@ -7492,6 +7578,15 @@ CBubbleSeries.prototype =
cd: function()
{},
removeDPt: function(idx)
{
if(this.dPt[idx])
{
History.Add(this, {Type: historyitem_CommonSeries_RemoveDPt, idx: idx, pt: this.dPt[idx]});
this.dPt.splice(idx, 1);
}
},
createDuplicate: function()
{
var c = new CBubbleSeries();
......@@ -7565,6 +7660,11 @@ CBubbleSeries.prototype =
{
switch (data.Type)
{
case historyitem_CommonSeries_RemoveDPt:
{
this.dPt.splice(data.idx, 0, data.pt);
break;
}
case historyitem_BubbleSeries_SetBubble3D:
{
this.bubble3D = data.oldPr;
......@@ -7637,6 +7737,11 @@ CBubbleSeries.prototype =
{
switch (data.Type)
{
case historyitem_CommonSeries_RemoveDPt:
{
this.dPt.splice(data.idx, 1);
break;
}
case historyitem_BubbleSeries_SetBubble3D:
{
this.bubble3D = data.newPr;
......@@ -7735,6 +7840,11 @@ CBubbleSeries.prototype =
writeLong(w, data.newPr);
break;
}
case historyitem_CommonSeries_RemoveDPt:
{
writeLong(w, data.idx);
break;
}
}
},
......@@ -7743,6 +7853,16 @@ CBubbleSeries.prototype =
var type = r.GetLong();
switch (type)
{
case historyitem_CommonSeries_RemoveDPt:
{
var pos = readLong(r);
if(isRealNumber(pos))
{
this.dPt.splice(pos, 1);
}
break;
}
case historyitem_BubbleSeries_SetBubble3D:
{
this.bubble3D = readBool(r);
......@@ -11883,6 +12003,16 @@ CLineSeries.prototype =
return this.Id;
},
removeDPt: function(idx)
{
if(this.dPt[idx])
{
History.Add(this, {Type: historyitem_CommonSeries_RemoveDPt, idx: idx, pt: this.dPt[idx]});
this.dPt.splice(idx, 1);
}
},
Refresh_RecalcData: function()
{},
createDuplicate: function()
......@@ -12065,6 +12195,11 @@ CLineSeries.prototype =
{
switch (data.Type)
{
case historyitem_CommonSeries_RemoveDPt:
{
this.dPt.splice(data.idx, 0, data.pt);
break;
}
case historyitem_LineSeries_SetCat:
{
this.cat = data.oldPr;
......@@ -12132,6 +12267,11 @@ CLineSeries.prototype =
{
switch (data.Type)
{
case historyitem_CommonSeries_RemoveDPt:
{
this.dPt.splice(data.idx, 1);
break;
}
case historyitem_LineSeries_SetCat:
{
this.cat = data.newPr;
......@@ -12225,6 +12365,11 @@ CLineSeries.prototype =
writeBool(w, data.newPr);
break;
}
case historyitem_CommonSeries_RemoveDPt:
{
writeLong(w, data.idx);
break;
}
}
},
......@@ -12293,6 +12438,15 @@ CLineSeries.prototype =
this.val = readObject(r);
break;
}
case historyitem_CommonSeries_RemoveDPt:
{
var pos = readLong(r);
if(isRealNumber(pos))
{
this.dPt.splice(pos, 1);
}
break;
}
}
}
};
......@@ -14580,6 +14734,15 @@ CPieSeries.prototype =
Refresh_RecalcData: function()
{},
removeDPt: function(idx)
{
if(this.dPt[idx])
{
History.Add(this, {Type: historyitem_CommonSeries_RemoveDPt, idx: idx, pt: this.dPt[idx]});
this.dPt.splice(idx, 1);
}
},
createDuplicate: function()
{
var c = new CPieSeries();
......@@ -14727,6 +14890,11 @@ CPieSeries.prototype =
{
switch (data.Type)
{
case historyitem_CommonSeries_RemoveDPt:
{
this.dPt.splice(data.idx, 0, data.pt);
break;
}
case historyitem_PieSeries_SetCat:
{
this.cat = data.oldPr;
......@@ -14779,6 +14947,11 @@ CPieSeries.prototype =
{
switch (data.Type)
{
case historyitem_CommonSeries_RemoveDPt:
{
this.dPt.splice(data.idx, 1);
break;
}
case historyitem_PieSeries_SetCat:
{
this.cat = data.newPr;
......@@ -14849,6 +15022,11 @@ CPieSeries.prototype =
writeLong(w, data.newPr);
break;
}
case historyitem_CommonSeries_RemoveDPt:
{
writeLong(w, data.idx);
break;
}
}
},
......@@ -14857,6 +15035,15 @@ CPieSeries.prototype =
var type = r.GetLong();
switch (type)
{
case historyitem_CommonSeries_RemoveDPt:
{
var pos = readLong(r);
if(isRealNumber(pos))
{
this.dPt.splice(pos, 1);
}
break;
}
case historyitem_PieSeries_SetCat:
{
this.cat = readObject(r);
......@@ -15489,6 +15676,15 @@ CRadarSeries.prototype =
Refresh_RecalcData: function()
{},
removeDPt: function(idx)
{
if(this.dPt[idx])
{
History.Add(this, {Type: historyitem_CommonSeries_RemoveDPt, idx: idx, pt: this.dPt[idx]});
this.dPt.splice(idx, 1);
}
},
createDuplicate: function()
{
var c = new CRadarSeries();
......@@ -15635,6 +15831,12 @@ CRadarSeries.prototype =
{
switch (data.Type)
{
case historyitem_CommonSeries_RemoveDPt:
{
this.dPt.splice(data.idx, 0, data.pt);
break;
}
case historyitem_RadarSeries_SetCat:
{
this.cat = data.oldPr;
......@@ -15687,6 +15889,11 @@ CRadarSeries.prototype =
{
switch (data.Type)
{
case historyitem_CommonSeries_RemoveDPt:
{
this.dPt.splice(data.idx, 1);
break;
}
case historyitem_RadarSeries_SetCat:
{
this.cat = data.newPr;
......@@ -15757,6 +15964,11 @@ CRadarSeries.prototype =
writeLong(w, data.newPr);
break;
}
case historyitem_CommonSeries_RemoveDPt:
{
writeLong(w, data.idx);
break;
}
}
},
......@@ -15765,6 +15977,15 @@ CRadarSeries.prototype =
var type = r.GetLong();
switch (type)
{
case historyitem_CommonSeries_RemoveDPt:
{
var pos = readLong(r);
if(isRealNumber(pos))
{
this.dPt.splice(pos, 1);
}
break;
}
case historyitem_RadarSeries_SetCat:
{
this.cat = readObject(r);
......@@ -16363,6 +16584,16 @@ CScatterSeries.prototype =
documentCreateFontMap: CAreaSeries.prototype.documentCreateFontMap,
removeDPt: function(idx)
{
if(this.dPt[idx])
{
History.Add(this, {Type: historyitem_CommonSeries_RemoveDPt, idx: idx, pt: this.dPt[idx]});
this.dPt.splice(idx, 1);
}
},
createDuplicate: function()
{
var c = new CScatterSeries();
......@@ -16538,6 +16769,12 @@ CScatterSeries.prototype =
{
switch (data.Type)
{
case historyitem_CommonSeries_RemoveDPt:
{
this.dPt.splice(data.idx, 0, data.pt);
break;
}
case historyitem_ScatterSer_SetDLbls:
{
this.dLbls = data.oldPr;
......@@ -16605,6 +16842,11 @@ CScatterSeries.prototype =
{
switch (data.Type)
{
case historyitem_CommonSeries_RemoveDPt:
{
this.dPt.splice(data.idx, 1);
break;
}
case historyitem_ScatterSer_SetDLbls:
{
this.dLbls = data.newPr;
......@@ -16709,6 +16951,11 @@ CScatterSeries.prototype =
}
break;
}
case historyitem_CommonSeries_RemoveDPt:
{
writeLong(w, data.idx);
break;
}
}
},
......@@ -16854,6 +17101,15 @@ CScatterSeries.prototype =
}
break;
}
case historyitem_CommonSeries_RemoveDPt:
{
var pos = readLong(r);
if(isRealNumber(pos))
{
this.dPt.splice(pos, 1);
}
break;
}
}
}
};
......@@ -18124,6 +18380,15 @@ CSurfaceSeries.prototype =
Refresh_RecalcData: function()
{},
removeDPt: function(idx)
{
if(this.dPt[idx])
{
History.Add(this, {Type: historyitem_CommonSeries_RemoveDPt, idx: idx, pt: this.dPt[idx]});
this.dPt.splice(idx, 1);
}
},
createDuplicate: function()
{
var c = new CSurfaceSeries();
......@@ -18206,6 +18471,11 @@ CSurfaceSeries.prototype =
{
switch (data.Type)
{
case historyitem_CommonSeries_RemoveDPt:
{
this.dPt.splice(data.idx, 0, data.pt);
break;
}
case historyitem_SurfaceSeries_SetCat:
{
this.cat = data.oldPr;
......@@ -18243,6 +18513,11 @@ CSurfaceSeries.prototype =
{
switch (data.Type)
{
case historyitem_CommonSeries_RemoveDPt:
{
this.dPt.splice(data.idx, 1);
break;
}
case historyitem_SurfaceSeries_SetCat:
{
this.cat = data.newPr;
......@@ -18295,6 +18570,11 @@ CSurfaceSeries.prototype =
writeLong(w, data.newPr);
break;
}
case historyitem_CommonSeries_RemoveDPt:
{
writeLong(w, data.idx);
break;
}
}
},
......@@ -18333,6 +18613,15 @@ CSurfaceSeries.prototype =
this.val = readObject(r);
break;
}
case historyitem_CommonSeries_RemoveDPt:
{
var pos = readLong(r);
if(isRealNumber(pos))
{
this.dPt.splice(pos, 1);
}
break;
}
}
},
......@@ -18464,6 +18753,38 @@ CTitle.prototype =
setPosition: CDLbl.prototype.setPosition,
hitInPath: CShape.prototype.hitInPath,
hitInInnerArea: CShape.prototype.hitInInnerArea,
hitInBoundingRect: CShape.prototype.hitInBoundingRect,
hitInTextRect: CShape.prototype.hitInTextRect,
checkHitToBounds: function(x, y)
{
var _x = x - this.transform.tx;
var _y = y - this.transform.ty;
return _x >= 0 && _x <= this.extX && _y >= 0 && _y < this.extY;
},
getDocContent: CShape.prototype.getDocContent,
selectionSetStart: CShape.prototype.selectionSetStart,
selectionSetEnd: CShape.prototype.selectionSetEnd,
select: function(chartSpace, pageIndex)
{
this.selected = true;
this.selectStartPage = pageIndex;
var content = this.getDocContent && this.getDocContent();
if(content)
content.Set_StartPage(pageIndex);
chartSpace.selection.title = this;
},
getMaxWidth: function(bodyPr)
{
switch (bodyPr.vert)
......@@ -18501,6 +18822,19 @@ CTitle.prototype =
getCompiledTransparent: CDLbl.prototype.getCompiledTransparent,
Get_Styles: CDLbl.prototype.Get_Styles,
check_bounds: CShape.prototype.check_bounds,
getInvertTransform: CShape.prototype.getInvertTransform,
getCanvasContext: function()
{
return this.chart && this.chart.getCanvasContext();
},
convertPixToMM: function()
{
return this.chart && this.chart.convertPixToMM();
},
getDrawingDocument: function()
{
return this.chart && this.chart.getDrawingDocument();
},
draw: function(graphics)
{
if(this.chart)
......@@ -18526,6 +18860,7 @@ CTitle.prototype =
recalculatePen: CShape.prototype.recalculatePen,
recalculateBrush: CShape.prototype.recalculateBrush,
updateSelectionState: CShape.prototype.updateSelectionState,
checkShapeChildTransform: CDLbl.prototype.checkShapeChildTransform,
......@@ -18537,6 +18872,9 @@ CTitle.prototype =
this.transformText = this.localTransformText.CreateDublicate();
global_MatrixTransformer.TranslateAppend(this.transformText, x, y);
this.invertTransform = global_MatrixTransformer.Invert(this.transform);
this.invertTransformText = global_MatrixTransformer.Invert(this.transformText);
},
getParentObjects: function()
......
......@@ -203,6 +203,19 @@ function CChartSpace()
this.bbox = null;
this.selection =
{
title: null,
legend: null,
legendEntry: null,
axisLbls: null,
dataLbls: null,
dataLbl: null,
textSelection: null,
plotArea: null
};
this.setRecalculateInfo();
......@@ -220,6 +233,79 @@ CChartSpace.prototype =
select: CShape.prototype.select,
checkHitToBounds: CShape.prototype.checkHitToBounds,
resetInternalSelection: function()
{
if(this.selection.textSelection)
{
var content = this.selection.textSelection.getDocContent();
content && content.Selection_Remove();
this.selection.textSelection = null;
}
},
resetSelection: function()
{
this.resetInternalSelection();
this.selection.title = null;
this.selection.legend = null;
this.selection.legendEntry = null;
this.selection.axisLbls = null;
this.selection.dataLbls = null;
this.selection.dataLbl = null;
this.selection.textSelection = null;
this.selection.plotArea = null;
},
selectTitle: function(title, pageIndex)
{
title.select(this, pageIndex);
this.resetInternalSelection();
this.selection.legend = null;
this.selection.legendEntry = null;
this.selection.axisLbls = null;
this.selection.dataLbls = null;
this.selection.dataLbl = null;
this.selection.textSelection = null;
this.selection.plotArea = null;
},
recalculateCurPos: DrawingObjectsController.prototype.recalculateCurPos,
documentUpdateSelectionState: function()
{
if(this.selection.textSelection)
{
this.selection.textSelection.updateSelectionState();
}
},
getAllTitles: function()
{
var ret = [];
if(this.chart )
{
if(this.chart.title)
{
ret.push(this.chart.title);
}
if(this.chart.plotArea)
{
if(this.chart.plotArea.catAx && this.chart.plotArea.catAx.title)
{
ret.push(this.chart.plotArea.catAx.title);
}
if(this.chart.plotArea.valAx && this.chart.plotArea.valAx.title)
{
ret.push(this.chart.plotArea.valAx.title);
}
}
}
return ret;
},
getMainGroup: function()
{
if(!isRealObject(this.group))
......@@ -358,6 +444,59 @@ CChartSpace.prototype =
return {type: type, subtype: subtype};
},
clearFormatting: function()
{
if(this.chart)
{
if(this.chart.spPr)
{
this.chart.spPr.Fill && this.chart.spPr.setFill(null);
this.chart.spPr.ln && this.chart.spPr.setLn(null);
}
if(this.chart.plotArea)
{
if(this.chart.plotArea.spPr)
{
this.chart.plotArea.spPr.Fill && this.plotArea.chart.spPr.setFill(null);
this.chart.plotArea.spPr.ln && this.plotArea.chart.spPr.setLn(null);
}
var i, j, k, series, pts, chart, ser;
for(i = this.chart.plotArea.charts.length-1; i > -1; --i)
{
chart = this.chart.plotArea.charts[i];
if(chart.upDownBars)
{
if(chart.upDownBars.upBars)
{
chart.upDownBars.setUpBars(null);
}
if(chart.upDownBars.downBars)
{
chart.upDownBars.setDownBars(null);
}
}
series = chart.series;
for(j = series.length - 1; j > -1; --j)
{
ser = series[i];
if(ser.spPr)
{
if(ser.spPr.Fill)
{
ser.spPr.setFill(null);
}
if(ser.spPr.ln)
{
ser.spPr.setLn(null);
}
}
removeDPtsFromSeries(ser)
}
}
}
}
},
copy: function()
{
var copy = new CChartSpace();
......
......@@ -5,6 +5,7 @@ var historyitem_AutoShapes_SetWorksheet = 2;
var historyitem_AutoShapes_AddToDrawingObjects = 3;
var historyitem_AutoShapes_RemoveFromDrawingObjects = 4;
var historyitem_CommonChart_RemoveSeries = 5;
var historyitem_CommonSeries_RemoveDPt = 6;
var historyitem_ColorMod_SetName = 2001;
var historyitem_ColorMod_SetVal = 2002;
var historyitem_ColorModifiers_AddColorMod = 2003;
......
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