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

git-svn-id:...

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@48741 954022d7-b5bf-4e40-9824-e11837661b57
parent 3ec4039d
......@@ -1079,6 +1079,8 @@ function asc_CChartLegend(object) {
this.bOverlay = bCopy ? object.bOverlay : false;
}
asc_CChartLegend.prototype = {
asc_getPosition: function() { return this.position; },
asc_setPosition: function(pos) { this.position = pos; },
......@@ -1090,6 +1092,106 @@ asc_CChartLegend.prototype = {
asc_setOverlayFlag: function(overlayFlag) { this.bOverlay = overlayFlag; }
}
function asc_CChartFont(object) {
var bCopy = isObject(object);
this.name = bCopy ? object.name : "Calibri";
this.size = bCopy ? object.size : 10;
this.color = bCopy ? object.color : "#000000";
this.bold = bCopy ? object.bold : 0;
this.italic = bCopy ? object.italic : 0;
this.underline = bCopy ? object.underline : 0;
this.Properties = {
name: 0,
size: 1,
color: 2,
bold: 3,
italic: 4,
underline: 5
}
}
asc_CChartFont.prototype = {
asc_getName: function() { return this.name; },
asc_setName: function(val) { this.name = val; },
asc_getSize: function() { return this.size; },
asc_setSize: function(val) { this.size = val; },
asc_getColor: function() { return this.color; },
asc_setColor: function(val) { this.color = val; },
asc_getBold: function() { return this.bold; },
asc_setBold: function(val) { this.bold = val; },
asc_getItalic: function() { return this.italic; },
asc_setItalic: function(val) { this.italic = val; },
asc_getUnderline: function() { return this.underline; },
asc_setUnderline: function(val) { this.underline = val; },
// For collaborative editing
getType: function() {
return UndoRedoDataTypes.ChartFont;
},
getProperties: function() {
return this.Properties;
},
getProperty: function(nType) {
switch (nType) {
case this.Properties.name: return this.name; break;
case this.Properties.size: return this.size; break;
case this.Properties.color: return this.color; break;
case this.Properties.bold: return this.bold; break;
case this.Properties.italic: return this.italic; break;
case this.Properties.underline: return this.underline; break;
}
},
setProperty: function(nType, value) {
switch (nType) {
case this.Properties.name: this.name = value; break;
case this.Properties.size: this.size = value; break;
case this.Properties.color: this.color = value; break;
case this.Properties.bold: this.bold = value; break;
case this.Properties.italic: this.italic = value; break;
case this.Properties.underline: this.underline = value; break;
}
}
}
//{ asc_CChartFont export
window["Asc"].asc_CChartFont = asc_CChartFont;
window["Asc"]["asc_CChartFont"] = asc_CChartFont;
prot = asc_CChartFont.prototype;
prot["asc_getName"] = prot.asc_getName;
prot["asc_setName"] = prot.asc_setName;
prot["asc_getSize"] = prot.asc_getSize;
prot["asc_setSize"] = prot.asc_setSize;
prot["asc_getColor"] = prot.asc_getColor;
prot["asc_setColor"] = prot.asc_setColor;
prot["asc_getBold"] = prot.asc_getBold;
prot["asc_setBold"] = prot.asc_setBold;
prot["asc_getItalic"] = prot.asc_getItalic;
prot["asc_setItalic"] = prot.asc_setItalic;
prot["asc_getUnderline"] = prot.asc_getUnderline;
prot["asc_setUnderline"] = prot.asc_setUnderline;
//}
//{ asc_CChartLegend export
window["Asc"].asc_CChartLegend = asc_CChartLegend;
window["Asc"]["asc_CChartLegend"] = asc_CChartLegend;
......@@ -1169,6 +1271,9 @@ prot["asc_getFormatCode"] = prot.asc_getFormatCode;
prot["asc_setFormatCode"] = prot.asc_setFormatCode;
//}
//-----------------------------------------------------------------------------------
// Selected graphic object(properties)
//-----------------------------------------------------------------------------------
......@@ -1903,6 +2008,7 @@ function DrawingObjects() {
_this.isViewerMode = function() { return worksheet._trigger("getViewerMode"); };
aObjects = [];
aImagesSync = [];
aObjectsSync = [];
......@@ -3414,11 +3520,11 @@ function DrawingObjects() {
}
_this.graphicObjectKeyDown = function(e) {
_this.controller.onKeyDown( e );
return _this.controller.onKeyDown( e );
}
_this.graphicObjectKeyPress = function(e) {
_this.controller.onKeyPress( e );
return _this.controller.onKeyPress( e );
}
//-----------------------------------------------------------------------------------
......
......@@ -1316,12 +1316,10 @@ function Binary_ChartReader(stream, chart, chartAsGroup)
var oThis = this;
if ( c_oSer_ChartType.Legend === type )
{
this.chartAsGroup.chartLegend = new CChartLegend();
this.chartAsGroup.chartLegend.drawingObjects = this.chartAsGroup.drawingObjects;
var legend = this.chartAsGroup.chartLegend;
res = this.bcr.Read1(length, function(t,l){
return oThis.ReadLegend(t,l, legend);
});
this.chart.legend.bShow = true;
res = this.bcr.Read1(length, function(t,l){
return oThis.ReadLegend(t,l, oThis.oLegendEntries);
});
}
else if ( c_oSer_ChartType.Title === type )
{
......@@ -1416,119 +1414,96 @@ function Binary_ChartReader(stream, chart, chartAsGroup)
res = c_oSerConstants.ReadUnknown;
return res;
};
this.ReadLegend = function(type, length, chartLegend)
{
this.ReadLegend = function(type, length, oLegendEntries)
{
var res = c_oSerConstants.ReadOk;
var oThis = this;
if ( c_oSer_ChartLegendType.Layout === type )
{
chartLegend.layout = new CChartLayout();
res = this.bcr.Read2Spreadsheet(length, function(t,l){
return oThis.ReadLegendLayout(t,l, chartLegend.layout);
});
}
else if ( c_oSer_ChartLegendType.LegendPos === type )
var oLegendLayout = new Object();
res = this.bcr.Read2Spreadsheet(length, function(t,l){
return oThis.ReadLegendLayout(t,l, oLegendLayout);
});
}
else if ( c_oSer_ChartLegendType.LegendPos === type )
{
var byteLegendPos = this.stream.GetUChar();
switch(byteLegendPos)
{
case EChartLegendPos.chartlegendposLeft: chartLegend.legendPos = c_oAscChartLegend.left;break;
case EChartLegendPos.chartlegendposTop: chartLegend.legendPos = c_oAscChartLegend.top;break;
case EChartLegendPos.chartlegendposRight:
case EChartLegendPos.chartlegendposRightTop: chartLegend.legendPos = c_oAscChartLegend.right;break;
case EChartLegendPos.chartlegendposBottom: chartLegend.legendPos = c_oAscChartLegend.bottom;break;
}
}
else if ( c_oSer_ChartLegendType.Overlay === type )
chartLegend.overlay = this.stream.GetBool();
else if ( c_oSer_ChartLegendType.TxPrPptx === type )
{
var oPresentationSimpleSerializer = new CPPTXContentLoader();
chartLegend.txPr = oPresentationSimpleSerializer.ReadTextBody(null, this.stream, chartLegend);
}
else if ( c_oSer_ChartLegendType.LegendEntry === type )
{
var oNewLegendEntry = new CLegendEntry();
res = this.bcr.Read1(length, function(t,l){
return oThis.ReadLegendEntry(t,l, oNewLegendEntry);
});
if(null != oNewLegendEntry.idx)
chartLegend.legendEntries[oNewLegendEntry.idx] = oNewLegendEntry;
}
else
var byteLegendPos = this.stream.GetUChar();
switch(byteLegendPos)
{
case EChartLegendPos.chartlegendposLeft: this.chart.legend.position = c_oAscChartLegend.left;break;
case EChartLegendPos.chartlegendposTop: this.chart.legend.position = c_oAscChartLegend.top;break;
case EChartLegendPos.chartlegendposRight:
case EChartLegendPos.chartlegendposRightTop: this.chart.legend.position = c_oAscChartLegend.right;break;
case EChartLegendPos.chartlegendposBottom: this.chart.legend.position = c_oAscChartLegend.bottom;break;
}
}
else if ( c_oSer_ChartLegendType.Overlay === type )
this.chart.legend.bOverlay = this.stream.GetBool();
else if ( c_oSer_ChartLegendType.TxPrPptx === type )
{
var oPresentationSimpleSerializer = new PresentationSimpleSerializer();
var textBody = oPresentationSimpleSerializer.ReadTextBody(this.stream);
var params = this.ParsePptxParagraph(textBody);
if(null != params.font)
this.chart.legend.font = params.font;
}
else if ( c_oSer_ChartLegendType.LegendEntry === type )
{
var oNewLegendEntry = {nIndex: null, bDelete: null, oTxPr: null};
res = this.bcr.Read1(length, function(t,l){
return oThis.ReadLegendEntry(t,l, oNewLegendEntry);
});
if(null != oNewLegendEntry.nIndex)
this.oLegendEntries[oNewLegendEntry.nIndex] = oNewLegendEntry;
}
else
res = c_oSerConstants.ReadUnknown;
return res;
};
this.ReadLegendEntry = function(type, length, oLegendEntry)
{
return res;
};
this.ReadLegendEntry = function(type, length, oLegendEntry)
{
var res = c_oSerConstants.ReadOk;
var oThis = this;
if(c_oSer_ChartLegendEntryType.Index === type)
oLegendEntry.idx = this.stream.GetULongLE();
else if(c_oSer_ChartLegendEntryType.Delete === type)
oLegendEntry.nIndex = this.stream.GetULongLE();
else if(c_oSer_ChartLegendEntryType.Delete === type)
oLegendEntry.bDelete = this.stream.GetBool();
else if(c_oSer_ChartLegendEntryType.TxPrPptx === type)
{
var oPresentationSimpleSerializer = new CPPTXContentLoader();
oLegendEntry.txPr = oPresentationSimpleSerializer.ReadTextBody(null, this.stream, oLegendEntry);
}
else
else if(c_oSer_ChartLegendEntryType.TxPrPptx === type)
{
var oPresentationSimpleSerializer = new PresentationSimpleSerializer();
var textBody = oPresentationSimpleSerializer.ReadTextBody(this.stream);
oLegendEntry.oTxPr = this.ParsePptxParagraph(textBody);
}
else
res = c_oSerConstants.ReadUnknown;
return res;
};
this.ReadLegendLayout = function(type, length, chartLayout)
{
return res;
};
this.ReadLegendLayout = function(type, length, oLegendLayout)
{
var res = c_oSerConstants.ReadOk;
var oThis = this;
if(c_oSer_ChartLegendLayoutType.H === type)
{
chartLayout.h = stream.GetDoubleLE();
chartLayout.isManual = true;
}
else if(c_oSer_ChartLegendLayoutType.HMode === type)
{
chartLayout.hMode = this.stream.GetUChar();
chartLayout.isManual = true;
}
else if(c_oSer_ChartLegendLayoutType.LayoutTarget === type)
{
chartLayout.layoutTarget = this.stream.GetUChar();
chartLayout.isManual = true;
}
else if(c_oSer_ChartLegendLayoutType.W === type)
{
chartLayout.w = stream.GetDoubleLE();
chartLayout.isManual = true;
}
else if(c_oSer_ChartLegendLayoutType.WMode === type)
{
chartLayout.wMode = this.stream.GetUChar();
chartLayout.isManual = true;
}
else if(c_oSer_ChartLegendLayoutType.X === type)
{
chartLayout.x = stream.GetDoubleLE();
chartLayout.isManual = true;
}
else if(c_oSer_ChartLegendLayoutType.XMode === type)
{
chartLayout.xMode = this.stream.GetUChar();
chartLayout.isManual = true;
}
else if(c_oSer_ChartLegendLayoutType.Y === type)
{
chartLayout.y = stream.GetDoubleLE();
chartLayout.isManual = true;
}
else if(c_oSer_ChartLegendLayoutType.YMode === type)
{
chartLayout.yMode = this.stream.GetUChar();
chartLayout.isManual = true;
}
else
oLegendLayout.H = stream.GetDoubleLE();
else if(c_oSer_ChartLegendLayoutType.HMode === type)
oLegendLayout.HMode = this.stream.GetUChar();
else if(c_oSer_ChartLegendLayoutType.LayoutTarget === type)
oLegendLayout.LayoutTarget = this.stream.GetUChar();
else if(c_oSer_ChartLegendLayoutType.W === type)
oLegendLayout.W = stream.GetDoubleLE();
else if(c_oSer_ChartLegendLayoutType.WMode === type)
oLegendLayout.WMode = this.stream.GetUChar();
else if(c_oSer_ChartLegendLayoutType.X === type)
oLegendLayout.X = stream.GetDoubleLE();
else if(c_oSer_ChartLegendLayoutType.XMode === type)
oLegendLayout.XMode = this.stream.GetUChar();
else if(c_oSer_ChartLegendLayoutType.Y === type)
oLegendLayout.Y = stream.GetDoubleLE();
else if(c_oSer_ChartLegendLayoutType.YMode === type)
oLegendLayout.YMode = this.stream.GetUChar();
else
res = c_oSerConstants.ReadUnknown;
return res;
};
return res;
};
this.ReadPlotArea = function(type, length, oAxis)
{
var res = c_oSerConstants.ReadOk;
......
......@@ -5667,6 +5667,10 @@ function BinaryPPTYLoader()
case 8:
{
tPr.rPr = this.ReadRunProperties();
if(tPr.pPr.defRPr !== null && typeof tPr.pPr.defRPr === "object" && typeof tPr.pPr.defRPr.Set_FromObject === " function")
{
tPr.pPr.defRPr.Set_FromObject(tPr.rPr);
}
}
default:
{
......
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