Commit 6107bde7 authored by Dmitry.Vikulov's avatar Dmitry.Vikulov Committed by Alexander.Trofimov

Chart Edition

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@48452 954022d7-b5bf-4e40-9824-e11837661b57
parent 5503368b
This diff is collapsed.
......@@ -1996,7 +1996,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
asc_editChartDrawingObject: function(chart) {
this.wb.controller.isSelectDrawingObject = true;
var ws = this.wb.getWorksheet();
return ws.objectRender.controller.editChartDrawingObjects(chart);
return ws.objectRender.editChartDrawingObject(chart);
},
asc_addImageDrawingObject: function(imageUrl) {
......
......@@ -739,8 +739,8 @@ function asc_CCellCommentator(currentSheet) {
if ( !metrics.result || (metrics.width <= 0) || (metrics.height <= 0) )
continue;
// Inside drawing object
if ( _this.worksheet.objectRender.checkCursorDrawingObject(metrics.left + metrics.width, metrics.top) )
continue;
//if ( _this.worksheet.objectRender.checkCursorDrawingObject(metrics.left + metrics.width, metrics.top) )
// continue;
this.overlayCtx.beginPath();
this.overlayCtx.setFillStyle(this.commentIconColor);
......
......@@ -25,7 +25,7 @@ DrawingObjectsController.prototype =
getAscChartObject: function()
{
if(this.selectedObjects.length === 1)
if (this.selectedObjects.length === 1)
{
if(this.selectedObjects[0].isChart())
return this.selectedObjects[0].chart;
......@@ -38,36 +38,8 @@ DrawingObjectsController.prototype =
}
}
}
var chart = new asc_CChart();
var worksheet = this.drawingObjects.getWorksheet();
chart.range.interval = function() {
var result = "";
if (worksheet) {
var selectedRange = worksheet.getSelectedRange();
if (selectedRange) {
var box = selectedRange.getBBox0();
var startCell = new CellAddress(box.r1, box.c1, 0);
var endCell = new CellAddress(box.r2, box.c2, 0);
if (startCell && endCell) {
var wsName = worksheet.model.sName;
if ( !rx_test_ws_name.test(wsName) )
wsName = "'" + wsName + "'";
if (startCell.getID() == endCell.getID())
result = wsName + "!" + startCell.getID();
else
result = wsName + "!" + startCell.getID() + ":" + endCell.getID();
}
}
}
return result;
}();
chart.range.intervalObject = function() {
return worksheet ? worksheet.getSelectedRange() : null;
}();
return chart;
return null;
},
editChartDrawingObjects: function(chart)
......@@ -777,6 +749,12 @@ DrawingObjectsController.prototype =
{
var api = window["Asc"]["editor"];
var themeColors = api.GuiControlColorsMap;
var aObjects = this.drawingObjects.getDrawingObjects();
for (var i = 0; i < aObjects.length; i++) {
if ( aObjects[i].graphicObject.isChart() )
aObjects[i].graphicObject.recalculate();
}
}
};
......
......@@ -329,7 +329,7 @@ function NullState(drawingObjectsController, drawingObjects)
if(isRealNumber(e.charCode))
{
selected_objects[0].paragraphAdd(new ParaText(String.fromCharCode(e.charCode)));
this.drawingObjects.showDrawingObjects(false);
this.drawingObjects.showDrawingObjects(true);
}
}
......@@ -1601,6 +1601,7 @@ function PreMoveState(drawingObjectsController, drawingObjects, startX, startY,
if(gr_obj.isChart())
{
this.drawingObjectsController.changeCurrentState(new ExtpectDoubleClickState(this.drawingObjectsController, this.drawingObjects));
asc["editor"].asc_endAddShape();
return;
/* if(false === this.graphicObjects.document.Document_Is_SelectionLocked(changestype_Drawing_Props, {Type : changestype_2_Element_and_Type , Element : gr_obj.Parent, CheckType : changestype_Paragraph_Content} )) {
var chart = this.graphicObjects.majorGraphicObject.GraphicObj.chart.serializeChart();
......
......@@ -605,7 +605,7 @@
}
var graphicObjects = t.handlers.trigger("getSelectedGraphicObjects");
if ( graphicObjects.length ) {
if ( graphicObjects.length && t.enableKeyEvents ) {
if (t.handlers.trigger("graphicObjectWindowKeyDown", event))
return true;
}
......@@ -903,7 +903,7 @@
if (t.settings.isViewerMode || t.isSelectionDialogMode) {return true;}
var graphicObjects = t.handlers.trigger("getSelectedGraphicObjects");
if ( graphicObjects.length ) {
if ( graphicObjects.length && t.enableKeyEvents ) {
if (t.handlers.trigger("graphicObjectWindowKeyPress", event))
return true;
}
......
......@@ -5848,10 +5848,11 @@
if (isCoord) {
var drawingInfo = this.objectRender.checkCursorDrawingObject(x, y);
if ( drawingInfo ) {
if ( drawingInfo.isGraphicObject )
asc["editor"].isStartAddShape = true;
else
asc["editor"].isStartAddShape = false;
this.objectRender.selectGraphicObject();
}
else {
if ( !asc["editor"].isStartAddShape )
this.objectRender.unselectDrawingObjects();
}
// move active range to coordinates x,y
......@@ -9136,6 +9137,7 @@
t._trigger("selectionChanged", t.getSelectionInfo());
}
t.objectRender.rebuildChartGraphicObjects();
t.cellCommentator.updateCommentPosition();
t.draw(lockDraw);
},
......
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