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

правка бага со сбрасыванием второго цвета в градиентной заливке

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@51310 954022d7-b5bf-4e40-9824-e11837661b57
parent c531d119
...@@ -2315,6 +2315,7 @@ function CorrectUniFillEx(asc_fill, unifill) { ...@@ -2315,6 +2315,7 @@ function CorrectUniFillEx(asc_fill, unifill) {
{ {
for (var i = 0; i < _colors.length; i++) for (var i = 0; i < _colors.length; i++)
{ {
if(!(_colors[i].value == null && _colors[i].type ===c_oAscColor.COLOR_TYPE_SCHEME))
ret.fill.colors[i].setColor(CorrectUniColorEx(_colors[i], ret.fill.colors[i].color)); ret.fill.colors[i].setColor(CorrectUniColorEx(_colors[i], ret.fill.colors[i].color));
} }
} }
......
...@@ -1264,5 +1264,11 @@ CChartTitle.prototype = ...@@ -1264,5 +1264,11 @@ CChartTitle.prototype =
this.txBody.readFromBinary(r); this.txBody.readFromBinary(r);
} }
},
OnContentRecalculate: function()
{
if(this.chartGroup)
this.chartGroup.recalculate();
} }
}; };
...@@ -165,8 +165,8 @@ Paragraph.prototype = ...@@ -165,8 +165,8 @@ Paragraph.prototype =
setTextPr: function(textPr) setTextPr: function(textPr)
{ {
var oldValue = isRealObject(this.TextPr) ? this.TextPr.Get_Id() : null; var oldValue = isRealObject(this.TextPr) ? this.TextPr.getValue() : null;
var newValue = isRealObject(textPr) ? textPr.Get_Id(): null; var newValue = isRealObject(textPr) ? textPr.getValue(): null;
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_SetTextPr, null, null, History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_SetTextPr, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(oldValue, newValue))); new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(oldValue, newValue)));
this.TextPr = textPr; this.TextPr = textPr;
...@@ -9926,7 +9926,18 @@ Paragraph.prototype = ...@@ -9926,7 +9926,18 @@ Paragraph.prototype =
case historyitem_AutoShapes_SetTextPr: case historyitem_AutoShapes_SetTextPr:
{ {
this.TextPr = g_oTableId.Get_ById(Data.oldValue); if(typeof Data.oldValue === "string")
{
var value = Data.oldValue;
var r = CreateBinaryReader(value, 0, value.length);
var text_pr = new CTextPr();
text_pr.Read_FromBinary(r);
this.TextPr = new ParaTextPr(text_pr);
}
else
{
this.TextPr = null;
}
break; break;
} }
case historyitem_Paragraph_AddItem: case historyitem_Paragraph_AddItem:
...@@ -10341,7 +10352,18 @@ Paragraph.prototype = ...@@ -10341,7 +10352,18 @@ Paragraph.prototype =
} }
case historyitem_AutoShapes_SetTextPr: case historyitem_AutoShapes_SetTextPr:
{ {
this.TextPr = g_oTableId.Get_ById(Data.newValue); if(typeof Data.newValue === "string")
{
var value = Data.newValue;
var r = CreateBinaryReader(value, 0, value.length);
var text_pr = new CTextPr();
text_pr.Read_FromBinary(r);
this.TextPr = new ParaTextPr(text_pr);
}
else
{
this.TextPr = null;
}
break; break;
} }
case historyitem_Paragraph_AddItem: case historyitem_Paragraph_AddItem:
......
...@@ -88,7 +88,13 @@ function CreateParaItem(type, value) ...@@ -88,7 +88,13 @@ function CreateParaItem(type, value)
case para_Empty : return new ParaEmpty(value); break; case para_Empty : return new ParaEmpty(value); break;
case para_Text : return new ParaText(value); break; case para_Text : return new ParaText(value); break;
case para_Space : return new ParaSpace(value); break; case para_Space : return new ParaSpace(value); break;
case para_TextPr : return g_oTableId.Get_ById(value); break; case para_TextPr :
{
var r = CreateBinaryReader(value, 0, value.length);
var text_pr = new CTextPr();
text_pr.Read_FromBinary(r);
return new ParaTextPr(text_pr);
}
case para_End : return new ParaEnd(); break; case para_End : return new ParaEnd(); break;
case para_NewLine : return new ParaNewLine(value); break; case para_NewLine : return new ParaNewLine(value); break;
case para_NewLineRendered : return new ParaNewLineRendered(); break; case para_NewLineRendered : return new ParaNewLineRendered(); break;
...@@ -284,7 +290,6 @@ function ParaSpace(Count) ...@@ -284,7 +290,6 @@ function ParaSpace(Count)
this.Width = 0; this.Width = 0;
this.Height = 0; this.Height = 0;
this.WidthVisible = 0; this.WidthVisible = 0;
this.Id
} }
ParaSpace.prototype = ParaSpace.prototype =
{ {
...@@ -434,7 +439,7 @@ function ParaTextPr(Props) ...@@ -434,7 +439,7 @@ function ParaTextPr(Props)
// Добавляем данный класс в таблицу Id (обязательно в конце конструктора) // Добавляем данный класс в таблицу Id (обязательно в конце конструктора)
g_oTableId.Add( this, this.Id ); // g_oTableId.Add( this, this.Id );
if(isRealObject(Props)) if(isRealObject(Props))
{ {
this.Set_Value(Props); this.Set_Value(Props);
...@@ -449,17 +454,19 @@ ParaTextPr.prototype = ...@@ -449,17 +454,19 @@ ParaTextPr.prototype =
setParent: function(parent) setParent: function(parent)
{ {
var oldValue = isRealObject(this.Parent) ? this.Parent.Get_Id() : null; //var oldValue = isRealObject(this.Parent) ? this.Parent.Get_Id() : null;
var newValue = isRealObject(parent) ? parent.Get_Id(): null; //var newValue = isRealObject(parent) ? parent.Get_Id(): null;
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_AddParent, null, null, //History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_AddParent, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(oldValue, newValue))); // new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(oldValue, newValue)));
this.Parent = parent; this.Parent = parent;
}, },
getValue: function() getValue: function()
{ {
return this.Get_Id(); var w = new CMemory();
this.Value.Write_ToBinary(w);
return w.pos + ";" + w.GetBase64Memory();
}, },
Draw : function()//(X,Y,Context) Draw : function()//(X,Y,Context)
{ {
......
...@@ -878,11 +878,6 @@ CTextBody.prototype = ...@@ -878,11 +878,6 @@ CTextBody.prototype =
var r_ins = body_pr.rIns; var r_ins = body_pr.rIns;
var l_ins = body_pr.lIns; var l_ins = body_pr.lIns;
var max_content_width = maxWidth - r_ins - l_ins; var max_content_width = maxWidth - r_ins - l_ins;
for(var i = 0; i < this.content.Content.length; ++i)
{
var par = this.content.Content[i];
par.RecalcInfo.Recalc_0_Type = pararecalc_0_All;
}
this.content.Reset(0, 0, max_content_width, 20000); this.content.Reset(0, 0, max_content_width, 20000);
this.content.Recalculate_Page(0, true); this.content.Recalculate_Page(0, true);
...@@ -903,11 +898,6 @@ CTextBody.prototype = ...@@ -903,11 +898,6 @@ CTextBody.prototype =
getRectHeight: function(maxHeight, width) getRectHeight: function(maxHeight, width)
{ {
for(var i = 0; i < this.content.Content.length; ++i)
{
var par = this.content.Content[i];
par.RecalcInfo.Recalc_0_Type = pararecalc_0_All;
}
this.content.Reset(0, 0, width, 20000); this.content.Reset(0, 0, width, 20000);
this.content.Recalculate_Page(0, true); this.content.Recalculate_Page(0, true);
var content_height = this.getSummaryHeight(); var content_height = this.getSummaryHeight();
...@@ -946,6 +936,12 @@ CTextBody.prototype = ...@@ -946,6 +936,12 @@ CTextBody.prototype =
this.bodyPr.vert = data.oldValue; this.bodyPr.vert = data.oldValue;
break; break;
} }
case historyitem_AutoShapes_OnContentRecalculateUndo:
{
if(this.shape && this.shape.OnContentRecalculate)
this.shape.OnContentRecalculate();
break;
}
} }
}, },
...@@ -975,6 +971,12 @@ CTextBody.prototype = ...@@ -975,6 +971,12 @@ CTextBody.prototype =
this.bodyPr.vert = data.newValue; this.bodyPr.vert = data.newValue;
break; break;
} }
case historyitem_AutoShapes_OnContentRecalculateRedo:
{
if(this.shape && this.shape.OnContentRecalculate)
this.shape.OnContentRecalculate();
break;
}
} }
}, },
...@@ -984,11 +986,10 @@ CTextBody.prototype = ...@@ -984,11 +986,10 @@ CTextBody.prototype =
var old_styles = this.content.Styles; var old_styles = this.content.Styles;
g_oTableId.m_bTurnOff = true; g_oTableId.m_bTurnOff = true;
this.content.Styles = new CStyles(); this.content.Styles = new CStyles();
this.content.Styles = new CStyles(); g_oTableId.m_bTurnOff = false;
var copy_processor = new CopyProcessor(this.content); var copy_processor = new CopyProcessor(this.content);
ret = copy_processor.Start(); ret = copy_processor.Start();
this.content.Styles = old_styles; this.content.Styles = old_styles;
g_oTableId.m_bTurnOff = false;
return ret; return ret;
}, },
...@@ -1013,9 +1014,16 @@ CTextBody.prototype = ...@@ -1013,9 +1014,16 @@ CTextBody.prototype =
{ {
if(this.curState.textObject && this.curState.textObject.txBody) if(this.curState.textObject && this.curState.textObject.txBody)
{ {
History.Create_NewPoint();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_OnContentRecalculateUndo, null, null,
new UndoRedoDataGraphicObjects(this.curState.textObject.txBody.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
var paste_processor = new PasteProcessor(this.curState.textObject.txBody.content); var paste_processor = new PasteProcessor(this.curState.textObject.txBody.content);
paste_processor.Start(node); paste_processor.Start(node);
this.curState.textObject.txBody.OnContentRecalculate(); this.curState.textObject.txBody.OnContentRecalculate();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_OnContentRecalculateRedo, null, null,
new UndoRedoDataGraphicObjects(this.curState.textObject.txBody.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
this.drawingObjects.showDrawingObjects(true); this.drawingObjects.showDrawingObjects(true);
} }
}, },
...@@ -2375,10 +2383,11 @@ PasteProcessor.prototype = ...@@ -2375,10 +2383,11 @@ PasteProcessor.prototype =
//�� ����� ���������� �������� ��� ������� ��������� ������� //�� ����� ���������� �������� ��� ������� ��������� �������
var arrShapes = [], arrImages = [], arrTables = []; var arrShapes = [], arrImages = [], arrTables = [];
History.TurnOff(); History.TurnOff();
g_oTableId.m_bTurnOff = true; // g_oTableId.m_bTurnOff = true;
var shape = new CShape(null); var shape = new CShape(null);
shape.drawingObjects = content.Parent.shape.drawingObjects; shape.drawingObjects = content.Parent.shape.drawingObjects;
shape.setTextBody(new CTextBody(shape)); shape.setTextBody(new CTextBody(shape));
// g_oTableId.m_bTurnOff = false;
arrShapes.push(shape); arrShapes.push(shape);
var ret = oThis._ExecutePresentation(node, {}, true, true, false, arrShapes, arrImages, arrTables); var ret = oThis._ExecutePresentation(node, {}, true, true, false, arrShapes, arrImages, arrTables);
...@@ -2390,7 +2399,6 @@ PasteProcessor.prototype = ...@@ -2390,7 +2399,6 @@ PasteProcessor.prototype =
shape.txBody.content.Internal_Content_Remove(0, 1); shape.txBody.content.Internal_Content_Remove(0, 1);
} }
} }
g_oTableId.m_bTurnOff = false;
History.TurnOn(); History.TurnOn();
oThis.insertInPlace2(content, arrShapes[0].txBody.content.Content); oThis.insertInPlace2(content, arrShapes[0].txBody.content.Content);
node.blur(); node.blur();
......
...@@ -193,6 +193,9 @@ var historyitem_AutoShapes_SetChartTitleLayout = 81; ...@@ -193,6 +193,9 @@ var historyitem_AutoShapes_SetChartTitleLayout = 81;
var historyitem_AutoShapes_SetChartOverlay = 82; var historyitem_AutoShapes_SetChartOverlay = 82;
var historyitem_AutoShapes_InitChart = 83; var historyitem_AutoShapes_InitChart = 83;
var historyitem_AutoShapes_SetChartTitleType = 84; var historyitem_AutoShapes_SetChartTitleType = 84;
var historyitem_AutoShapes_OnContentRecalculateUndo = 85;
var historyitem_AutoShapes_OnContentRecalculateRedo = 86;
......
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