Commit 7533eeeb authored by Sergey.Luzyanin's avatar Sergey.Luzyanin

Испралены баги в копировании некоторых классов из ChartSpace.js. Перенесены...

Испралены баги в копировании некоторых классов из ChartSpace.js. Перенесены методы из некоторохых классов Format.js в прототип. Удален неиспользуемый код.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@60958 954022d7-b5bf-4e40-9824-e11837661b57
parent 4dda7557
...@@ -8626,10 +8626,15 @@ CProtection.prototype = ...@@ -8626,10 +8626,15 @@ CProtection.prototype =
createDuplicate: function() createDuplicate: function()
{ {
var c = new CProtection(); var c = new CProtection();
c.setChartObject (this.chartObject ); if(this.chartObject !== null)
c.setData (this.data); c.setChartObject(this.chartObject);
c.setFormatting (this.formatting); if(this.data !== null)
c.setSelection (this.selection); c.setData(this.data);
if(this.formatting !== null)
c.setFormatting(this.formatting);
if(this.selection !== null)
c.setSelection(this.selection);
if(this.userInterface !== null)
c.setUserInterface(this.userInterface); c.setUserInterface(this.userInterface);
return c; return c;
}, },
...@@ -8773,13 +8778,13 @@ CPrintSettings.prototype = ...@@ -8773,13 +8778,13 @@ CPrintSettings.prototype =
var oPS = new CPrintSettings(); var oPS = new CPrintSettings();
if ( this.headerFooter ) if ( this.headerFooter )
oPS.headerFooter = this.headerFooter.createDuplicate(); oPS.setHeaderFooter(this.headerFooter.createDuplicate());
if ( this.pageMargins ) if ( this.pageMargins )
oPS.pageMargins = this.pageMargins.createDuplicate(); oPS.setPageMargins(this.pageMargins.createDuplicate());
if ( this.pageSetup ) if ( this.pageSetup )
oPS.pageSetup = this.pageSetup.createDuplicate(); oPS.setPageSetup(this.pageSetup.createDuplicate());
return oPS; return oPS;
}, },
...@@ -8928,30 +8933,33 @@ CHeaderFooterChart.prototype = ...@@ -8928,30 +8933,33 @@ CHeaderFooterChart.prototype =
createDuplicate : function() createDuplicate : function()
{ {
// TODO: Проверить работу данной функции
var oHFC = new CHeaderFooterChart(); var oHFC = new CHeaderFooterChart();
oHFC.alignWithMargins = this.alignWithMargins; if(this.alignWithMargins !== null)
oHFC.differentFirst = this.differentFirst; oHFC.setAlignWithMargins(this.alignWithMargins);
oHFC.differentOddEven = this.differentOddEven; if(this.differentFirst !== null)
oHFC.setDifferentFirst(this.differentFirst);
if ( this.evenFooter ) if(this.differentOddEven !== null)
oHFC.evenFooter = this.evenFooter.createDuplicate(); oHFC.setDifferentOddEven(this.differentOddEven);
if ( this.evenHeader ) if ( this.evenFooter !== null )
oHFC.evenHeader = this.evenHeader.createDuplicate(); oHFC.setEvenFooter(this.evenFooter);
if ( this.firstFooter ) if ( this.evenHeader !== null)
oHFC.firstFooter = this.firstFooter.createDuplicate(); oHFC.setEvenHeader(this.evenHeader);
if ( this.firstHeader ) if ( this.firstFooter !== null)
oHFC.firstHeader = this.firstHeader.createDuplicate(); oHFC.setFirstFooter(this.firstFooter);
if ( this.oddFooter ) if ( this.firstHeader !== null)
oHFC.oddFooter = this.oddFooter.createDuplicate(); oHFC.setFirstHeader(this.firstHeader);
if ( this.oddHeader ) if ( this.oddFooter !== null)
oHFC.oddHeader = this.oddHeader.createDuplicate(); oHFC.setOddFooter(this.oddFooter);
if ( this.oddHeader !== null)
oHFC.setOddHeader(this.oddHeader);
return oHFC; return oHFC;
}, },
...@@ -9230,12 +9238,18 @@ CPageMarginsChart.prototype = ...@@ -9230,12 +9238,18 @@ CPageMarginsChart.prototype =
{ {
var oPMC = new CPageMarginsChart(); var oPMC = new CPageMarginsChart();
oPMC.b = this.b; if(this.b !== null)
oPMC.footer = this.footer; oPMC.setB(this.b);
oPMC.header = this.header; if(this.footer !== null)
oPMC.l = this.l; oPMC.setFooter(this.footer);
oPMC.r = this.r; if(this.header !== null)
oPMC.t = this.t; oPMC.setHeader(this.header);
if(this.l !== null)
oPMC.setL(this.l);
if(this.r !== null)
oPMC.setR(this.r);
if(this.t !== null)
oPMC.setT(this.t);
return oPMC; return oPMC;
}, },
...@@ -9454,22 +9468,32 @@ CPageSetup.prototype = ...@@ -9454,22 +9468,32 @@ CPageSetup.prototype =
{ {
var oPS = new CPageSetup(); var oPS = new CPageSetup();
oPS.blackAndWhite = this.blackAndWhite; if(this.blackAndWhite !== null)
oPS.copies = this.copies; oPS.setBlackAndWhite(this.blackAndWhite);
oPS.draft = this.draft; if(this.copies !== null)
oPS.firstPageNumber = this.firstPageNumber; oPS.setCopies(this.copies);
oPS.horizontalDpi = this.horizontalDpi; if(this.draft !== null)
oPS.orientation = this.orientation; oPS.setDraft(this.draft);
oPS.paperHeight = this.paperHeight; if(this.firstPageNumber !== null)
oPS.paperSize = this.paperSize; oPS.setFirstPageNumber(this.firstPageNumber);
oPS.paperWidth = this.paperWidth; if(this.horizontalDpi !== null)
oPS.useFirstPageNumb = this.useFirstPageNumb; oPS.setHorizontalDpi(this.horizontalDpi);
oPS.verticalDpi = this.verticalDpi; if(this.orientation !== null)
oPS.setOrientation(this.orientation);
if(this.paperHeight !== null)
oPS.setPaperHeight(this.paperHeight);
if(this.paperSize !== null)
oPS.setPaperSize(this.paperSize);
if(this.paperWidth !== null)
oPS.setPaperWidth(this.paperWidth);
if(this.useFirstPageNumb !== null)
oPS.setUseFirstPageNumb(this.useFirstPageNumb);
if(this.verticalDpi !== null)
oPS.setVerticalDpi(this.verticalDpi);
return oPS; return oPS;
}, },
Refresh_RecalcData: function() Refresh_RecalcData: function()
{}, {},
......
...@@ -5649,9 +5649,17 @@ function CLn() ...@@ -5649,9 +5649,17 @@ function CLn()
this.cap = null; this.cap = null;
this.cmpd = null; this.cmpd = null;
this.w = null; this.w = null;
}
CLn.prototype =
{
getObjectType: function()
{
return historyitem_type_Ln;
},
this.compare = function(line) compare: function(line)
{ {
if(line == null) if(line == null)
{ {
...@@ -5696,9 +5704,9 @@ function CLn() ...@@ -5696,9 +5704,9 @@ function CLn()
_ret.w = this.w; _ret.w = this.w;
} }
return _ret; return _ret;
}; },
this.merge = function(ln) merge: function(ln)
{ {
if(ln == null) if(ln == null)
{ {
...@@ -5748,16 +5756,17 @@ function CLn() ...@@ -5748,16 +5756,17 @@ function CLn()
{ {
this.w = ln.w; this.w = ln.w;
} }
}; },
this.calculate = function(theme, slide, layout, master, RGBA)
calculate: function(theme, slide, layout, master, RGBA)
{ {
if(isRealObject(this.Fill)) if(isRealObject(this.Fill))
{ {
this.Fill.calculate(theme, slide, layout, master, RGBA); this.Fill.calculate(theme, slide, layout, master, RGBA);
} }
}; },
this.createDuplicate = function() createDuplicate: function()
{ {
var duplicate = new CLn(); var duplicate = new CLn();
...@@ -5783,76 +5792,57 @@ function CLn() ...@@ -5783,76 +5792,57 @@ function CLn()
duplicate.cmpd = this.cmpd; duplicate.cmpd = this.cmpd;
duplicate.w = this.w; duplicate.w = this.w;
return duplicate; return duplicate;
} },
this.IsIdentical = function(ln) IsIdentical: function(ln)
{ {
return ln && (this.Fill == null ? ln.Fill == null : this.Fill.IsIdentical(ln.Fill) )&& this.Join == ln.Join return ln && (this.Fill == null ? ln.Fill == null : this.Fill.IsIdentical(ln.Fill) )&& this.Join == ln.Join
&& (this.headEnd == null ? ln.headEnd == null : this.headEnd.IsIdentical(ln.headEnd) ) && (this.headEnd == null ? ln.headEnd == null : this.headEnd.IsIdentical(ln.headEnd) )
&& (this.tailEnd == null ? ln.tailEnd == null : this.tailEnd.IsIdentical(ln.headEnd)) && && (this.tailEnd == null ? ln.tailEnd == null : this.tailEnd.IsIdentical(ln.headEnd)) &&
this.algn == ln.algn && this.cap == ln.cap && this.cmpd == ln.cmpd && this.w== ln.w; this.algn == ln.algn && this.cap == ln.cap && this.cmpd == ln.cmpd && this.w== ln.w;
}
}
CLn.prototype =
{
getObjectType: function()
{
return historyitem_type_Ln;
}, },
setFill: function(fill) setFill: function(fill)
{ {
// History.Add(this, {Type:historyitem_Ln_SetFill, oldFill: this.Fill, newFill: fill});
this.Fill = fill; this.Fill = fill;
}, },
setPrstDash: function(prstDash) setPrstDash: function(prstDash)
{ {
// History.Add(this, {Type:historyitem_Ln_SetPrstDash, oldPrstDash: this.prstDash, newPrstDash: prstDash});
this.prstDash = prstDash; this.prstDash = prstDash;
}, },
setJoin: function(join) setJoin: function(join)
{ {
// History.Add(this, {Type:historyitem_Ln_SetJoin, oldJoin: this.Join, newJoin: join});
this.Join = join; this.Join = join;
}, },
setHeadEnd: function(headEnd) setHeadEnd: function(headEnd)
{ {
// History.Add(this, {Type:historyitem_Ln_SetHeadEnd, oldHeadEnd: this.headEnd, newHeadEnd: headEnd});
this.headEnd = headEnd; this.headEnd = headEnd;
}, },
setTailEnd: function(tailEnd) setTailEnd: function(tailEnd)
{ {
// History.Add(this, {Type:historyitem_Ln_SetTailEnd, oldTailEnd: this.tailEnd, newTailEnd: tailEnd});
this.tailEnd = tailEnd; this.tailEnd = tailEnd;
}, },
setAlgn: function(algn) setAlgn: function(algn)
{ {
// History.Add(this, {Type:historyitem_Ln_SetAlgn, oldAlgn: this.algn, newAlgn: algn});
this.algn = algn; this.algn = algn;
}, },
setCap: function(cap) setCap: function(cap)
{ {
// History.Add(this, {Type:historyitem_Ln_SetCap, oldCap: this.cap, newCap: cap});
this.cap = cap; this.cap = cap;
}, },
setCmpd: function(cmpd) setCmpd: function(cmpd)
{ {
// History.Add(this, {Type:historyitem_Ln_SetCmpd, oldCmpd: this.cmpd, newCmpd: cmpd});
this.cmpd = cmpd; this.cmpd = cmpd;
}, },
setW: function(w) setW: function(w)
{ {
// History.Add(this, {Type:historyitem_Ln_SetW, oldW: this.w, newW: w});
this.w = w; this.w = w;
}, },
...@@ -5958,7 +5948,6 @@ CLn.prototype = ...@@ -5958,7 +5948,6 @@ CLn.prototype =
} }
}, },
Write_ToBinary: function(w) Write_ToBinary: function(w)
{ {
w.WriteBool(isRealObject(this.Fill)); w.WriteBool(isRealObject(this.Fill));
...@@ -6011,235 +6000,8 @@ CLn.prototype = ...@@ -6011,235 +6000,8 @@ CLn.prototype =
this.cap = readLong(r); this.cap = readLong(r);
this.cmpd = readLong(r); this.cmpd = readLong(r);
this.w = readLong(r); this.w = readLong(r);
},
Save_Changes: function(data, w)
{
w.WriteLong(this.getObjectType());
w.WriteLong(data.Type);
switch(data.Type)
{
case historyitem_Ln_SetFill:
{
w.WriteBool(isRealObject(data.newFill));
if(isRealObject(data.newFill))
{
data.newFill.Write_ToBinary(w);
}
break;
}
case historyitem_Ln_SetPrstDash:
{
w.WriteBool(isRealNumber(data.newPrstDash));
if(isRealNumber(data.newPrstDash))
{
w.WriteLong(data.newPrstDash);
}
break;
}
case historyitem_Ln_SetJoin:
{
w.WriteBool(isRealNumber(data.newJoin));
if(isRealNumber(data.newJoin))
{
w.WriteLong(data.newJoin);
}
break;
}
case historyitem_Ln_SetHeadEnd:
{
w.WriteBool(isRealObject(data.newHeadEnd));
if(isRealObject(data.newHeadEnd))
{
data.newHeadEnd.Write_ToBinary(w)
}
break;
}
case historyitem_Ln_SetTailEnd:
{
w.WriteBool(isRealObject(data.newTailEnd));
if(isRealObject(data.newTailEnd))
{
data.newTailEnd.Write_ToBinary(w)
}
break;
}
case historyitem_Ln_SetAlgn:
{
w.WriteBool(isRealNumber(data.newAlgn));
if(isRealNumber(data.newAlgn))
{
w.WriteLong(data.newAlgn);
}
break;
}
case historyitem_Ln_SetCap:
{
w.WriteBool(isRealNumber(data.newCap));
if(isRealNumber(data.newCap))
{
w.WriteLong(data.newCap);
}
break;
}
case historyitem_Ln_SetCmpd:
{
w.WriteBool(isRealNumber(data.newCmpd));
if(isRealNumber(data.newCmpd))
{
w.WriteLong(data.newCmpd);
}
break;
}
case historyitem_Ln_SetW:
{
w.WriteBool(isRealNumber(data.newW));
if(isRealNumber(data.newW))
{
w.WriteLong(data.newW);
}
}
}
},
Load_Changes: function(r)
{
if(this.getObjectType() !== r.GetLong())
return;
var type = r.GetLong();
switch(type)
{
case historyitem_Ln_SetFill:
{
if(r.GetBool())
{
this.Fill = new CUniFill();
this.Fill.Read_FromBinary(r);
}
else
{
this.Fill = null;
}
break;
}
case historyitem_Ln_SetPrstDash:
{
if(r.GetBool())
{
this.prstDash = r.GetLong();
}
else
{
this.prstDash = null;
}
break;
}
case historyitem_Ln_SetJoin:
{
if(r.GetBool())
{
this.Join = r.GetLong();
}
else
{
this.Join = null;
}
break;
}
case historyitem_Ln_SetHeadEnd:
{
if(r.GetBool())
{
this.headEnd = new EndArrow();
this.headEnd.Read_FromBinary(r);
}
else
{
this.headEnd = null;
}
break;
}
case historyitem_Ln_SetTailEnd:
{
if(r.GetBool())
{
this.tailEnd = new EndArrow();
this.tailEnd.Read_FromBinary(r);
}
else
{
this.tailEnd = null;
}
break;
}
case historyitem_Ln_SetAlgn:
{
if(r.GetBool())
{
this.algn = r.GetLong();
}
else
{
this.algn = null;
}
break;
}
case historyitem_Ln_SetCap:
{
if(r.GetBool())
{
this.cap = r.GetLong();
}
else
{
this.cap = null;
}
break;
}
case historyitem_Ln_SetCmpd:
{
if(r.GetBool())
{
this.cmpd = r.GetLong();
}
else
{
this.cmpd = null;
}
break;
}
case historyitem_Ln_SetW:
{
if(r.GetBool())
{
this.w = r.GetLong();
}
else
{
this.w = null;
}
break;
}
}
},
Get_Id: function()
{
return this.Id;
},
Refresh_RecalcData: function()
{},
Write_ToBinary2: function (w)
{
w.WriteLong(this.getObjectType());
w.WriteString2(this.Id);
},
Read_FromBinary2: function (r)
{
this.Id = r.GetString2();
} }
} };
// ----------------------------- // -----------------------------
...@@ -7721,10 +7483,6 @@ function CShapeStyle() ...@@ -7721,10 +7483,6 @@ function CShapeStyle()
this.effectRef = null;//new StyleRef(); this.effectRef = null;//new StyleRef();
this.fontRef = null;//new FontRef(); this.fontRef = null;//new FontRef();
this.Id = g_oIdCounter.Get_NewId(); this.Id = g_oIdCounter.Get_NewId();
g_oTableId.Add(this, this.Id); g_oTableId.Add(this, this.Id);
} }
...@@ -11377,12 +11135,6 @@ function NoteMaster() ...@@ -11377,12 +11135,6 @@ function NoteMaster()
this.Theme = null; this.Theme = null;
this.TableStyles = null; this.TableStyles = null;
this.Calculate = function()
{
// нужно пробежаться по всем шейпам:
// учесть тему во всех заливках
// учесть тему во всех текстовых настройках,
}
} }
NoteMaster.prototype = NoteMaster.prototype =
...@@ -11393,7 +11145,14 @@ NoteMaster.prototype = ...@@ -11393,7 +11145,14 @@ NoteMaster.prototype =
} , } ,
Refresh_RecalcData: function() Refresh_RecalcData: function()
{} {},
Calculate: function()
{
// нужно пробежаться по всем шейпам:
// учесть тему во всех заливках
// учесть тему во всех текстовых настройках,
}
}; };
// ---------------------------------- // ----------------------------------
...@@ -11407,15 +11166,6 @@ function NoteSlide() ...@@ -11407,15 +11166,6 @@ function NoteSlide()
this.showMasterPhAnim = false; this.showMasterPhAnim = false;
this.showMasterSp = false; this.showMasterSp = false;
// pointers
this.Calculate = function()
{
// нужно пробежаться по всем шейпам:
// учесть тему во всех заливках
// учесть тему во всех текстовых настройках,
}
} }
NoteSlide.prototype = NoteSlide.prototype =
...@@ -11426,7 +11176,15 @@ NoteSlide.prototype = ...@@ -11426,7 +11176,15 @@ NoteSlide.prototype =
}, },
Refresh_RecalcData: function() Refresh_RecalcData: function()
{} {},
// pointers
Calculate: function()
{
// нужно пробежаться по всем шейпам:
// учесть тему во всех заливках
// учесть тему во всех текстовых настройках,
}
}; };
// ---------------------------------- // ----------------------------------
...@@ -12403,88 +12161,8 @@ function CTextParagraphPr() ...@@ -12403,88 +12161,8 @@ function CTextParagraphPr()
this.lvl = null; this.lvl = null;
this.pPr = new CParaPr(); this.pPr = new CParaPr();
this.rPr = new CTextPr(); this.rPr = new CTextPr();
this.createDuplicate = function()
{
var duplicate = new CTextParagraphPr();
duplicate.bullet = this.bullet.createDuplicate();
duplicate.lvl = this.lvl;
duplicate.pPr = clone(this.pPr);
duplicate.rPr = clone(this.rPr);
return duplicate;
};
this.Write_ToBinary2 =function(w)
{
w.WriteBool(isRealObject(this.bullet));
if(isRealObject(this.bullet))
{
this.bullet.Write_ToBinary2(w);
}
w.WriteBool(isRealNumber(this.lvl));
if(isRealNumber(this.lvl))
{
w.WriteLong(this.lvl);
}
w.WriteBool(isRealObject(this.pPr));
if(isRealObject(this.pPr))
{
this.pPr.Write_ToBinary(w);
}
w.WriteBool(isRealObject(this.rPr));
if(isRealObject(this.rPr))
{
this.rPr.Write_ToBinary(w);
}
};
this.Read_FromBinary2 = function(r)
{
if(r.GetBool())
{
this.bullet = new CBullet();
this.bullet.Read_FromBinary2(r);
}
else
{
this.bullet = new CBullet();
}
if(r.GetBool())
{
this.lvl = r.GetLong();
}
else
{
this.lvl = null;
}
this.pPr = new CParaPr();
if(r.GetBool())
{
this.pPr.Read_FromBinary(r);
}
this.rPr = new CTextPr();
if(r.GetBool())
{
this.rPr.Read_FromBinary(r);
}
};
} }
CTextParagraphPr.prototype =
{
Get_Id: function()
{
return this.Id;
},
Refresh_RecalcData: function()
{}
};
function CompareBullets(bullet1, bullet2) function CompareBullets(bullet1, bullet2)
{ {
......
...@@ -6384,8 +6384,6 @@ function BinaryPPTYLoader() ...@@ -6384,8 +6384,6 @@ function BinaryPPTYLoader()
{ {
var para_pr = new CParaPr(); var para_pr = new CParaPr();
var tPr = new CTextParagraphPr();
var s = this.stream; var s = this.stream;
var _end_rec = s.cur + s.GetULong() + 4; var _end_rec = s.cur + s.GetULong() + 4;
......
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