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

правка багов 21654 - [Charts] Не применяются стилевые настройки для текста в...

правка багов 21654 - [Charts] Не применяются стилевые настройки для текста в chart title и подписях осей; 20579	- К имени диаграммы или подписям осей невозможно применить свойства текста

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@51063 954022d7-b5bf-4e40-9824-e11837661b57
parent cc41fee5
......@@ -318,6 +318,38 @@ DrawingObjectsController.prototype =
return new CParaPr();
}
case STATES_ID_CHART:
case STATES_ID_PRE_MOVE_INTERNAL_CHART_OBJECT:
{
var chart = this.curState.chart;
var selected_title;
if(chart.chartTitle && chart.chartTitle.selected)
{
selected_title = chart.chartTitle;
}
else if(chart.hAxisTitle && chart.hAxisTitle.selected)
{
selected_title = chart.hAxisTitle;
}
else if(chart.vAxisTitle && chart.vAxisTitle.selected)
{
selected_title = chart.vAxisTitle;
}
if(selected_title)
{
return selected_title.getAllParagraphParaPr();
}
else
{
return null;
}
break;
}
case STATES_ID_CHART_TEXT_ADD:
{
return this.curState.textObject.getParagraphParaPr();
break;
}
default:
{
var result = null;
......@@ -369,6 +401,38 @@ DrawingObjectsController.prototype =
//return new CTextPr();
return null;
}
case STATES_ID_CHART:
case STATES_ID_PRE_MOVE_INTERNAL_CHART_OBJECT:
{
var chart = this.curState.chart;
var selected_title;
if(chart.chartTitle && chart.chartTitle.selected)
{
selected_title = chart.chartTitle;
}
else if(chart.hAxisTitle && chart.hAxisTitle.selected)
{
selected_title = chart.hAxisTitle;
}
else if(chart.vAxisTitle && chart.vAxisTitle.selected)
{
selected_title = chart.vAxisTitle;
}
if(selected_title)
{
return selected_title.getAllParagraphTextPr();
}
else
{
return null;
}
break;
}
case STATES_ID_CHART_TEXT_ADD:
{
return this.curState.textObject.getParagraphTextPr();
break;
}
default:
{
var result = null;
......@@ -820,6 +884,34 @@ DrawingObjectsController.prototype =
}
break;
}
case STATES_ID_CHART_TEXT_ADD:
{
state.id = STATES_ID_CHART_TEXT_ADD;
state.chart = this.curState.chart;
state.textObjectId = this.curState.textObject.Get_Id();
state.textState = this.curState.textObject.txBody.content.Get_SelectionState();
break;
}
case STATES_ID_CHART:
{
state.id = STATES_ID_CHART;
state.chart = this.curState.chart;
state.selectedTitle = null;
var chart = this.curState.chart;
if(chart.chartTitle && chart.chartTitle.selected)
{
state.selectedTitle = chart.chartTitle;
}
else if(chart.hAxisTitle && chart.hAxisTitle.selected)
{
state.selectedTitle = chart.hAxisTitle;
}
else if(chart.vAxisTitle && chart.vAxisTitle.selected)
{
state.selectedTitle = chart.vAxisTitle;
}
break;
}
default :
{
state.id = STATES_ID_NULL;
......@@ -858,6 +950,28 @@ DrawingObjectsController.prototype =
this.changeCurrentState(new GroupState(this, this.drawingObjects, group));
break;
}
case STATES_ID_CHART_TEXT_ADD:
{
state.chart.select(this);
var text_title = g_oTableId.Get_ById(state.textObjectId);
if(text_title)
{
text_title.select()
text_title.txBody.content.Set_SelectionState(state.textState, state.textState.length - 1);
}
this.changeCurrentState(new ChartTextAdd(this, this.drawingObjects, state.chart, text_title));
break;
}
case STATES_ID_CHART:
{
state.chart.select(this);
if(state.selectedTitle)
{
state.selectedTitle.select();
}
this.changeCurrentState(new ChartState(this, this.drawingObjects, state.chart));
break;
}
default :
{
for(var i = 0; i < state.selectedObjects.length; ++i)
......
......@@ -954,7 +954,7 @@ CChartAsGroup.prototype =
break;
}
}
this.resetSelection();
},
resetSelection: function()
......
......@@ -101,6 +101,296 @@ CChartTitle.prototype =
this.txBody.content.Selection_Remove();
},
getParagraphParaPr: function()
{
if(this.txBody)
{
return this.txBody.content.Get_Paragraph_ParaPr();
}
return null;
},
getParagraphTextPr: function()
{
if(this.txBody)
{
return this.txBody.content.Get_Paragraph_TextPr();
}
return null;
},
getAllParagraphParaPr: function()
{
if(this.txBody)
{
this.txBody.content.Set_ApplyToAll(true);
var paraPr = this.txBody.content.Get_Paragraph_ParaPr();
this.txBody.content.Set_ApplyToAll(false);
return paraPr;
}
return null;
},
getAllParagraphTextPr: function()
{
if(this.txBody)
{
this.txBody.content.Set_ApplyToAll(true);
var paraPr = this.txBody.content.Get_Paragraph_TextPr();
this.txBody.content.Set_ApplyToAll(false);
return paraPr;
}
return null;
},
// Увеличение размера шрифта
increaseFontSize: function () {
if(isRealObject(this.txBody))
{
this.txBody.content.Paragraph_IncDecFontSize(true);
this.chartGroup.recalculate();
}
},
// Уменьшение размера шрифта
decreaseFontSize: function () {
if(isRealObject(this.txBody))
{
this.txBody.content.Paragraph_IncDecFontSize(false);
this.chartGroup.recalculate();
}
},
increaseAllFontSize: function () {
if(isRealObject(this.txBody))
{
this.txBody.content.Set_ApplyToAll(true);
this.txBody.content.Paragraph_IncDecFontSize(true);
this.txBody.content.Set_ApplyToAll(false);
this.chartGroup.recalculate();
this.calculateTransformTextMatrix();
}
},
// Уменьшение размера шрифта
decreaseAllFontSize: function () {
if(isRealObject(this.txBody))
{
this.txBody.content.Set_ApplyToAll(true);
this.txBody.content.Paragraph_IncDecFontSize(false);
this.txBody.content.Set_ApplyToAll(false);
this.chartGroup.recalculate();
this.calculateTransformTextMatrix();
}
},
setCellFontName: function (fontName) {
if(isRealObject(this.txBody))
{
var text_pr = new ParaTextPr();
text_pr.Set_FontFamily({Name: fontName, Index: -1});
this.txBody.paragraphAdd(text_pr);
this.chartGroup.recalculate();
this.drawingObjects.showDrawingObjects();
}
},
setCellFontSize: function (fontSize) {
if(isRealObject(this.txBody))
{
var text_pr = new ParaTextPr();
text_pr.Set_FontSize(fontSize);
this.txBody.paragraphAdd(text_pr);
this.chartGroup.recalculate();
this.drawingObjects.showDrawingObjects();
}
},
setCellBold: function (isBold) {
if(isRealObject(this.txBody))
{
var text_pr = new ParaTextPr();
text_pr.Set_Bold(isBold);
this.txBody.paragraphAdd(text_pr);
this.chartGroup.recalculate();
this.drawingObjects.showDrawingObjects();
}
},
setCellItalic: function (isItalic) {
if(isRealObject(this.txBody))
{
var text_pr = new ParaTextPr();
text_pr.Set_Italic(isItalic);
this.txBody.paragraphAdd(text_pr);
this.chartGroup.recalculate();
this.drawingObjects.showDrawingObjects();
}
},
setCellUnderline: function (isUnderline) {
if(isRealObject(this.txBody))
{
var text_pr = new ParaTextPr();
text_pr.Set_Underline(isUnderline);
this.txBody.paragraphAdd(text_pr);
this.chartGroup.recalculate();
}
},
setCellStrikeout: function (isStrikeout) {
if(isRealObject(this.txBody))
{
var text_pr = new ParaTextPr();
text_pr.Set_Strikeout(isStrikeout);
this.txBody.paragraphAdd(text_pr);
this.chartGroup.recalculate();
}
},
setCellTextColor: function (color) {
if(isRealObject(this.txBody))
{
var unifill = new CUniFill();
unifill.setFill(new CSolidFill());
unifill.fill.setColor(CorrectUniColor2(color, null));
var text_pr = new ParaTextPr();
text_pr.SetUniFill(unifill);
this.txBody.paragraphAdd(text_pr);
this.chartGroup.recalculate();
}
},
setCellAllFontName: function (fontName) {
if(isRealObject(this.txBody))
{
var text_pr = new ParaTextPr();
text_pr.Set_FontFamily({Name: fontName, Index: -1});
this.txBody.content.Set_ApplyToAll(true);
this.txBody.paragraphAdd(text_pr);
this.txBody.content.Set_ApplyToAll(false);
this.chartGroup.recalculate();
}
},
setCellAllFontSize: function (fontSize) {
if(isRealObject(this.txBody))
{
var text_pr = new ParaTextPr();
text_pr.Set_FontSize(fontSize);
this.txBody.content.Set_ApplyToAll(true);
this.txBody.paragraphAdd(text_pr);
this.txBody.content.Set_ApplyToAll(false);
this.chartGroup.recalculate();
}
},
setCellAllBold: function (isBold) {
if(isRealObject(this.txBody))
{
var text_pr = new ParaTextPr();
text_pr.Set_Bold(isBold);
this.txBody.content.Set_ApplyToAll(true);
this.txBody.paragraphAdd(text_pr);
this.txBody.content.Set_ApplyToAll(false);
this.chartGroup.recalculate();
}
},
setCellAllItalic: function (isItalic) {
if(isRealObject(this.txBody))
{
var text_pr = new ParaTextPr();
text_pr.Set_Italic(isItalic);
this.txBody.content.Set_ApplyToAll(true);
this.txBody.paragraphAdd(text_pr);
this.txBody.content.Set_ApplyToAll(false);
this.chartGroup.recalculate();
}
},
setCellAllUnderline: function (isUnderline) {
if(isRealObject(this.txBody))
{
var text_pr = new ParaTextPr();
text_pr.Set_Underline(isUnderline);
this.txBody.content.Set_ApplyToAll(true);
this.txBody.paragraphAdd(text_pr);
this.txBody.content.Set_ApplyToAll(false);
this.chartGroup.recalculate();
}
},
setCellAllStrikeout: function (isStrikeout) {
if(isRealObject(this.txBody))
{
var text_pr = new ParaTextPr();
text_pr.Set_Strikeout(isStrikeout);
this.txBody.content.Set_ApplyToAll(true);
this.txBody.paragraphAdd(text_pr);
this.txBody.content.Set_ApplyToAll(false);
this.chartGroup.recalculate();
}
},
setCellAllSubscript: function (isSubscript) {
if(isRealObject(this.txBody))
{
var text_pr = new ParaTextPr();
text_pr.Set_VertAlign(isSubscript ? vertalign_SubScript : vertalign_Baseline);
this.txBody.content.Set_ApplyToAll(true);
this.txBody.paragraphAdd(text_pr);
this.txBody.content.Set_ApplyToAll(false);
this.chartGroup.recalculate();
}
},
setCellAllSuperscript: function (isSuperscript) {
if(isRealObject(this.txBody))
{
var text_pr = new ParaTextPr();
text_pr.Set_VertAlign(isSubscript ? vertalign_SuperScript : vertalign_Baseline);
this.txBody.content.Set_ApplyToAll(true);
this.txBody.paragraphAdd(text_pr);
this.txBody.content.Set_ApplyToAll(false);
this.chartGroup.recalculate();
}
},
setCellAllTextColor: function (color) {
if(isRealObject(this.txBody))
{
var unifill = new CUniFill();
unifill.setFill(new CSolidFill());
unifill.fill.setColor(CorrectUniColor2(color, null));
var text_pr = new ParaTextPr();
text_pr.SetUniFill(unifill);
this.txBody.content.Set_ApplyToAll(true);
this.txBody.paragraphAdd(text_pr);
this.txBody.content.Set_ApplyToAll(false);
this.chartGroup.recalculate();
}
},
getStyles: function()
{
var styles = new CStyles();
......
This diff is collapsed.
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