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

- Add "original image size" option

- Add getLegendInfo()

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@48142 954022d7-b5bf-4e40-9824-e11837661b57
parent 203a3589
......@@ -1029,8 +1029,7 @@ asc_CChart.prototype = {
asc_getChartEditorFlag: function() { return this.bChartEditor; },
asc_setChartEditorFlag: function(value) { this.bChartEditor = value; },
generateFontMap: function(oFontMap)
{
generateFontMap: function(oFontMap) {
var font;
font = this.header.asc_getFont();
if(null != font)
......@@ -1198,6 +1197,23 @@ asc_CChart.prototype = {
}
},
getLegendInfo: function() {
var aInfo = [];
function legendInfo() { return { text: null, color: null, marker: null } };
var aColors = generateColors(this.series.length, arrBaseColors, true);
for ( var i = 0; i < this.series.length; i++ ) {
var info = new legendInfo();
info.text = this.series[i].asc_getTitle();
info.color = aColors[i];
info.marker = c_oAscLegendMarkerType.Line;
aInfo.push(info);
}
return aInfo;
},
// For collaborative editing
getType: function() {
return UndoRedoDataTypes.ChartData;
......@@ -2198,6 +2214,33 @@ prot["asc_getStroke"] = prot.asc_getStroke;
prot["asc_putStroke"] = prot.asc_putStroke;
//}
//-----------------------------------------------------------------------------------
// CImageSize
//-----------------------------------------------------------------------------------
function asc_CImageSize( width, height, isCorrect ) {
this.Width = (undefined == width) ? 0.0 : width;
this.Height = (undefined == height) ? 0.0 : height;
this.IsCorrect = isCorrect;
}
asc_CImageSize.prototype = {
asc_getImageWidth: function() { return this.Width; },
asc_getImageHeight: function() { return this.Height; },
asc_getIsCorrect: function() { return this.IsCorrect; }
}
//{ asc_CImageSize export
window["Asc"].asc_CImageSize = asc_CImageSize;
window["Asc"]["asc_CImageSize"] = asc_CImageSize;
prot = asc_CImageSize.prototype;
prot["asc_getImageWidth"] = prot.asc_getImageWidth;
prot["asc_getImageHeight"] = prot.asc_getImageHeight;
prot["asc_getIsCorrect"] = prot.asc_getIsCorrect;
//}
//-----------------------------------------------------------------------------------
// Undo/Redo
//-----------------------------------------------------------------------------------
......@@ -4493,6 +4536,31 @@ function DrawingObjects() {
}
}
_this.getOriginalImageSize = function() {
var selectedObjects = _this.controller.selectedObjects;
if ( (selectedObjects.length == 1) && selectedObjects[0].isImage() ) {
var imageUrl = selectedObjects[0].getImageUrl();
var _image = api.ImageLoader.map_image_index[getFullImageSrc(imageUrl)];
if (_image != undefined && _image.Image != null && _image.Status == ImageLoadStatus.Complete) {
var _w = 1, _h = 1;
var bIsCorrect = false;
if (_image.Image != null) {
bIsCorrect = true;
_w = Math.max( pxToMm(_image.Image.width), 1 );
_h = Math.max( pxToMm(_image.Image.height), 1 );
}
return new asc_CImageSize( _w, _h, bIsCorrect);
}
}
return new asc_CImageSize( 50, 50, false );
}
//-----------------------------------------------------------------------------------
// Graphic object mouse events
//-----------------------------------------------------------------------------------
......
......@@ -2106,10 +2106,15 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
return ws.objectRender.controller.getGraphicObjectProps();
},
asc_setGraphicObjectProps: function() {
asc_setGraphicObjectProps: function(props) {
// TODO
},
asc_getOriginalImageSize: function() {
var ws = this.wb.getWorksheet();
return ws.objectRender.getOriginalImageSize();
},
asyncImageStartLoaded: function() {
},
......@@ -2903,6 +2908,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
prot["asc_unGroupGraphicsObjects"] = prot.asc_unGroupGraphicsObjects;
prot["asc_getGraphicObjectProps"] = prot.asc_getGraphicObjectProps;
prot["asc_setGraphicObjectProps"] = prot.asc_setGraphicObjectProps;
prot["asc_getOriginalImageSize"] = prot.asc_getOriginalImageSize;
// Cell interface
prot["asc_getCellInfo"] = prot.asc_getCellInfo;
......
......@@ -189,6 +189,11 @@ var c_oAscSelectionType = {
RangeShape: 7
};
var c_oAscLegendMarkerType = {
Line: 0,
Square: 1
}
var c_oAscHyperlinkType = {
WebLink: 1,
RangeLink: 2
......
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