Commit e1fed39c 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@51180 954022d7-b5bf-4e40-9824-e11837661b57
parent 7f4a192a
......@@ -747,7 +747,7 @@ CTextBody.prototype =
var par = dc.Content[i];
for(var i = 0; i < par.Content.length; ++i)
{
if(par.Content[i].Copy)
if(!(par.Content[i] instanceof ParaEnd || par.Content[i] instanceof ParaEmpty) && par.Content[i].Copy)
this.content.Paragraph_Add(par.Content[i].Copy());
}
}
......
......@@ -1081,6 +1081,9 @@ CChartAsGroup.prototype =
default_legend_style.TextPr.Set_FromObject(TextPr);
default_legend_style.ParaPr.Spacing.After = 0;
default_legend_style.ParaPr.Spacing.Before = 0;
default_legend_style.ParaPr.Spacing.LineRule = linerule_AtLeast;
default_legend_style.ParaPr.Spacing.Line = 1;
default_legend_style.ParaPr.Jc = align_Center;
//TODO:ParaPr: default_legend_style.ParaPr.Ind
......@@ -1118,6 +1121,9 @@ CChartAsGroup.prototype =
default_legend_style.ParaPr.Spacing.Before = 0;
default_legend_style.ParaPr.Jc = align_Center;
default_legend_style.ParaPr.Spacing.LineRule = linerule_AtLeast;
default_legend_style.ParaPr.Spacing.Line = 1;
//TODO:ParaPr: default_legend_style.ParaPr.Ind
var tx_pr;
if(isRealObject(this.chartTitle.txBody.txPr))
......@@ -1177,6 +1183,9 @@ CChartAsGroup.prototype =
default_legend_style.TextPr.Set_FromObject(TextPr);
default_legend_style.ParaPr.Spacing.After = 0;
default_legend_style.ParaPr.Spacing.Before = 0;
default_legend_style.ParaPr.Spacing.LineRule = linerule_AtLeast;
default_legend_style.ParaPr.Spacing.Line = 1;
default_legend_style.ParaPr.Jc = align_Center;
//TODO:ParaPr: default_legend_style.ParaPr.Ind
......@@ -1216,6 +1225,8 @@ CChartAsGroup.prototype =
default_legend_style.TextPr.Set_FromObject(TextPr);
default_legend_style.ParaPr.Spacing.After = 0;
default_legend_style.ParaPr.Spacing.Before = 0;
default_legend_style.ParaPr.Spacing.LineRule = linerule_AtLeast;
default_legend_style.ParaPr.Spacing.Line = 1;
default_legend_style.ParaPr.Jc = align_Center;
//TODO:ParaPr: default_legend_style.ParaPr.Ind
......@@ -1277,6 +1288,8 @@ CChartAsGroup.prototype =
default_legend_style.TextPr.Set_FromObject(TextPr);
default_legend_style.ParaPr.Spacing.After = 0;
default_legend_style.ParaPr.Spacing.Before = 0;
default_legend_style.ParaPr.Spacing.LineRule = linerule_AtLeast;
default_legend_style.ParaPr.Spacing.Line = 1;
default_legend_style.ParaPr.Jc = align_Center;
//TODO:ParaPr: default_legend_style.ParaPr.Ind
......@@ -1317,6 +1330,8 @@ CChartAsGroup.prototype =
default_legend_style.TextPr.Set_FromObject(TextPr);
default_legend_style.ParaPr.Spacing.After = 0;
default_legend_style.ParaPr.Spacing.Before = 0;
default_legend_style.ParaPr.Spacing.LineRule = linerule_AtLeast;
default_legend_style.ParaPr.Spacing.Line = 1;
default_legend_style.ParaPr.Jc = align_Center;
//TODO:ParaPr: default_legend_style.ParaPr.Ind
......
......@@ -72,7 +72,6 @@ CChartLegend.prototype =
//TODO
}
styles.Style[styles.Id] = default_legend_style;
++styles.Id;
return styles;
},
......@@ -250,19 +249,16 @@ CLegendEntryGroup.prototype =
//default_style.ParaPr TODO
styles.Style[styles.Id] = default_style;
++styles.Id;
var legend_style = new CStyle("legend_style", styles.Id-1, null, styletype_Paragraph);
/*TODO*/
styles.Style[styles.Id] = legend_style;
++styles.Id;
var entry_style = new CStyle("entry_style", styles.Id - 1, null, styletype_Paragraph);
if(isRealObject(this.legendGroup.legendEntries[this.idx]) && isRealObject(this.legendGroup.legendEntries[this.idx].txPr))
{
//TODO
}
styles.Style[styles.Id] = entry_style;
++styles.Id;
return styles;
},
......
......@@ -147,6 +147,8 @@ CChartTitle.prototype =
default_legend_style.ParaPr.Spacing.After = 0;
default_legend_style.ParaPr.Spacing.Before = 0;
default_legend_style.ParaPr.Spacing.LineRule = linerule_AtLeast;
default_legend_style.ParaPr.Spacing.Line = 1;
default_legend_style.ParaPr.Jc = align_Center;
......@@ -158,7 +160,6 @@ CChartTitle.prototype =
//TODO
}
styles.Style[styles.Id] = default_legend_style;
++styles.Id;
return styles;
},
......@@ -233,8 +234,11 @@ CChartTitle.prototype =
this.txBody = new CTextBody(this);
this.txBody.paragraphAdd(paraItem);
var old_cx = this.x + this.extX*0.5;
var old_cy = this.y + this.extY*0.5;
//var old_cx = this.x + this.extX*0.5;
//var old_cy = this.y + this.extY*0.5;
this.recalculatePosExt();
this.txBody.recalculateCurPos();
return;
switch (this.type)
{
case CHART_TITLE_TYPE_TITLE:
......@@ -294,71 +298,70 @@ CChartTitle.prototype =
this.calculateTransformTextMatrix();
return;
var title = this;
var tx_body = title.txBody;
var body_pr = tx_body.bodyPr;
/* body_pr.rIns = 0.3;
body_pr.lIns = 0.3;
body_pr.tIns = 0.3;
body_pr.bIns = 0; */
/* var paragraphs = tx_body.content.Content;
tx_body.content.DrawingDocument = this.drawingObjects.drawingDocument;
for(var i = 0; i < paragraphs.length; ++i)
{
paragraphs[i].DrawingDocument = this.drawingObjects.drawingDocument;
paragraphs[i].Pr.Jc = align_Center;
paragraphs[i].Pr.Spacing.After = 0;
paragraphs[i].Pr.Spacing.Before = 0;
}
paragraphs[0].Pr.Spacing.Before = 0.75; */
},
var title_height, title_width;
// if(!(isRealObject(title.layout) && title.layout.isManual))
recalculatePosExt: function()
{
var old_cx = this.x + this.extX*0.5;
var old_cy = this.y + this.extY*0.5;
switch (this.type)
{
var max_content_width = this.chartGroup.absExtX*0.8 - (body_pr.rIns + body_pr.lIns);
tx_body.content.Reset(0, 0, max_content_width, 20000);
tx_body.content.Recalculate_Page(0, true);
var result_width;
if(!(tx_body.content.Content.length > 1 || tx_body.content.Content[0].Lines.length > 1))
case CHART_TITLE_TYPE_TITLE:
case CHART_TITLE_TYPE_H_AXIS:
{
if(tx_body.content.Content[0].Lines[0].Ranges[0].W < max_content_width)
{
tx_body.content.Reset(0, 0, tx_body.content.Content[0].Lines[0].Ranges[0].W, 20000);
tx_body.content.Recalculate_Page(0, true);
}
result_width = tx_body.content.Content[0].Lines[0].Ranges[0].W + body_pr.rIns + body_pr.lIns;
var max_title_width = this.chartGroup.absExtX*0.8;
var title_width = this.txBody.getRectWidth(max_title_width);
this.extX = title_width;
this.extY = this.txBody.getRectHeight(this.chartGroup.absExtY, title_width);
this.x = old_cx - this.extX*0.5;
if(this.x + this.extX > this.chartGroup.absExtX)
this.x = this.chartGroup.absExtX - this.extX;
if(this.x < 0)
this.x = 0;
this.y = old_cy - this.extY*0.5;
if(this.y + this.extY > this.chartGroup.absExtY)
this.y = this.chartGroup.absExtY - this.extY;
if(this.y < 0)
this.y = 0;
if(isRealObject(this.layout) && isRealNumber(this.layout.x))
this.layout.setX(this.x/this.chartGroup.absExtX);
break;
}
else
case CHART_TITLE_TYPE_V_AXIS:
{
var width = 0;
for(var i = 0; i < tx_body.content.Content.length; ++i)
{
var par = tx_body.content.Content[i];
for(var j = 0; j < par.Lines.length; ++j)
{
if(par.Lines[j].Ranges[0].W > width)
width = par.Lines[j].Ranges[0].W;
}
}
result_width = width + body_pr.rIns + body_pr.lIns;
}
this.extX = result_width;
this.extY = tx_body.content.Get_SummaryHeight();
this.x = (this.chartGroup.absExtX - this.extX)*0.5;
this.y = editor.WordControl.m_oLogicDocument.DrawingDocument.GetMMPerDot(7);
this.transform.Reset();
global_MatrixTransformer.TranslateAppend(this.transform, this.x, this.y);
global_MatrixTransformer.MultiplyAppend(this.transform, this.chartGroup.transform);
var max_title_height = this.chartGroup.absExtY*0.8;
this.invertTransform = global_MatrixTransformer.Invert(this.transform);
this.calculateTransformTextMatrix();
var body_pr = this.txBody.getBodyPr();
this.extY = this.txBody.getRectWidth(max_title_height) - body_pr.rIns - body_pr.lIns + body_pr.tIns + body_pr.bIns;
this.extX = this.txBody.getRectHeight(this.chartGroup.absExtX, this.extY) - (- body_pr.rIns - body_pr.lIns + body_pr.tIns + body_pr.bIns);
this.spPr.geometry.Recalculate(this.extX, this.extY);
title_width = this.extX;
title_height = this.y + this.extY;
this.x = old_cx - this.extX*0.5;
if(this.x + this.extX > this.chartGroup.absExtX)
this.x = this.chartGroup.absExtX - this.extX;
if(this.x < 0)
this.x = 0;
this.y = old_cy - this.extY*0.5;
if(this.y + this.extY > this.chartGroup.absExtY)
this.y = this.chartGroup.absExtY - this.extY;
if(this.y < 0)
this.y = 0;
if(isRealObject(this.layout) && isRealNumber(this.layout.y))
this.layout.setY(this.y/this.chartGroup.absExtY);
break;
}
}
this.spPr.geometry.Recalculate(this.extX, this.extY);
this.recalculateTransform();
this.calculateTransformTextMatrix();
this.calculateContent();
},
updateSelectionState: function(drawingDocument)
......
......@@ -114,6 +114,9 @@ CTextBody.prototype =
default_legend_style.TextPr.Set_FromObject(TextPr);
default_legend_style.ParaPr.Spacing.After = 0;
default_legend_style.ParaPr.Spacing.Before = 0;
default_legend_style.ParaPr.Spacing.LineRule = linerule_AtLeast;
default_legend_style.ParaPr.Spacing.Line = 1;
default_legend_style.ParaPr.Jc = align_Center;
//TODO:ParaPr: default_legend_style.ParaPr.Ind
......@@ -123,7 +126,6 @@ CTextBody.prototype =
//TODO
}
styles.Style[default_legend_style.Id] = default_legend_style;
++styles.Id;
this.content.Styles = styles;
this.content.Content[0].Style_Add_Open(default_legend_style.Id);
if(is_on)
......@@ -579,6 +581,8 @@ CTextBody.prototype =
default_legend_style.ParaPr.Spacing.After = 0;
default_legend_style.ParaPr.Spacing.Before = 0;
default_legend_style.ParaPr.Spacing.LineRule = linerule_AtLeast;
default_legend_style.ParaPr.Spacing.Line = 1;
default_legend_style.ParaPr.Jc = align_Center;
//TODO:ParaPr: default_legend_style.ParaPr.Ind
......@@ -588,7 +592,6 @@ CTextBody.prototype =
//TODO
}
styles.Style[styles.Id] = default_legend_style;
++styles.Id;
this.content.Styles = styles;
if(is_on)
{
......@@ -638,6 +641,8 @@ CTextBody.prototype =
default_legend_style.ParaPr.Spacing.After = 0;
default_legend_style.ParaPr.Spacing.Before = 0;
default_legend_style.ParaPr.Spacing.LineRule = linerule_AtLeast;
default_legend_style.ParaPr.Spacing.Line = 1;
default_legend_style.ParaPr.Jc = align_Center;
//TODO:ParaPr: default_legend_style.ParaPr.Ind
......@@ -647,7 +652,6 @@ CTextBody.prototype =
//TODO
}
styles.Style[styles.Id] = default_legend_style;
++styles.Id;
this.content.Styles = styles;
if(is_on)
{
......@@ -743,6 +747,8 @@ CTextBody.prototype =
default_legend_style.ParaPr.Spacing.After = 0;
default_legend_style.ParaPr.Spacing.Before = 0;
default_legend_style.ParaPr.Spacing.LineRule = linerule_AtLeast;
default_legend_style.ParaPr.Spacing.Line = 1;
default_legend_style.ParaPr.Jc = align_Center;
//TODO:ParaPr: default_legend_style.ParaPr.Ind
......@@ -752,7 +758,6 @@ CTextBody.prototype =
//TODO
}
styles.Style[styles.Id] = default_legend_style;
++styles.Id;
this.content.Styles = styles;
if(is_on)
{
......@@ -828,7 +833,7 @@ CTextBody.prototype =
var par = dc.Content[i];
for(var i = 0; i < par.Content.length; ++i)
{
if(par.Content[i].Copy)
if(!(par.Content[i] instanceof ParaEnd || par.Content[i] instanceof ParaEmpty) && par.Content[i].Copy)
this.content.Paragraph_Add(par.Content[i].Copy());
}
}
......
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