Commit 1cda6489 authored by Dmitry.Vikulov's avatar Dmitry.Vikulov Committed by Alexander.Trofimov

передача текстовых настроек в контроллер графических объектов

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@48403 954022d7-b5bf-4e40-9824-e11837661b57
parent 4b0aec4f
This diff is collapsed.
......@@ -2174,6 +2174,15 @@ function setFontChart(chart)
bar._chartTitle._italic = chart.header.font.italic ? chart.header.font.italic : false;
bar._chartTitle._underline = chart.header.font.underline ? chart.header.font.underline : false;
}
else
{
bar._chartTitle._bold = true;
bar._chartTitle._color = defaultColor;
bar._chartTitle._font = defaultFont;
bar._chartTitle._size = defaultSize;
bar._chartTitle._italic = false;
bar._chartTitle._underline = false;
}
if(chart.xAxis.titleFont)//название оси OX
{
......@@ -2184,6 +2193,15 @@ function setFontChart(chart)
bar._xAxisTitle._italic = chart.xAxis.titleFont.italic ? chart.xAxis.titleFont.italic : false;
bar._xAxisTitle._underline = chart.xAxis.titleFont.underline ? chart.xAxis.titleFont.underline : false;
}
else
{
bar._xAxisTitle._bold = true;
bar._xAxisTitle._color = defaultColor;
bar._xAxisTitle._font = defaultFont;
bar._xAxisTitle._size = defaultFont;
bar._xAxisTitle._italic = false;
bar._xAxisTitle._underline = false;
}
if(chart.yAxis.titleFont)//название оси OY
{
......@@ -2194,6 +2212,15 @@ function setFontChart(chart)
bar._yAxisTitle._italic = chart.yAxis.titleFont.italic ? chart.yAxis.titleFont.italic : false;
bar._yAxisTitle._underline = chart.yAxis.titleFont.underline ? chart.yAxis.titleFont.underline : false;
}
else
{
bar._yAxisTitle._bold = true;
bar._yAxisTitle._color = defaultColor;
bar._yAxisTitle._font = defaultFont;
bar._yAxisTitle._size = defaultFont;
bar._yAxisTitle._italic = false;
bar._yAxisTitle._underline = false;
}
if(chart.legend.font)//подписи легенды
{
......@@ -2204,6 +2231,15 @@ function setFontChart(chart)
bar._otherProps._key_text_italic = chart.legend.font.italic ? chart.legend.font.italic : false;
bar._otherProps._key_text_underline = chart.legend.font.underline ? chart.legend.font.underline : false;
}
else
{
bar._otherProps._key_text_bold = false;
bar._otherProps._key_text_color = defaultColor;
bar._otherProps._key_text_font = defaultFont;
bar._otherProps._key_text_size = defaultFont;
bar._otherProps._key_text_italic = false;
bar._otherProps._key_text_underline = false;
}
if(chart.xAxis.labelFont)//значения по оси OX
{
......@@ -2213,7 +2249,16 @@ function setFontChart(chart)
bar._otherProps._xlabels_size = chart.xAxis.labelFont.size ? chart.xAxis.labelFont.size : defaultSize;
bar._otherProps._xlabels_italic = chart.xAxis.labelFont.italic ? chart.xAxis.labelFont.italic : false;
bar._otherProps._xlabels_underline = chart.xAxis.labelFont.underline ? chart.xAxis.labelFont.underline : false;
}
}
else
{
bar._otherProps._xlabels_bold = false;
bar._otherProps._xlabels_color = defaultColor;
bar._otherProps._xlabels_font = defaultFont;
bar._otherProps._xlabels_size = defaultSize;
bar._otherProps._xlabels_italic = false;
bar._otherProps._xlabels_underline = false;
}
if(chart.yAxis.labelFont)//значения по оси OY
{
......@@ -2223,7 +2268,16 @@ function setFontChart(chart)
bar._otherProps._ylabels_size = chart.yAxis.labelFont.size ? chart.yAxis.labelFont.size : defaultSize;
bar._otherProps._ylabels_italic = chart.yAxis.labelFont.italic ? chart.yAxis.labelFont.italic : false;
bar._otherProps._ylabels_underline = chart.yAxis.labelFont.underline ? chart.yAxis.labelFont.underline : false;
}
}
else
{
bar._otherProps._ylabels_bold = false;
bar._otherProps._ylabels_color = defaultColor;
bar._otherProps._ylabels_font = defaultFont;
bar._otherProps._ylabels_size = defaultSize;
bar._otherProps._ylabels_italic = false;
bar._otherProps._ylabels_underline = false;
}
if(chart.legend.font)//подписи значений графика
{
......@@ -2233,9 +2287,18 @@ function setFontChart(chart)
bar._otherProps._labels_above_size = chart.legend.font.size ? chart.legend.font.size : defaultSize;
bar._otherProps._labels_above_italic = chart.legend.font.italic ? chart.legend.font.italic : false;
bar._otherProps._labels_above_underline = chart.legend.font.underline ? chart.legend.font.underline : false;
}
}
else
{
bar._otherProps._labels_above_bold = false;
bar._otherProps._labels_above_color = defaultColor;
bar._otherProps._labels_above_font = defaultFont;
bar._otherProps._labels_above_size = defaultSize;
bar._otherProps._labels_above_italic = false;
bar._otherProps._labels_above_underline = false;
}
if(chart.xAxis.font)//остальные подписи
//if(chart.xAxis.font)//остальные подписи
{
bar._otherProps._text_color = defaultColor;
bar._otherProps._text_bold = false;
......
......@@ -2239,72 +2239,137 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
asc_setCellFontName: function (fontName) {
var t = this;
t._loadFonts([fontName], function () {
t.wb.setFontAttributes("fn", fontName);
t.wb.restoreFocus();
var ws = t.wb.getWorksheet();
if ( ws.objectRender.selectedGraphicObjectsExists() && ws.objectRender.controller.setCellFontName )
ws.objectRender.controller.setCellFontName(fontName);
else {
t.wb.setFontAttributes("fn", fontName);
t.wb.restoreFocus();
}
});
},
asc_setCellFontSize: function (fontSize) {
this.wb.setFontAttributes("fs", fontSize);
this.wb.restoreFocus();
var ws = this.wb.getWorksheet();
if ( ws.objectRender.selectedGraphicObjectsExists() && ws.objectRender.controller.setCellFontSize )
ws.objectRender.controller.setCellFontSize(fontSize);
else {
this.wb.setFontAttributes("fs", fontSize);
this.wb.restoreFocus();
}
},
asc_setCellBold: function (isBold) {
this.wb.setFontAttributes("b", isBold);
this.wb.restoreFocus();
var ws = this.wb.getWorksheet();
if ( ws.objectRender.selectedGraphicObjectsExists() && ws.objectRender.controller.setCellBold )
ws.objectRender.controller.setCellBold(isBold);
else {
this.wb.setFontAttributes("b", isBold);
this.wb.restoreFocus();
}
},
asc_setCellItalic: function (isItalic) {
this.wb.setFontAttributes("i", isItalic);
this.wb.restoreFocus();
var ws = this.wb.getWorksheet();
if ( ws.objectRender.selectedGraphicObjectsExists() && ws.objectRender.controller.setCellItalic )
ws.objectRender.controller.setCellItalic(isItalic);
else {
this.wb.setFontAttributes("i", isItalic);
this.wb.restoreFocus();
}
},
asc_setCellUnderline: function (isUnderline) {
this.wb.setFontAttributes("u", isUnderline ? "single" : "none");
this.wb.restoreFocus();
var ws = this.wb.getWorksheet();
if ( ws.objectRender.selectedGraphicObjectsExists() && ws.objectRender.controller.setCellUnderline )
ws.objectRender.controller.setCellUnderline(isUnderline);
else {
this.wb.setFontAttributes("u", isUnderline ? "single" : "none");
this.wb.restoreFocus();
}
},
asc_setCellStrikeout: function (isStrikeout) {
this.wb.setFontAttributes("s", isStrikeout);
this.wb.restoreFocus();
var ws = this.wb.getWorksheet();
if ( ws.objectRender.selectedGraphicObjectsExists() && ws.objectRender.controller.setCellStrikeout )
ws.objectRender.controller.setCellStrikeout(isStrikeout);
else {
this.wb.setFontAttributes("s", isStrikeout);
this.wb.restoreFocus();
}
},
asc_setCellSubscript: function (isSubscript) {
this.wb.setFontAttributes("fa", isSubscript ? "subscript" : "none");
this.wb.restoreFocus();
var ws = this.wb.getWorksheet();
if ( ws.objectRender.selectedGraphicObjectsExists() && ws.objectRender.controller.setCellSubscript )
ws.objectRender.controller.setCellSubscript(isSubscript);
else {
this.wb.setFontAttributes("fa", isSubscript ? "subscript" : "none");
this.wb.restoreFocus();
}
},
asc_setCellSuperscript: function (isSuperscript) {
this.wb.setFontAttributes("fa", isSuperscript ? "superscript" : "none");
this.wb.restoreFocus();
var ws = this.wb.getWorksheet();
if ( ws.objectRender.selectedGraphicObjectsExists() && ws.objectRender.controller.setCellSuperscript )
ws.objectRender.controller.setCellSuperscript(isSuperscript);
else {
this.wb.setFontAttributes("fa", isSuperscript ? "superscript" : "none");
this.wb.restoreFocus();
}
},
asc_setCellAlign: function (align) {
this.wb.getWorksheet().setSelectionInfo("a", align);
this.wb.restoreFocus();
var ws = this.wb.getWorksheet();
if ( ws.objectRender.selectedGraphicObjectsExists() && ws.objectRender.controller.setCellAlign )
ws.objectRender.controller.setCellAlign(align);
else {
this.wb.getWorksheet().setSelectionInfo("a", align);
this.wb.restoreFocus();
}
},
asc_setCellVertAlign: function (align) {
this.wb.getWorksheet().setSelectionInfo("va", align);
this.wb.restoreFocus();
var ws = this.wb.getWorksheet();
if ( ws.objectRender.selectedGraphicObjectsExists() && ws.objectRender.controller.setCellVertAlign )
ws.objectRender.controller.setCellVertAlign(align);
else {
this.wb.getWorksheet().setSelectionInfo("va", align);
this.wb.restoreFocus();
}
},
asc_setCellTextWrap: function (isWrapped) {
this.wb.getWorksheet().setSelectionInfo("wrap", isWrapped);
this.wb.restoreFocus();
var ws = this.wb.getWorksheet();
if ( ws.objectRender.selectedGraphicObjectsExists() && ws.objectRender.controller.setCellTextWrap )
ws.objectRender.controller.setCellTextWrap(isWrapped);
else {
this.wb.getWorksheet().setSelectionInfo("wrap", isWrapped);
this.wb.restoreFocus();
}
},
asc_setCellTextShrink: function (isShrinked) {
this.wb.getWorksheet().setSelectionInfo("shrink", isShrinked);
this.wb.restoreFocus();
var ws = this.wb.getWorksheet();
if ( ws.objectRender.selectedGraphicObjectsExists() && ws.objectRender.controller.setCellTextShrink )
ws.objectRender.controller.setCellTextShrink(isShrinked);
else {
this.wb.getWorksheet().setSelectionInfo("shrink", isShrinked);
this.wb.restoreFocus();
}
},
asc_setCellTextColor: function (color) {
if(color instanceof CAscColor)
{
if (color instanceof CAscColor) {
color = CorrectAscColor(color);
this.wb.setFontAttributes("c", color);
this.wb.restoreFocus();
var ws = this.wb.getWorksheet();
if ( ws.objectRender.selectedGraphicObjectsExists() && ws.objectRender.controller.setCellTextColor )
ws.objectRender.controller.setCellTextColor(color);
else {
this.wb.setFontAttributes("c", color);
this.wb.restoreFocus();
}
}
},
......
......@@ -1228,8 +1228,8 @@ CChartAsGroup.prototype =
}
}
this.chart.header.title = this.chartTitle.txBody.content.getTextString();
this.chart.header.font = new asc_CChartFont();
/*this.chartTitle.txBody.content.Set_ApplyToAll(true);
/*this.chart.header.font = new asc_CChartFont();
this.chartTitle.txBody.content.Set_ApplyToAll(true);
this.chartTitle.txBody.content.Set_ParagraphAlign(align_Center);
this.chartTitle.txBody.content.Set_ApplyToAll(false);*/
}
......
......@@ -5465,7 +5465,6 @@ function Binary_WorksheetTableReader(stream, wb, aSharedStrings, aCellXfs, Dxfs,
var objectRender = new DrawingObjects();
var oFlags = {from: false, to: false, pos: false, ext: false};
var oNewDrawing = objectRender.createDrawingObject();
oNewDrawing.id = "sheet" + wsId + "_" + (aDrawings.length + 1);
res = this.bcr.Read1(length, function(t, l) {
return oThis.ReadDrawing(t, l, oNewDrawing, oFlags);
});
......
......@@ -606,8 +606,8 @@
var graphicObjects = t.handlers.trigger("getSelectedGraphicObjects");
if ( graphicObjects.length ) {
t.handlers.trigger("graphicObjectWindowKeyDown", event);
return true;
if (t.handlers.trigger("graphicObjectWindowKeyDown", event))
return true;
}
// Двигаемся ли мы в выделенной области
......
......@@ -654,12 +654,12 @@
_onGraphicObjectWindowKeyDown: function (e) {
var ws = this.getWorksheet();
ws.objectRender.controller.onKeyDown(e);
return ws.objectRender.controller.onKeyDown(e);
},
_onGraphicObjectWindowKeyPress: function (e) {
var ws = this.getWorksheet();
ws.objectRender.controller.onKeyPress(e);
return ws.objectRender.controller.onKeyPress(e);
},
_onGetGraphicsInfo: function (x, y) {
......
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