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; ...@@ -2596,6 +2596,15 @@ prot["asc_getIndex"] = prot.asc_getIndex;
// Manager // 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) { function GraphicOption(ws, type, range, aId) {
var _this = this; var _this = this;
...@@ -4299,22 +4308,8 @@ function DrawingObjects() { ...@@ -4299,22 +4308,8 @@ function DrawingObjects() {
} }
}; };
_this.rebuildChartGraphicObjects = function(range) { _this.rebuildChartGraphicObjects = function(data) {
/*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.updateDrawingObject = function(bInsert, operType, updateRange) { _this.updateDrawingObject = function(bInsert, operType, updateRange) {
...@@ -4687,7 +4682,7 @@ function DrawingObjects() { ...@@ -4687,7 +4682,7 @@ function DrawingObjects() {
if ( oBBoxFrom && oBBoxTo ) 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; var chart;
if(selected_objects.length === 1 && selected_objects[0].getObjectType() === historyitem_type_ChartSpace) if(selected_objects.length === 1 && selected_objects[0].getObjectType() === historyitem_type_ChartSpace)
{ {
......
...@@ -142,6 +142,10 @@ function getTargetTextObject(controller) ...@@ -142,6 +142,10 @@ function getTargetTextObject(controller)
{ {
return controller.selection.groupSelection.selection.textSelection; return controller.selection.groupSelection.selection.textSelection;
} }
else if(controller.selection.chartSelection && controller.selection.chartSelection.textSelection)
{
return controller.selection.chartSelection.textSelection;
}
return null; return null;
} }
...@@ -236,6 +240,11 @@ DrawingObjectsController.prototype = ...@@ -236,6 +240,11 @@ DrawingObjectsController.prototype =
content && content.Selection_Remove(); content && content.Selection_Remove();
this.selection.textSelection = null; this.selection.textSelection = null;
} }
if(this.selection.chartSelection)
{
this.selection.chartSelection.resetSelection();
this.selection.chartSelection = null;
}
if(this.selection.wrapPolygonSelection) if(this.selection.wrapPolygonSelection)
{ {
this.selection.wrapPolygonSelection = null; this.selection.wrapPolygonSelection = null;
...@@ -350,6 +359,8 @@ DrawingObjectsController.prototype = ...@@ -350,6 +359,8 @@ DrawingObjectsController.prototype =
return {objectId: object.Get_Id(), cursorType: "move", bMarker: bInSelect}; return {objectId: object.Get_Id(), cursorType: "move", bMarker: bInSelect};
} }
}, },
recalculateCurPos: function() recalculateCurPos: function()
{ {
if(this.selection.textSelection) if(this.selection.textSelection)
...@@ -725,6 +736,42 @@ DrawingObjectsController.prototype = ...@@ -725,6 +736,42 @@ DrawingObjectsController.prototype =
} }
else if(this.selection.chartSelection) 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) else if(this.selection.wrapPolygonSelection)
{ {
...@@ -1652,8 +1699,9 @@ DrawingObjectsController.prototype = ...@@ -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); chart_space.setStyle(style_index);
} }
//Title Settings //Title Settings
...@@ -1697,6 +1745,19 @@ DrawingObjectsController.prototype = ...@@ -1697,6 +1745,19 @@ DrawingObjectsController.prototype =
{ {
hor_axis.setTitle(new CTitle()); 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) if(hor_axis.title.overlay)
hor_axis.title.setOverlay(false); hor_axis.title.setOverlay(false);
break; break;
...@@ -1747,6 +1808,10 @@ DrawingObjectsController.prototype = ...@@ -1747,6 +1808,10 @@ DrawingObjectsController.prototype =
{ {
vert_axis.title.txPr.setBodyPr(new CBodyPr()); 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(); vert_axis.title.txPr.bodyPr.reset();
if(vert_axis_labels_settings === c_oAscChartVertAxisLabelShowSettings.rotated) if(vert_axis_labels_settings === c_oAscChartVertAxisLabelShowSettings.rotated)
vert_axis.title.txPr.bodyPr.setVert(nVertTTvert); vert_axis.title.txPr.bodyPr.setVert(nVertTTvert);
......
...@@ -178,7 +178,54 @@ function handleGroup(drawing, drawingObjectsController, e, x, y, group, pageInde ...@@ -178,7 +178,54 @@ function handleGroup(drawing, drawingObjectsController, e, x, y, group, pageInde
function handleChart(drawing, drawingObjectsController, e, x, y, group, pageIndex, bWord) 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) if(ret)
return ret; return ret;
return false; return false;
...@@ -188,7 +235,7 @@ function handleChart(drawing, drawingObjectsController, e, x, y, group, pageInde ...@@ -188,7 +235,7 @@ function handleChart(drawing, drawingObjectsController, e, x, y, group, pageInde
function handleInlineShapeImage(drawing, drawingObjectsController, e, x, y, pageIndex) function handleInlineShapeImage(drawing, drawingObjectsController, e, x, y, pageIndex)
{ {
var _hit = drawing.hit && drawing.hit(x, y); 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); var b_hit_to_text = drawing.hitInTextRect && drawing.hitInTextRect(x, y);
if((_hit && !b_hit_to_text) || _hit_to_path) if((_hit && !b_hit_to_text) || _hit_to_path)
{ {
......
This diff is collapsed.
...@@ -203,6 +203,19 @@ function CChartSpace() ...@@ -203,6 +203,19 @@ function CChartSpace()
this.bbox = null; this.bbox = null;
this.selection =
{
title: null,
legend: null,
legendEntry: null,
axisLbls: null,
dataLbls: null,
dataLbl: null,
textSelection: null,
plotArea: null
};
this.setRecalculateInfo(); this.setRecalculateInfo();
...@@ -220,6 +233,79 @@ CChartSpace.prototype = ...@@ -220,6 +233,79 @@ CChartSpace.prototype =
select: CShape.prototype.select, select: CShape.prototype.select,
checkHitToBounds: CShape.prototype.checkHitToBounds, 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() getMainGroup: function()
{ {
if(!isRealObject(this.group)) if(!isRealObject(this.group))
...@@ -358,6 +444,59 @@ CChartSpace.prototype = ...@@ -358,6 +444,59 @@ CChartSpace.prototype =
return {type: type, subtype: subtype}; 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() copy: function()
{ {
var copy = new CChartSpace(); var copy = new CChartSpace();
......
...@@ -5,6 +5,7 @@ var historyitem_AutoShapes_SetWorksheet = 2; ...@@ -5,6 +5,7 @@ var historyitem_AutoShapes_SetWorksheet = 2;
var historyitem_AutoShapes_AddToDrawingObjects = 3; var historyitem_AutoShapes_AddToDrawingObjects = 3;
var historyitem_AutoShapes_RemoveFromDrawingObjects = 4; var historyitem_AutoShapes_RemoveFromDrawingObjects = 4;
var historyitem_CommonChart_RemoveSeries = 5; var historyitem_CommonChart_RemoveSeries = 5;
var historyitem_CommonSeries_RemoveDPt = 6;
var historyitem_ColorMod_SetName = 2001; var historyitem_ColorMod_SetName = 2001;
var historyitem_ColorMod_SetVal = 2002; var historyitem_ColorMod_SetVal = 2002;
var historyitem_ColorModifiers_AddColorMod = 2003; 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