Commit f276a39a 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@55806 954022d7-b5bf-4e40-9824-e11837661b57
parent e0cdf126
......@@ -4011,7 +4011,7 @@ CDateAx.prototype =
return this.Id;
},
getObjectsType: function()
getObjectType: function()
{
return historyitem_type_DateAx;
},
......@@ -4044,7 +4044,7 @@ CDateAx.prototype =
}
if(this.scaling)
{
c.setScaling(this.sclaing.createDuplicate());
c.setScaling(this.scaling.createDuplicate());
}
if(this.spPr)
{
......@@ -4059,6 +4059,7 @@ CDateAx.prototype =
{
c.setTxPr(this.txPr.createDuplicate());
}
return c;
},
setAuto: function(pr)
......@@ -4075,7 +4076,7 @@ CDateAx.prototype =
},
setAxPos: function(pr)
{
History.Add(this, {Type:historyitem_DateAxPos, oldPr: this.axPos, newPr: pr});
History.Add(this, {Type:historyitem_DateAxAxPos, oldPr: this.axPos, newPr: pr});
this.axPos = pr;
},
......@@ -4498,6 +4499,50 @@ CSerAx.prototype =
{
return this.Id;
},
createDuplicate: function()
{
var c = new CSerAx();
c.setAxPos(this.axPos);
c.setCrosses(this.crosses);
c.setCrossesAt(this.crossesAt);
c.setDelete(this.bDelete);
if(this.majorGridlines)
{
c.setMajorGridlines(this.majorGridlines.createDuplicate());
}
c.setMajorTickMark(this.majorTickMark);
if(this.minorGridlines)
{
c.setMajorGridlines(this.minorGridlines.createDuplicate());
}
c.setMajorTickMark(this.minorTickMark);
if(this.numFmt)
{
c.setNumFmt(this.numFmt.createDuplicate());
}
if(this.scaling)
{
c.setScaling(this.scaling.createDuplicate());
}
if(this.spPr)
{
c.setSpPr(this.spPr.createDuplicate());
}
c.setTickLblPos(this.tickLblPos);
c.setTickLblSkip(this.tickLblSkip);
c.setTickMarkSkip(this.tickMarkSkip);
if(this.title)
{
c.setTitle(this.title.createDuplicate());
}
if(this.txPr)
{
c.setTxPr(this.txPr.createDuplicate());
}
return c;
},
setAxId: function(pr)
{
History.Add(this, {Type: historyitem_SerAxSetAxId, oldPr: this.axId, newPr: pr});
......@@ -4650,6 +4695,42 @@ CValAx.prototype =
Refresh_RecalcData: function()
{},
createDuplicate: function()
{
var c = new CValAx();
c.setAxPos(this.axPos);
c.setCrossBetween(this.crossBetween);
c.setCrossesAt(this.crossesAt);
c.setDelete(this.bDelete);
if(this.dispUnits)
{
c.setDispUnits(this.dispUnits.createDuplicate());
}
if(this.majorGridlines)
{
c.setMajorGridlines(this.majorGridlines.createDuplicate());
}
c.setMajorTickMark(this.majorTickMark);
c.setMajorUnit(this.majorUnit);
c.setNumFmt(this.numFmt.createDuplicate());
c.setScaling(this.scaling.createDuplicate());
if(this.spPr)
{
c.setSpPr(this.spPr.createDuplicate());
}
c.setTickLblPos(this.tickLblPos);
if(this.title)
{
c.setTitle(this.title.createDuplicate());
}
if(this.txPr)
{
c.setTxPr(this.txPr.createDuplicate());
}
return c;
},
getObjectType: function()
{
return historyitem_type_ValAx;
......@@ -5010,6 +5091,17 @@ CBandFmt.prototype =
Refresh_RecalcData: function()
{},
createDuplicate: function()
{
var c = new CBandFmt();
c.setIdx(this.idx);
if(this.spPr)
{
c.setSpPr(this.spPr.createDuplicate());
}
return c;
},
getObjectType: function()
{
return historyitem_type_BandFmt;
......@@ -5173,6 +5265,52 @@ CBarSeries.prototype =
return historyitem_type_BarSeries;
},
createDuplicate: function()
{
var c = new CBarSeries();
if(this.cat)
{
c.setCat(this.cat.createDuplicate());
}
if(this.dLbls)
{
c.setDLbls(this.dLbls.createDuplicate());
}
for(var i = 0; i < this.dPt.length; ++i)
{
c.addDPt(this.dPt[i].createDuplicate());
}
if(this.errBars)
{
c.setErrBars(this.errBars.createDuplicate());
}
c.setIdx(this.idx);
c.setInvertIfNegative(this.invertIfNegative);
c.setOrder(this.order);
if(this.pictureOptions)
{
c.setPictureOptions(this.pictureOptions.createDuplicate());
}
c.setShape(this.shape);
if(this.spPr)
{
c.setSpPr(this.spPr.createDuplicate());
}
if(this.trendline)
{
c.setTrendline(this.trendline.createDuplicate());
}
if(this.tx)
{
c.setTx(this.tx.createDuplicate());
}
if(this.val)
{
c.setVal(this.val.createDuplicate());
}
return c;
},
documentCreateFontMap: CAreaSeries.prototype.documentCreateFontMap,
Write_ToBinary2: function(w)
......@@ -5583,6 +5721,25 @@ CBubbleChart.prototype =
},
createDuplicate: function()
{
var c = new CBubbleChart();
c.setBubble3D(this.bubble3D);
c.setBubbleScale(this.bubbleScale);
if(this.dLbls)
{
c.setDLbls(this.dLbls.createDuplicate());
}
for(var i = 0; i < this.series.length; ++i)
{
c.addSer(this.series[i].createDuplicate());
}
c.setShowNegBubbles(this.showNegBubbles);
c.setSizeRepresents(this.sizeRepresents);
c.setVaryColors(this.varyColors);
return c;
},
documentCreateFontMap: CBarChart.prototype.documentCreateFontMap,
getAllRasterImages: CBarChart.prototype.getAllRasterImages,
......@@ -5878,6 +6035,52 @@ CBubbleSeries.prototype =
return historyitem_type_BubbleSeries;
},
cd: function()
{},
createDuplicate: function()
{
var c = new CBubbleSeries();
c.setBubble3D(this.bubble3D);
c.setBubbleSize(this.bubbleSize);
if(this.dLbls)
{
c.setDLbls(this.dLbls.createDuplicate());
}
for(var i = 0; i < this.dPt.length; ++i)
{
c.addDPt(this.dPt[i].createDuplicate());
}
if(this.errBars)
{
c.setErrBars(this.errBars.createDuplicate());
}
c.setIdx(this.idx);
c.setInvertIfNegative(this.invertIfNegative);
c.setOrder(this.order);
if(this.spPr)
{
c.setSpPr(this.spPr.createDuplicate());
}
if(this.trendline)
{
c.setTrendline(this.trendline.createDuplicate());
}
if(this.tx)
{
c.setTx(this.tx.createDuplicate());
}
if(this.xVal)
{
c.setXVal(this.xVal.createDuplicate());
}
if(this.yVal)
{
c.setYVal(this.yVal.createDuplicate());
}
return c;
},
documentCreateFontMap: CAreaSeries.prototype.documentCreateFontMap,
getAllRasterImages: CAreaSeries.prototype.getAllRasterImages,
......@@ -6255,6 +6458,33 @@ CCat.prototype =
this.Id = r.GetString2();
},
createDuplicate: function()
{
var c = new CCat();
if(this.multiLvlStrRef)
{
c.setMultiLvlStrRef(this.multiLvlStrRef.createDuplicate());
}
if(this.numLit)
{
c.setNumLit(this.numLit.createDuplicate());
}
if(this.numRef)
{
c.setNumRef(this.numRef.createDuplicate());
}
if(this.strLit)
{
c.setStrLit(this.strLit.createDuplicate());
}
if(this.strRef)
{
c.setStrRef(this.strRef.createDuplicate());
}
return c;
},
getObjectType: function()
{
return historyitem_type_Cat;
......@@ -6436,6 +6666,20 @@ CChartText.prototype =
Refresh_RecalcData: function()
{},
createDuplicate: function()
{
var c = new CChartText();
if(this.rich)
c.setRich(this.rich.createDuplicate());
if(this.strRef)
{
c.setStrRef(this.strRef.createDuplicate());
}
//Todo: разобраться с ссылками на chart
return c;
},
getStyles: CDLbl.prototype.getStyles,
Get_Theme: CDLbl.prototype.Get_Theme,
......@@ -6649,6 +6893,42 @@ CDLbls.prototype =
Refresh_RecalcData: function()
{},
createDuplicate: function()
{
var c = new CDLbls();
c.setDelete(this.bDelete);
for(var i = 0; i < this.dLbl.length; ++i)
{
c.addDLbl(this.dLbl[i].createDuplicate());
}
c.setDLblPos(this.dLblPos);
if(this.leaderLines)
{
c.setLeaderLines(this.leaderLines.createDuplicate());
}
if(this.numFmt)
{
c.setNumFmt(this.numFmt.createDuplicate());
}
c.setSeparator(this.separator);
c.setShowBubbleSize(this.showBubbleSize);
c.setShowCatName(this.showCatName);
c.setShowLeaderLines(this.showLeaderLines);
c.setShowLegendKey(this.showLegendKey);
c.setShowPercent(this.showPercent);
c.setShowSerName(this.showSerName);
c.setShowVal(this.showVal);
if(this.spPr)
{
c.setSpPr(this.spPr.createDuplicate());
}
if(this.txPr)
{
c.setTxPr(this.txPr.createDuplicate());
}
return c;
},
documentCreateFontMap: function(allFonts)
{
......@@ -7081,7 +7361,7 @@ function CDPt()
this.recalcInfo =
{
recalcLbl: true
}
};
this.compiledLbl = null;
this.Id = g_oIdCounter.Get_NewId();
......@@ -7102,6 +7382,28 @@ CDPt.prototype =
return historyitem_type_DPt;
},
createDuplicate: function()
{
var c = new CDPt();
c.setBubble3D(this.bubble3D);
c.setExplosion(this.explosion);
c.setIdx(this.idx);
c.setInvertIfNegative(this.invertIfNegative);
if(this.marker)
{
c.setMarker(this.marker.createDuplicate());
}
if(this.pictureOptions)
{
c.setPictureOptions(this.pictureOptions.createDuplicate());
}
if(this.spPr)
{
c.setSpPr(this.spPr.createDuplicate());
}
return c;
},
Write_ToBinary2: function(w)
{
w.WriteLong(this.getObjectType());
......@@ -7411,6 +7713,20 @@ CDTable.prototype =
this.Id = r.GetString2();
},
createDuplicate: function()
{
var c = new CDTable();
c.setShowHorzBorder(this.showHorzBorder);
c.setShowKeys(this.showKeys);
c.setShowOutline(this.showOutline);
c.setShowVertBorder(this.showVertBorder);
if(this.spPr)
c.setSpPr(this.spPr.createDuplicate());
if(this.txPr)
c.setTxPr(this.txPr.createDuplicate());
return c;
},
setShowHorzBorder: function(pr)
{
History.Add(this, {Type: historyitem_DTable_SetShowHorzBorder, oldPr: this.showHorzBorder, newPr: pr});
......@@ -7725,6 +8041,18 @@ CDispUnits.prototype =
Refresh_RecalcData: function()
{},
createDuplicate: function()
{
var c = new CDispUnits();
c.setBuiltInUnit(this.builtInUnit);
c.setCustUnit(this.custUnit);
if(this.dispUnitsLbl)
{
c.setDispUnitsLbl(this.dispUnitsLbl.createDuplicate());
}
return c;
},
getMultiplier: function()
{
if(isRealNumber(this.builtInUnit))
......@@ -7870,6 +8198,23 @@ CDoughnutChart.prototype =
Refresh_RecalcData: function()
{},
createDuplicate: function()
{
var c = new CDoughnutChart();
if(this.dLbls)
{
c.setDLbls(this.dLbls.createDuplicate());
}
c.setFirstSliceAng(this.firstSliceAng);
c.setHoleSize(this.holeSize);
for(var i = 0; i < this.series.length; ++i)
{
c.addSer(this.series[i].createDuplicate());
}
c.setVaryColors(this.varyColors);
return c;
},
getObjectType: function()
{
return historyitem_type_DoughnutChart;
......@@ -8173,6 +8518,29 @@ CErrBars.prototype =
Refresh_RecalcData: function()
{},
createDuplicate: function()
{
var c = new CErrBars();
c.setErrBarType(this.errBarType);
c.setErrDir(this.errDir);
c.setErrValType(this.errValType);
if(this.minus)
{
c.setMinus(this.minus.createDuplicate());
}
c.setNoEndCap(this.noEndCap);
if(this.plus)
{
c.setPlus(this.plus.createDuplicate());
}
if(this.spPr)
{
c.setSpPr(this.spPr.createDuplicate());
}
c.setVal(this.val);
return c;
},
getObjectType: function()
{
return historyitem_type_ErrBars;
......@@ -8521,6 +8889,21 @@ CLayout.prototype =
this.Id = r.GetString2();
},
createDuplicate: function()
{
var c = new CLayout();
c.setH(this.h);
c.setHMode(this.hMode);
c.setLayoutTarget(this.layoutTarget);
c.setW(this.w);
c.setWMode(this.wMode);
c.setX(this.x);
c.setXMode(this.xMode);
c.setY(this.y);
c.setYMode(this.yMode);
return c;
},
getObjectType: function()
{
return historyitem_type_Layout;
......@@ -8893,6 +9276,30 @@ CLegend.prototype =
Refresh_RecalcData: function()
{},
createDuplicate: function()
{
var c = new CLegend();
if(this.layout)
{
c.setLayout(this.layout.createDuplicate());
}
for(var i = 0; i < this.legendEntryes.length; ++i)
{
c.addLegendEntry(this.legendEntryes[i].createDuplicate());
}
c.setLegendPos(this.legendPos);
c.setOverlay(this.overlay);
if(this.spPr)
{
c.setSpPr(this.spPr.createDuplicate());
}
if(this.txPr)
{
c.setTxPr(this.txPr.createDuplicate());
}
return c;
},
Write_ToBinary2: function (w)
{
w.WriteLong(this.getObjectType());
......@@ -9339,6 +9746,18 @@ CLegendEntry.prototype =
return historyitem_type_LegendEntry;
},
createDuplicate: function()
{
var c = new CLegendEntry();
c.setDelete(this.bDelete);
c.setIdx(this.idx);
if(this.txPr)
{
c.setTxPr(this.txPr.createDuplicate());
}
return c;
},
Get_Id: function()
{
return this.Id;
......@@ -9541,6 +9960,36 @@ CLineChart.prototype =
return historyitem_type_LineChart;
},
craeteDuplicate: function()
{
var c = new CLineChart();
if(this.dLbls)
{
c.setDLbls(this.dLbls.createDuplicate());
}
if(this.dropLines)
{
c.setDropLines(this.dropLines.createDuplicate());
}
c.setGrouping(this.grouping);
if(this.hiLowLines)
{
c.setHiLowLines(this.hiLowLines.createDuplicate());
}
c.setMarker(this.marker);
for(var i = 0; i < this.series.length; ++i)
{
c.addSer(this.series[i].createDuplicate());
}
c.setSmooth(this.smooth);
if(this.upDownBars)
{
c.setUpDownBars(this.upDownBars.createDuplicate());
}
c.setVaryColors(this.varyColors);
return c;
},
getAllRasterImages: function(images)
{
......@@ -9934,6 +10383,50 @@ CLineSeries.prototype =
Refresh_RecalcData: function()
{},
createDuplicate: function()
{
var c = new CLineSeries();
if(this.cat)
{
c.setCat(this.cat.createDuplicate());
}
if(this.dLbls)
{
c.setDLbls(this.dLbls.createDuplicate());
}
for(var i = 0; i < this.dPt.length; ++i)
{
c.addDPt(this.dPt.createDuplicate());
}
if(this.errBars)
{
c.setErrBars(this.errBars.createDuplicate());
}
c.setIdx(this.idx);
if(this.marker)
{
c.setMarker(this.marker.createDuplicate());
}
c.setOrder(this.order);
c.setSmooth(this.smooth);
if(this.spPr)
{
c.setSpPr(this.spPr.createDuplicate());
}
if(this.trendline)
{
c.setTrendline(this.trendline.createDuplicate());
}
if(this.tx)
{
c.setTx(this.tx.createDuplicate());
}
if(this.val)
{
c.setVal(this.val.createDuplicate());
}
return c;
},
getObjectType: function()
{
......@@ -10344,7 +10837,6 @@ CMarker.prototype =
return this.Id;
},
Refresh_RecalcData: function()
{},
......@@ -10370,11 +10862,11 @@ CMarker.prototype =
{
if(isRealNumber(otherMarker.size))
{
this.size = otherMarker.size;
this.setSize(otherMarker.size);
}
if(isRealNumber(otherMarker.symbol))
{
this.symbol = otherMarker.symbol;
this.setSymbol(otherMarker.symbol);
}
if(otherMarker.spPr && (otherMarker.spPr.Fill || otherMarker.spPr.ln))
{
......@@ -10560,6 +11052,20 @@ CMinusPlus.prototype =
Refresh_RecalcData: function()
{},
createDuplicate: function()
{
var c = new CMinusPlus();
if(this.numRef)
{
c.setNumRef(this.numRef.createDuplicate());
}
if(this.numLit)
{
c.setNumLit(this.numLit.craeteDuplicate());
}
return c;
},
getObjectType: function()
{
return historyitem_type_MinusPlus;
......@@ -10694,6 +11200,18 @@ CMultiLvlStrCache.prototype =
Refresh_RecalcData: function()
{},
createDuplicate: function()
{
var c = new CMultiLvlStrCache();
if(this.lvl)
{
c.setLvl(this.lv.createDuplicate());
}
c.setPtCount(this.ptCount);
return c;
},
getObjectType: function()
{
return historyitem_type_MultiLvlStrCache;
......@@ -10818,6 +11336,17 @@ CMultiLvlStrRef.prototype =
this.Id = r.GetString2();
},
createDuplicate: function()
{
var c = new CMultiLvlStrRef();
c.setF(this.f);
if(this.multiLvlStrCache)
{
c.setMultiLvlStrCache(this.multiLvlStrCache.createDuplicate());
}
return c;
},
setF: function(pr)
{
History.Add(this, {Type: historyitem_MultiLvlStrRef_SetF, oldPr: this.f, newPr: pr});
......@@ -10922,6 +11451,16 @@ CNumRef.prototype =
Refresh_RecalcData: function()
{},
createDuplicate: function()
{
var c = new CNumRef();
c.setF(this.f);
if(this.numCache)
{
c.setNumCache(this.numCache.createDuplicate());
}
},
getObjectType: function()
{
return historyitem_type_NumRef;
......@@ -10988,13 +11527,13 @@ CNumRef.prototype =
switch(data.Type)
{
case historyitem_NumRef_SetF:
case historyitem_NumRef_SetNumCache:
{
w.WriteBool(isRealObject(data.newPr));
if(isRealObject(data.newPr))
{
w.WriteString2(data.newPr.Get_Id());
writeString(w, data.newPr);
break;
}
case historyitem_NumRef_SetNumCache:
{
writeObject(w, data.newPr);
break;
}
}
......@@ -11007,26 +11546,12 @@ CNumRef.prototype =
{
case historyitem_NumRef_SetF:
{
if(r.GetBool())
{
this.f = g_oTableId.Get_ById(r.GetString2());
}
else
{
this.f = null;
}
this.f = readString(r);
break;
}
case historyitem_NumRef_SetNumCache:
{
if(r.GetBool())
{
this.numCache = g_oTableId.Get_ById(r.GetString2());
}
else
{
this.numCache = null;
}
this.numCache = readObject(r);
}
}
}
......@@ -11051,6 +11576,15 @@ CNumericPoint.prototype =
},
createDuplicate: function()
{
var c = new CNumericPoint();
c.setFormatCode(this.formatCode);
c.setIdx(this.idx);
c.setVal(this.val);
return c;
},
Refresh_RecalcData: function()
{},
......@@ -11225,6 +11759,14 @@ CNumFmt.prototype =
Refresh_RecalcData: function()
{},
createDuplicate: function()
{
var c = new CNumFmt();
c.setFormatCode(this.formatCode);
c.setSourceLinked(this.sourceLinked);
return c;
},
getObjectType: function()
{
return historyitem_type_NumFmt;
......@@ -11349,6 +11891,18 @@ CNumLit.prototype =
{},
createDuplicate: function()
{
var c = new CNumLit();
c.setFormatCode(this.formatCode);
for(var i = 0; i < this.pts.length; ++i)
{
c.addPt(this.pts[i].createDuplicate());
}
c.setPtCount(this.ptCount);
return c;
},
getPtByIndex: function(idx)
{
for(var i = 0; i < this.pts.length; ++i)
......@@ -11542,6 +12096,34 @@ COfPieChart.prototype =
Refresh_RecalcData: function()
{},
createDuplicate: function()
{
var c = new COfPieChart(), i;
for(i = 0; i < this.custSplit.length; ++i)
{
c.addCustSplit(this.custSplit[i].createDuplicate());
}
if(this.dLbls)
{
c.setDLbls((this.dLbls.createDuplicate()));
}
c.setGapWidth(this.gapWidth);
c.setOfPieType(this.ofPieType);
c.setSecondPieSize(this.secondPieSize);
for(i = 0; i < this.series.length; ++i)
{
c.addSer(this.series[i].createDuplicate());
}
if(this.serLines)
{
c.setSerLines(this.serLines.createDuplicate());
}
c.setSplitPos(this.splitPos);
c.setSplitType(this.splitType);
c.setVaryColors(this.varyColors);
return c;
},
getObjectType: function()
{
return historyitem_type_OfPieChart;
......@@ -11958,6 +12540,17 @@ CPictureOptions.prototype =
Refresh_RecalcData: function()
{},
createDuplicate: function()
{
var c = new CPictureOptions();
c.setApplyToEnd(this.applyToEnd);
c.setApplyToFront(this.applyToFront);
c.setApplyToSides(this.applyToSides);
c.setPictureFormat(this.pictureFormat);
c.setPictureStackUnit(this.pictureStackUnit);
return c;
},
getObjectType: function()
{
return historyitem_type_PictureOptions;
......@@ -12146,6 +12739,22 @@ CPieChart.prototype =
Refresh_RecalcData: function()
{},
createDuplicate: function()
{
var c = new CPieChart();
if(this.dLbls)
{
c.setDLbls(this.dLbls.createDuplicate());
}
c.setFirstSliceAng(this.firstSliceAng);
for(var i = 0; i < this.series.length; ++i)
{
c.addSer(this.series[i].createDuplicate());
}
c.setVaryColors(this.varyColors);
return c;
},
getObjectType: function()
{
return historyitem_type_PieChart;
......@@ -12398,6 +13007,39 @@ CPieSeries.prototype =
Refresh_RecalcData: function()
{},
createDuplicate: function()
{
var c = new CPieSeries();
if(this.cat)
{
c.setCat(this.cat.createDuplicate());
}
if(this.dLbls)
{
c.setDLbls(this.dLbls.createDuplicate());
}
for(var i = 0; i < this.dPt.length; ++i)
{
c.addDPt(this.dPt[i].createDuplicate());
}
c.setExplosion(this.explosion);
c.setIdx(this.idx);
c.setOrder(this.order);
if(this.spPr)
{
c.setSpPr(this.spPr.createDuplicate());
}
if(this.tx)
{
c.setTx(this.tx.createDuplicate());
}
if(this.val)
{
c.setVal(this.val.createDuplicate());
}
return c;
},
getObjectType: function()
{
return historyitem_type_PieSeries;
......@@ -12713,6 +13355,29 @@ CPivotFmt.prototype =
Refresh_RecalcData: function()
{},
createDuplicate: function()
{
var c = new CPivotFmt();
if(this.dLbl)
{
c.setLbl(this.dLbl.createDuplicate());
}
c.setIdx(this.idx);
if(this.marker)
{
c.setMarker(this.marker.createDuplicate());
}
if(this.spPr)
{
c.setSpPr(this.spPr.createDuplicate());
}
if(this.txPr)
{
c.setTxPr(this.txPr.craeteDuplicate());
}
return c;
},
getObjectType: function()
{
return historyitem_type_PivotFmt;
......@@ -12937,6 +13602,22 @@ CRadarChart.prototype =
Refresh_RecalcData: function()
{},
createDuplicate: function()
{
var c = new CRadarChart();
if(this.dLbls)
{
c.setDLbls(this.dLbls.craeteDuplicate());
}
c.setRadarStyle(this.radarStyle);
for(var i = 0; i < this.series.length; ++i)
{
c.addSer(this.series[i].createDuplicate());
}
c.setVaryColors(this.varyColors);
return c;
},
getObjectType: function()
{
return historyitem_type_RadarChart;
......@@ -13200,6 +13881,42 @@ CRadarSeries.prototype =
Refresh_RecalcData: function()
{},
createDuplicate: function()
{
var c = new CRadarSeries();
if(this.cat)
{
c.setCat(this.cat.createDuplicate());
}
if(this.dLbls)
{
c.setDLbls(this.dLbls.craeteDuplicate());
}
for(var i = 0; i < this.dPt.length; ++i)
{
c.addDPt(this.dPt[i].createDuplicate());
}
c.setIdx(this.idx);
if(this.marker)
{
c.setMarker(this.marker.createDuplicate());
}
c.setOrder(this.order);
if(this.spPr)
{
c.setSpPr(this.spPr.createDuplicate());
}
if(this.tx)
{
c.setTx(this.tx.createDuplicate());
}
if(this.val)
{
c.setVal(this.val.createDuplicate());
}
return c;
},
getObjectType: function()
{
return historyitem_type_RadarSeries;
......@@ -13509,6 +14226,16 @@ CScaling.prototype =
Refresh_RecalcData: function()
{},
createDuplicate: function()
{
var c = new CScaling();
c.setLogBase(this.logBase);
c.setMax(this.max);
c.setMin(this.min);
c.setOrientation(this.orientation);
return c;
},
getObjectType: function()
{
return historyitem_type_Scaling;
......@@ -13683,6 +14410,22 @@ CScatterChart.prototype =
Refresh_RecalcData: function()
{},
createDuplicate: function()
{
var c = new CScatterChart();
if(this.dLbls)
{
c.setDLbls(this.dLbls.createDuplicate());
}
c.setScatterStyle(this.scatterStyle);
for(var i = 0; i < this.series.length; ++i)
{
c.addSer(this.series[i].createDuplicate());
}
c.setVaryColors(this.varyColors);
return c;
},
getObjectType: function()
{
return historyitem_type_ScatterChart;
......@@ -13957,6 +14700,48 @@ CScatterSeries.prototype =
documentCreateFontMap: CAreaSeries.prototype.documentCreateFontMap,
createDuplicate: function()
{
var c = new CScatterSeries();
c.setDLbls(this.dLbls.createDuplicate());
for(var i = 0; i < this.dPt.length; ++i)
{
c.addDPt(this.dPt[i].createDuplicate());
}
if(this.errBars)
{
c.setErrBars(this.errBars.createDuplicate());
}
c.setIdx(this.idx);
if(this.marker)
{
c.setMarker(this.marker.createDuplicate());
}
c.setOrder(this.order);
c.setSmooth(this.smooth);
if(this.spPr)
{
c.setSpPr(this.spPr.craeteDuplicate());
}
if(this.trendline)
{
c.setTrendline(this.trendline.createDuplicate())
}
if(this.tx)
{
c.setTx(this.tx.createDuplicate());
}
if(this.xVal)
{
c.setXVal(this.xVal.createDuplicate());
}
if(this.yVal)
{
c.setYVal(this.yVal.createDuplicate());
}
return c;
},
Refresh_RecalcData: function()
{},
......@@ -14429,6 +15214,17 @@ CTx.prototype =
Refresh_RecalcData: function()
{},
createDuplicate: function()
{
var c = new CTx();
if(this.strRef)
{
c.setStrRef(this.strRef.createDuplicate());
}
c.setVal(this.val);
return c;
},
getObjectType: function()
{
return historyitem_type_Tx;
......@@ -14553,6 +15349,32 @@ CStockChart.prototype =
Refresh_RecalcData: function()
{},
createDuplicate: function()
{
var c = new CStockChart();
if(this.dLbls)
{
c.setDLbls(this.dLbls.createDuplicate());
}
if(this.dropLines)
{
c.setDropLines(this.dropLines.createDuplicate());
}
if(this.hiLowLines)
{
c.setHiLowLines(this.hiLowLines.createDuplicate());
}
for(var i = 0; i < this.series.length; ++i)
{
c.addSer(this.series[i].createDuplicate());
}
if(this.upDownBars)
{
c.setUpDownBars(this.upDownBars.createDuplicate());
}
return c;
},
getObjectType: function()
{
return historyitem_type_StockChart;
......@@ -14780,6 +15602,17 @@ CStrCache.prototype =
Refresh_RecalcData: function()
{},
createDuplicate: function()
{
var c = new CStrCache();
for(var i = 0; i < this.pt.length; ++i)
{
c.addPt(this.pt[i].createDuplicate());
}
c.setPtCount(this.ptCount);
return c;
},
getPtByIndex: function(idx)
{
for(var i = 0; i < this.pt.length; ++i)
......@@ -14921,6 +15754,17 @@ CStringLiteral.prototype =
Refresh_RecalcData: function()
{},
createDuplicate: function()
{
var c = new CStrCache();
for(var i = 0; i < this.pt.length; ++i)
{
c.addPt(this.pt[i].createDuplicate());
}
c.setPtCount(this.ptCount);
return c;
},
getObjectType: function()
{
return historyitem_type_StringLiteral;
......@@ -15029,6 +15873,14 @@ CStringPoint.prototype =
Refresh_RecalcData: function()
{},
createDuplicate: function()
{
var c = new CStringPoint();
c.setIdx(this.idx);
c.setVal(this.val);
return c;
},
getObjectType: function()
{
return historyitem_type_StrPoint;
......@@ -15149,6 +16001,17 @@ CStrRef.prototype =
Refresh_RecalcData: function()
{},
createDuplicate: function()
{
var c = new CStrRef();
c.setF(this.f);
if(this.strCache)
{
c.setStrCache(this.strCache.createDuplicate());
}
return c;
},
getObjectType: function()
{
return historyitem_type_StrRef;
......@@ -15269,6 +16132,21 @@ CSurfaceChart.prototype =
Refresh_RecalcData: function()
{},
createDuplicate: function()
{
var c = new CSurfaceChart(), i;
for(i = 0; i < this.bandFmts.length; ++i)
{
c.addBandFmt(this.bandFmts[i].craeteDuplicate());
}
for(var i =0 ; i < this.series.length; ++i)
{
c.addSer(this.series[i].createDuplicate());
}
c.setWireframe(this.wireframe);
return c;
},
getObjectType: function()
{
return historyitem_type_SurfaceChart;
......@@ -15512,6 +16390,31 @@ CSurfaceSeries.prototype =
Refresh_RecalcData: function()
{},
createDuplicate: function()
{
var c = new CSurfaceSeries();
if(this.cat)
{
c.setCat(this.cat.createDuplicate());
}
c.setIdx(this.idx);
c.setOrder(this.order);
if(this.spPr)
{
c.setSpPr(this.spPr.createDuplicate());
}
if(this.tx)
{
c.setTx(this.tx.createDuplicate());
}
if(this.val)
{
c.setVal(this.val.createDuplicate());
}
return c;
},
getObjectType: function()
{
return historyitem_type_SurfaceSeries;
......@@ -15786,6 +16689,29 @@ CTitle.prototype =
Refresh_RecalcData: function()
{},
createDuplicate: function()
{
var c = new CTitle();
if(this.layout)
{
c.setLayout(this.layout.createDuplicate());
}
c.setOverlay(this.overlay);
if(this.spPr)
{
c.setSpPr(this.spPr.createDuplicate());
}
if(this.tx)
{
c.setTx(this.tx.craeteDuplicate());
}
if(this.txPr)
{
c.setTxPr(this.txPr.createDuplciate());
}
return c;
},
getObjectType: function()
{
return historyitem_type_Chart;
......
......@@ -305,7 +305,7 @@ CChartSpace.prototype =
if(axis)
{
axis.spPr && axis.spPr.checkBlipFillRasterImage(images);
axis.title && axis.title && axis.title.spPr.checkBlipFillRasterImage(images);
axis.title && axis.title && axis.title.spPr && axis.title.spPr.checkBlipFillRasterImage(images);
}
}
for(i = 0; i < plot_area.charts.length; ++i)
......@@ -324,7 +324,10 @@ CChartSpace.prototype =
documentGetAllFontNames: function(allFonts)
{
var parent_objects = this.getParentObjects();
checkTxBodyDefFonts(this.txPr);
allFonts["+mn-lt"] = 1;
allFonts["+mn-ea"] = 1;
allFonts["+mn-cs"] = 1;
checkTxBodyDefFonts(allFonts, this.txPr);
var chart = this.chart, i;
if(chart)
{
......@@ -4415,21 +4418,8 @@ CChartSpace.prototype =
var RGBA = {R: 0, G: 0, B: 0, A: 255};
if(this.chart.plotArea.chart.varyColors && series.length === 1 || ((this.chart.plotArea.chart instanceof CPieChart || this.chart.plotArea.chart instanceof CDoughnutChart) && this.chart.plotArea.chart.varyColors))
{
var pts;
var ser = series[0];
if(ser.val)
{
pts = ser.val.numRef.numCache.pts;
}
else if(ser.yVal)
{
pts = ser.yVal.numRef.numCache.pts;
}
else
{
pts = [];
}
var pts = getPtsFromSeries(ser);
if(!(this.chart.plotArea.chart instanceof CLineChart))
{
var base_fills = getArrayFillsFromBase(style.fill2, getMaxIdx(pts));
......@@ -4557,19 +4547,7 @@ CChartSpace.prototype =
for(var i = 0; i < series.length; ++i)
{
var ser = series[i];
var pts;
if(ser.val)
{
pts = ser.val.numRef.numCache.pts;
}
else if(ser.yVal)
{
pts = ser.yVal.numRef.numCache.pts;
}
else
{
pts = [];
}
var pts = getPtsFromSeries(ser);
for(var j = 0; j < pts.length; ++j)
{
var compiled_brush = new CUniFill();
......@@ -4664,19 +4642,7 @@ CChartSpace.prototype =
{
var default_line = parents.theme.themeElements.fmtScheme.lnStyleLst[0];
var ser = series[i];
var pts;
if(ser.val)
{
pts = ser.val.numRef.numCache.pts;
}
else if(ser.yVal)
{
pts = ser.yVal.numRef.numCache.pts;
}
else
{
pts = [];
}
var pts = getPtsFromSeries(ser);
for(var j = 0; j < pts.length; ++j)
{
var compiled_line = new CLn();
......@@ -4736,18 +4702,7 @@ CChartSpace.prototype =
if(this.chart.plotArea.chart.varyColors && (this.chart.plotArea.chart.series.length === 1 || this.chart.plotArea.chart.getObjectType() === historyitem_type_PieChart || this.chart.plotArea.chart.getObjectType() === historyitem_type_DoughnutChart))
{
var ser = this.chart.plotArea.chart.series[0], pts;
if(ser.val)
{
pts = ser.val.numRef.numCache.pts;
}
else if(ser.yVal)
{
pts = ser.yVal.numRef.numCache.pts;
}
else
{
pts = [];
}
pts = getPtsFromSeries(ser);
var series_marker = ser.marker;
var brushes = getArrayFillsFromBase(fill, getMaxIdx(pts));
var pens_fills = getArrayFillsFromBase(line, getMaxIdx(pts));
......@@ -4816,18 +4771,7 @@ CChartSpace.prototype =
for(var i = 0; i < series.length; ++i)
{
var ser = series[i];
if(ser.val)
{
pts = ser.val.numRef.numCache.pts;
}
else if(ser.yVal)
{
pts = ser.yVal.numRef.numCache.pts;
}
else
{
pts = [];
}
pts = getPtsFromSeries(ser);
for(var j = 0; j < pts.length; ++j)
{
var compiled_marker = new CMarker();
......@@ -4871,18 +4815,7 @@ CChartSpace.prototype =
{
var ser = series[i];
ser.compiledSeriesMarker = null;
if(ser.val)
{
pts = ser.val.numRef.numCache.pts;
}
else if(ser.yVal)
{
pts = ser.yVal.numRef.numCache.pts;
}
else
{
pts = [];
}
pts = getPtsFromSeries(ser);
for(var j = 0; j < pts.length; ++j)
{
pts[j].compiledMarker = null;
......@@ -5469,11 +5402,17 @@ function getPtsFromSeries(ser)
{
if(ser.val)
{
if(ser.val.numRef && ser.val.numRef.numCache)
return ser.val.numRef.numCache.pts;
else if(ser.val.numLit)
return ser.val.numLit.pts
}
else if(ser.yVal)
{
if(ser.yVal.numRef && ser.yVal.numRef.numCache)
return ser.yVal.numRef.numCache.pts;
else if(ser.yVal.numLit)
return ser.yVal.numLit.pts
}
}
return [];
......
......@@ -608,6 +608,28 @@ CColorModifiers.prototype =
Refresh_RecalcData: function()
{},
Write_ToBinary: function(w)
{
w.WriteLong(this.Mods.length);
for(var i = 0; i < this.Mods.length; ++i)
{
w.WriteString2(this.Mods[i].name);
w.WriteString2(this.Mods[i].val);
}
},
Read_FromBinary: function(r)
{
var len = r.GetLong();
for(var i = 0; i < len; ++i)
{
var mod = new CColorMod();
mod.name = r.GetString2();
mod.val = r.GetDouble();
this.Mods.push(mod);
}
},
Write_ToBinary2: function (w) {
w.WriteLong(this.getObjectType());
w.WriteString2(this.Id);
......@@ -1074,6 +1096,24 @@ CSysColor.prototype =
this.Id = r.GetString2();
},
Write_ToBinary: function (w)
{
w.WriteLong(COLOR_TYPE_SYS);
w.WriteString2(this.id);
w.WriteLong(((this.RGBA.R << 16) & 0xFF0000) + ((this.RGBA.G << 8) & 0xFF00) + this.RGBA.B);
},
Read_FromBinary: function (r)
{
this.id = r.GetString2();
var RGB = r.GetLong();
this.RGBA.R = (RGB >> 16) & 0xFF;
this.RGBA.G = (RGB >> 8) & 0xFF;
this.RGBA.B = RGB & 0xFF;
},
Undo: function(data)
{
switch(data.Type)
......@@ -1244,6 +1284,18 @@ CPrstColor.prototype =
this.Id = r.GetString2();
},
Write_ToBinary: function (w)
{
w.WriteLong(COLOR_TYPE_PRST);
w.WriteString2(this.id);
},
Read_FromBinary: function (r)
{
this.id = r.GetString2();
},
setId: function(id)
{
//History.Add(this, {Type: historyitem_PrstColor_SetId, oldId: this.id, newId: id});
......@@ -1373,6 +1425,20 @@ CRGBColor.prototype =
this.RGBA.B = RGB & 0xFF;
},
Write_ToBinary: function(w)
{
w.WriteLong(COLOR_TYPE_SRGB);
w.WriteLong(((this.RGBA.R << 16) & 0xFF0000) + ((this.RGBA.G << 8) & 0xFF00) + this.RGBA.B);
},
Read_FromBinary: function(r)
{
var RGB = r.GetLong();
this.RGBA.R = (RGB >> 16) & 0xFF;
this.RGBA.G = (RGB >> 8) & 0xFF;
this.RGBA.B = RGB & 0xFF;
},
setColor: function(r, g, b)
{
var rgba = this.RGBA;
......@@ -1547,6 +1613,18 @@ CSchemeColor.prototype =
this.Id = r.GetString2();
},
Write_ToBinary: function (w)
{
w.WriteLong(COLOR_TYPE_SCHEME);
w.WriteLong(this.id);
},
Read_FromBinary: function (r)
{
this.id = r.GetLong();
},
setId: function(id)
{
//History.Add(this, {Type: historyitem_SchemeColor_SetId, oldId: this.id, newId: id});
......@@ -1820,6 +1898,76 @@ CUniColor.prototype =
}
},
Write_ToBinary: function(w)
{
if(this.color)
{
w.WriteBool(true);
this.color.Write_ToBinary(w);
}
else
{
w.WriteBool(false);
}
if(this.Mods)
{
w.WriteBool(true);
this.Mods.Write_ToBinary(w);
}
else
{
w.WriteBool(false);
}
},
Read_FromBinary: function(r)
{
if(r.GetBool())
{
var type = r.GetLong();
switch(type)
{
case COLOR_TYPE_NONE:
{
break;
}
case COLOR_TYPE_SRGB:
{
this.color = new CRGBColor();
this.color.Read_FromBinary(r);
break;
}
case COLOR_TYPE_PRST:
{
this.color = new CPrstColor();
this.color.Read_FromBinary(r);
break;
}
case COLOR_TYPE_SCHEME:
{
this.color = new CSchemeColor();
this.color.Read_FromBinary(r);
break;
}
case COLOR_TYPE_SYS:
{
this.color = new CSysColor();
this.color.Read_FromBinary(r);
break;
}
}
}
if(r.GetBool())
{
this.Mods = new CColorModifiers();
this.Mods.Read_FromBinary(r);
}
else
{
this.Mods = null;
}
},
createDuplicate : function()
{
var duplicate = new CUniColor();
......@@ -2164,6 +2312,51 @@ CBlipFill.prototype =
return this.Id;
},
Write_ToBinary: function(w)
{
w.WriteLong(this.type);
writeString(w, this.RasterImageId);
writeString(w, this.VectorImageBin);
if(this.srcRect)
{
writeBool(true);
writeDouble(this.srcRect.l);
writeDouble(this.srcRect.t);
writeDouble(this.srcRect.r);
writeDouble(this.srcRect.b);
}
else
{
writeBool(false);
}
writeBool(this.stretch);
writeBool(this.tile);
writeBool(this.rotWithShape);
},
Read_FromBinary: function(r)
{
this.RasterImageId = readString(r);
this.VectorImageBin = readString(r);
if(readBool(r))
{
this.srcRect = new CSrcRect();
this.srcRect.l = readDouble(r);
this.srcRect.t = readDouble(r);
this.srcRect.r = readDouble(r);
this.srcRect.b = readDouble(r);
}
else
{
this.srcRect = null;
}
this.stretch = readBool(r);
this.tile = readBool(r);
this.rotWithShape = readBool(r);
},
Refresh_RecalcData: function()
{},
......@@ -2460,6 +2653,7 @@ CBlipFill.prototype =
this.Id = r.GetString2();
},
createDuplicate : function()
{
var duplicate = new CBlipFill();
......@@ -2581,6 +2775,28 @@ CSolidFill.prototype =
this.color = color;
},
Write_ToBinary: function(w)
{
if(this.color)
{
w.WriteBool(true);
this.color.Write_ToBinary(w);
}
else
{
w.WriteBool(false);
}
},
Read_FromBinary: function(r)
{
if(r.GetBool())
{
this.color = new CUniColor();
this.color.Read_FromBinary(r);
}
},
Undo: function(data)
{
switch(data.Type)
......@@ -3680,6 +3896,16 @@ CNoFill.prototype =
Load_Changes: function()
{},
Write_ToBinary: function(w)
{
w.WriteLong(FILL_TYPE_NOFILL);
},
Read_FromBinary: function(r)
{
},
Write_ToBinary2: function (w)
{
w.WriteLong(this.getObjectType());
......@@ -3897,10 +4123,54 @@ CUniFill.prototype =
},
Write_ToBinary: function(w)
{},
{
writeDouble(w, this.transparent);
if(this.fill)
this.fill.Write_ToBinary();
},
Read_FromBinary: function()
{},
Read_FromBinary: function(r)
{
this.transparent = readDouble(r);
var type = r.GetLong();
switch(type)
{
case FILL_TYPE_NONE:
{
break;
}
case FILL_TYPE_BLIP:
{
this.fill = new CBlipFill();
this.fill.Read_FromBinary(r);
break;
}
case FILL_TYPE_NOFILL:
{
this.fill = new CNoFill();
this.fill.Read_FromBinary(r);
break;
}
case FILL_TYPE_SOLID:
{
this.fill = new CSolidFill();
this.fill.Read_FromBinary(r);
break;
}
case FILL_TYPE_GRAD:
{
this.fill = new CGradFill();
this.fill.Read_FromBinary(r);
break;
}
case FILL_TYPE_PATT:
{
this.fill = new CPattFill();
this.fill.Read_FromBinary(r);
break;
}
}
},
......@@ -4056,6 +4326,151 @@ function CompareUniFill(unifill_1, unifill_2)
_ret.fill = unifill_1.compare(unifill_2);
return _ret;
}
function CompareUnifillBool(u1, u2)
{
if(!u1 && !u2)
return true;
if(!u1 && u2 || u1 && !u2)
return false;
if(!u1.fill && !u2.fill)
return true;
if(!u1.fill && u2.fill || u1.fill && !u2.fill)
return false;
if(u1.fill.type !== u2.fill.type)
return false
switch(u1.fill.type)
{
case FILL_TYPE_BLIP:
{
if(u1.fill.RasterImageId && !u2.fill.RasterImageId || u2.fill.RasterImageId && !u1.fill.RasterImageId)
return false;
if(typeof u1.fill.RasterImageId === "string" && typeof u2.fill.RasterImageId === "string"
&& _getFullImageSrc(u1.fill.RasterImageId) !== _getFullImageSrc(u2.fill.RasterImageId))
return false;
if(u1.fill.VectorImageBin !== u2.fill.VectorImageBin)
return false;
if(u1.fill.srcRect && !u2.fill.srcRect || !u1.fill.srcRect && u2.fill.srcRect)
return false;
if(u1.fill.srcRect && u2.fill.srcRect)
{
if( u1.fill.srcRect.l !== u2.fill.srcRect.l||
u1.fill.srcRect.t !== u2.fill.srcRect.t||
u1.fill.srcRect.r !== u2.fill.srcRect.r||
u1.fill.srcRect.b !== u2.fill.srcRect.b)
return false;
}
if(u1.fill.stretch !== u2.fill.stretch || u1.fill.tile !== u2.fill.tile || u1.fill.rotWithShape !== u2.fill.rotWithShape)
return false;
break;
}
case FILL_TYPE_SOLID:
{
if(u1.fill.color && u2.fill.color)
{
return CompareUniColor(u1.fill.color, u2.fill.color)
}
break;
}
case FILL_TYPE_GRAD:
{
if(u1.fill.colors.length !== u2.fill.colors.length)
return false;
for(var i = 0; i < u1.fill.colors.length; ++i)
{
if(u1.fill.colors[i].pos !== u1.fill.colors[i].pos
|| ! CompareUniColor(u1.fill.colors[i].color, u2.fill.colors[i].color))
return false;
}
break;
}
case FILL_TYPE_PATT:
{
if(u1.fill.ftype !== u2.fill.ftype
|| !CompareUniColor(u1.fill.fgClr, u2.fill.fgClr)
|| !CompareUniColor(u1.fill.bgClr, u2.fill.bgClr))
return false;
break;
}
}
return true;
}
function CompareUniColor(u1, u2)
{
if(!u1 && !u2)
return true;
if(!u1 && u2 || u1 && !u2)
return false;
if(!u1.color && u2.color || u1.color && !u2.color)
return false;
if(u1.color && u2.color)
{
if(u1.color.type !== u2.color.type)
return false;
switch (u1.color.type)
{
case COLOR_TYPE_NONE:
{
break;
}
case COLOR_TYPE_SRGB:
{
if(u1.color.RGBA.R !== u2.color.RGBA.R
|| u1.color.RGBA.G !== u2.color.RGBA.G
|| u1.color.RGBA.B !== u2.color.RGBA.B
|| u1.color.RGBA.A !== u2.color.RGBA.A)
{
return false;
}
break;
}
case COLOR_TYPE_PRST:
case COLOR_TYPE_SCHEME:
{
if(u1.color.id !== u2.color.id)
return false;
break;
}
case COLOR_TYPE_SYS:
{
if(u1.color.RGBA.R !== u2.color.RGBA.R
|| u1.color.RGBA.G !== u2.color.RGBA.G
|| u1.color.RGBA.B !== u2.color.RGBA.B
|| u1.color.RGBA.A !== u2.color.RGBA.A
|| u1.color.id !== u2.color.id)
{
return false;
}
break;
}
}
}
if(!u1.Mods && u2.Mods || !u2.Mods && u1.Mods)
return false;
if(u1.Mods && u2.Mods)
{
if(u1.Mods.length !== u2.Mods.length)
return false;
for(var i = 0; i < u1.Mods.length; ++i)
{
if(u1.Mods[i].name !== u2.Mods[i].name
|| u1.Mods[i].val !== u2.Mods[i].val)
return false;
}
}
return true;
}
// -----------------------------
function CompareShapeProperties(shapeProp1, shapeProp2)
......
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