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

Bug 25261 - [CoEdit] Ошибка в консоли при клике юзером в изменный заголовок скопированной диаграммы

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@57175 954022d7-b5bf-4e40-9824-e11837661b57
parent 2d7f830a
...@@ -10199,6 +10199,8 @@ function CChartText() ...@@ -10199,6 +10199,8 @@ function CChartText()
this.strRef = null; this.strRef = null;
this.chart = null; this.chart = null;
this.parent = null;
this.Id = g_oIdCounter.Get_NewId(); this.Id = g_oIdCounter.Get_NewId();
g_oTableId.Add(this, this.Id); g_oTableId.Add(this, this.Id);
} }
...@@ -10217,12 +10219,14 @@ CChartText.prototype = ...@@ -10217,12 +10219,14 @@ CChartText.prototype =
{ {
var c = new CChartText(); var c = new CChartText();
if(this.rich) if(this.rich)
{
c.setRich(this.rich.createDuplicate()); c.setRich(this.rich.createDuplicate());
c.rich.setParent(c);
}
if(this.strRef) if(this.strRef)
{ {
c.setStrRef(this.strRef.createDuplicate()); c.setStrRef(this.strRef.createDuplicate());
} }
//Todo: разобраться с ссылками на chart
return c; return c;
}, },
...@@ -10237,6 +10241,18 @@ CChartText.prototype = ...@@ -10237,6 +10241,18 @@ CChartText.prototype =
this.chart = pr; this.chart = pr;
}, },
getDrawingDocument: function()
{
return this.parent && this.parent.getDrawingDocument && this.parent.getDrawingDocument();
},
setParent: function(pr)
{
History.Add(this, {Type: historyitem_CommonChartFormat_SetParent, oldPr: this.parent, newPr: pr});
this.parent = pr;
},
merge: function(tx, noCopyTextBody) merge: function(tx, noCopyTextBody)
{ {
if(tx.rich) if(tx.rich)
...@@ -10289,6 +10305,11 @@ CChartText.prototype = ...@@ -10289,6 +10305,11 @@ CChartText.prototype =
{ {
switch (data.Type) switch (data.Type)
{ {
case historyitem_CommonChartFormat_SetParent:
{
this.parent = data.oldPr;
break;
}
case historyitem_ChartFormatSetChart: case historyitem_ChartFormatSetChart:
{ {
this.chart = data.oldPr; this.chart = data.oldPr;
...@@ -10312,6 +10333,11 @@ CChartText.prototype = ...@@ -10312,6 +10333,11 @@ CChartText.prototype =
{ {
switch (data.Type) switch (data.Type)
{ {
case historyitem_CommonChartFormat_SetParent:
{
this.parent = data.newPr;
break;
}
case historyitem_ChartFormatSetChart: case historyitem_ChartFormatSetChart:
{ {
this.chart = data.newPr; this.chart = data.newPr;
...@@ -10339,6 +10365,7 @@ CChartText.prototype = ...@@ -10339,6 +10365,7 @@ CChartText.prototype =
case historyitem_ChartText_SetRich: case historyitem_ChartText_SetRich:
case historyitem_ChartText_SetStrRef: case historyitem_ChartText_SetStrRef:
case historyitem_ChartFormatSetChart: case historyitem_ChartFormatSetChart:
case historyitem_CommonChartFormat_SetParent:
{ {
writeObject(w, data.newPr); writeObject(w, data.newPr);
break; break;
...@@ -10351,6 +10378,11 @@ CChartText.prototype = ...@@ -10351,6 +10378,11 @@ CChartText.prototype =
var type = r.GetLong(); var type = r.GetLong();
switch (type) switch (type)
{ {
case historyitem_CommonChartFormat_SetParent:
{
this.parent = readObject(r);
break;
}
case historyitem_ChartText_SetRich: case historyitem_ChartText_SetRich:
{ {
this.rich = readObject(r); this.rich = readObject(r);
...@@ -21944,6 +21976,10 @@ CTitle.prototype = ...@@ -21944,6 +21976,10 @@ CTitle.prototype =
{ {
History.Add(this, {Type: historyitem_Title_SetTx, oldPr: this.tx, newPr: pr}); History.Add(this, {Type: historyitem_Title_SetTx, oldPr: this.tx, newPr: pr});
this.tx = pr; this.tx = pr;
if(this.tx)
{
this.tx.setParent(this);
}
}, },
setTxPr: function(pr) setTxPr: function(pr)
{ {
......
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