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) ...@@ -2174,6 +2174,15 @@ function setFontChart(chart)
bar._chartTitle._italic = chart.header.font.italic ? chart.header.font.italic : false; bar._chartTitle._italic = chart.header.font.italic ? chart.header.font.italic : false;
bar._chartTitle._underline = chart.header.font.underline ? chart.header.font.underline : 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 if(chart.xAxis.titleFont)//название оси OX
{ {
...@@ -2184,6 +2193,15 @@ function setFontChart(chart) ...@@ -2184,6 +2193,15 @@ function setFontChart(chart)
bar._xAxisTitle._italic = chart.xAxis.titleFont.italic ? chart.xAxis.titleFont.italic : false; bar._xAxisTitle._italic = chart.xAxis.titleFont.italic ? chart.xAxis.titleFont.italic : false;
bar._xAxisTitle._underline = chart.xAxis.titleFont.underline ? chart.xAxis.titleFont.underline : 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 if(chart.yAxis.titleFont)//название оси OY
{ {
...@@ -2194,6 +2212,15 @@ function setFontChart(chart) ...@@ -2194,6 +2212,15 @@ function setFontChart(chart)
bar._yAxisTitle._italic = chart.yAxis.titleFont.italic ? chart.yAxis.titleFont.italic : false; bar._yAxisTitle._italic = chart.yAxis.titleFont.italic ? chart.yAxis.titleFont.italic : false;
bar._yAxisTitle._underline = chart.yAxis.titleFont.underline ? chart.yAxis.titleFont.underline : 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)//подписи легенды if(chart.legend.font)//подписи легенды
{ {
...@@ -2204,6 +2231,15 @@ function setFontChart(chart) ...@@ -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_italic = chart.legend.font.italic ? chart.legend.font.italic : false;
bar._otherProps._key_text_underline = chart.legend.font.underline ? chart.legend.font.underline : 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 if(chart.xAxis.labelFont)//значения по оси OX
{ {
...@@ -2214,6 +2250,15 @@ function setFontChart(chart) ...@@ -2214,6 +2250,15 @@ function setFontChart(chart)
bar._otherProps._xlabels_italic = chart.xAxis.labelFont.italic ? chart.xAxis.labelFont.italic : false; 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; 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 if(chart.yAxis.labelFont)//значения по оси OY
{ {
...@@ -2224,6 +2269,15 @@ function setFontChart(chart) ...@@ -2224,6 +2269,15 @@ function setFontChart(chart)
bar._otherProps._ylabels_italic = chart.yAxis.labelFont.italic ? chart.yAxis.labelFont.italic : false; 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; 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)//подписи значений графика if(chart.legend.font)//подписи значений графика
{ {
...@@ -2234,8 +2288,17 @@ function setFontChart(chart) ...@@ -2234,8 +2288,17 @@ function setFontChart(chart)
bar._otherProps._labels_above_italic = chart.legend.font.italic ? chart.legend.font.italic : false; 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; 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_color = defaultColor;
bar._otherProps._text_bold = false; bar._otherProps._text_bold = false;
......
...@@ -2239,73 +2239,138 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -2239,73 +2239,138 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
asc_setCellFontName: function (fontName) { asc_setCellFontName: function (fontName) {
var t = this; var t = this;
t._loadFonts([fontName], function () { t._loadFonts([fontName], function () {
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.setFontAttributes("fn", fontName);
t.wb.restoreFocus(); t.wb.restoreFocus();
}
}); });
}, },
asc_setCellFontSize: function (fontSize) { asc_setCellFontSize: function (fontSize) {
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.setFontAttributes("fs", fontSize);
this.wb.restoreFocus(); this.wb.restoreFocus();
}
}, },
asc_setCellBold: function (isBold) { asc_setCellBold: function (isBold) {
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.setFontAttributes("b", isBold);
this.wb.restoreFocus(); this.wb.restoreFocus();
}
}, },
asc_setCellItalic: function (isItalic) { asc_setCellItalic: function (isItalic) {
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.setFontAttributes("i", isItalic);
this.wb.restoreFocus(); this.wb.restoreFocus();
}
}, },
asc_setCellUnderline: function (isUnderline) { asc_setCellUnderline: function (isUnderline) {
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.setFontAttributes("u", isUnderline ? "single" : "none");
this.wb.restoreFocus(); this.wb.restoreFocus();
}
}, },
asc_setCellStrikeout: function (isStrikeout) { asc_setCellStrikeout: function (isStrikeout) {
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.setFontAttributes("s", isStrikeout);
this.wb.restoreFocus(); this.wb.restoreFocus();
}
}, },
asc_setCellSubscript: function (isSubscript) { asc_setCellSubscript: function (isSubscript) {
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.setFontAttributes("fa", isSubscript ? "subscript" : "none");
this.wb.restoreFocus(); this.wb.restoreFocus();
}
}, },
asc_setCellSuperscript: function (isSuperscript) { asc_setCellSuperscript: function (isSuperscript) {
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.setFontAttributes("fa", isSuperscript ? "superscript" : "none");
this.wb.restoreFocus(); this.wb.restoreFocus();
}
}, },
asc_setCellAlign: function (align) { asc_setCellAlign: function (align) {
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.getWorksheet().setSelectionInfo("a", align);
this.wb.restoreFocus(); this.wb.restoreFocus();
}
}, },
asc_setCellVertAlign: function (align) { asc_setCellVertAlign: function (align) {
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.getWorksheet().setSelectionInfo("va", align);
this.wb.restoreFocus(); this.wb.restoreFocus();
}
}, },
asc_setCellTextWrap: function (isWrapped) { asc_setCellTextWrap: function (isWrapped) {
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.getWorksheet().setSelectionInfo("wrap", isWrapped);
this.wb.restoreFocus(); this.wb.restoreFocus();
}
}, },
asc_setCellTextShrink: function (isShrinked) { asc_setCellTextShrink: function (isShrinked) {
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.getWorksheet().setSelectionInfo("shrink", isShrinked);
this.wb.restoreFocus(); this.wb.restoreFocus();
}
}, },
asc_setCellTextColor: function (color) { asc_setCellTextColor: function (color) {
if(color instanceof CAscColor) if (color instanceof CAscColor) {
{
color = CorrectAscColor(color); color = CorrectAscColor(color);
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.setFontAttributes("c", color);
this.wb.restoreFocus(); this.wb.restoreFocus();
} }
}
}, },
asc_setCellBackgroundColor: function (color) { asc_setCellBackgroundColor: function (color) {
......
...@@ -1228,8 +1228,8 @@ CChartAsGroup.prototype = ...@@ -1228,8 +1228,8 @@ CChartAsGroup.prototype =
} }
} }
this.chart.header.title = this.chartTitle.txBody.content.getTextString(); this.chart.header.title = this.chartTitle.txBody.content.getTextString();
this.chart.header.font = new asc_CChartFont(); /*this.chart.header.font = new asc_CChartFont();
/*this.chartTitle.txBody.content.Set_ApplyToAll(true); this.chartTitle.txBody.content.Set_ApplyToAll(true);
this.chartTitle.txBody.content.Set_ParagraphAlign(align_Center); this.chartTitle.txBody.content.Set_ParagraphAlign(align_Center);
this.chartTitle.txBody.content.Set_ApplyToAll(false);*/ this.chartTitle.txBody.content.Set_ApplyToAll(false);*/
} }
......
...@@ -5465,7 +5465,6 @@ function Binary_WorksheetTableReader(stream, wb, aSharedStrings, aCellXfs, Dxfs, ...@@ -5465,7 +5465,6 @@ function Binary_WorksheetTableReader(stream, wb, aSharedStrings, aCellXfs, Dxfs,
var objectRender = new DrawingObjects(); var objectRender = new DrawingObjects();
var oFlags = {from: false, to: false, pos: false, ext: false}; var oFlags = {from: false, to: false, pos: false, ext: false};
var oNewDrawing = objectRender.createDrawingObject(); var oNewDrawing = objectRender.createDrawingObject();
oNewDrawing.id = "sheet" + wsId + "_" + (aDrawings.length + 1);
res = this.bcr.Read1(length, function(t, l) { res = this.bcr.Read1(length, function(t, l) {
return oThis.ReadDrawing(t, l, oNewDrawing, oFlags); return oThis.ReadDrawing(t, l, oNewDrawing, oFlags);
}); });
......
...@@ -606,7 +606,7 @@ ...@@ -606,7 +606,7 @@
var graphicObjects = t.handlers.trigger("getSelectedGraphicObjects"); var graphicObjects = t.handlers.trigger("getSelectedGraphicObjects");
if ( graphicObjects.length ) { if ( graphicObjects.length ) {
t.handlers.trigger("graphicObjectWindowKeyDown", event); if (t.handlers.trigger("graphicObjectWindowKeyDown", event))
return true; return true;
} }
......
...@@ -654,12 +654,12 @@ ...@@ -654,12 +654,12 @@
_onGraphicObjectWindowKeyDown: function (e) { _onGraphicObjectWindowKeyDown: function (e) {
var ws = this.getWorksheet(); var ws = this.getWorksheet();
ws.objectRender.controller.onKeyDown(e); return ws.objectRender.controller.onKeyDown(e);
}, },
_onGraphicObjectWindowKeyPress: function (e) { _onGraphicObjectWindowKeyPress: function (e) {
var ws = this.getWorksheet(); var ws = this.getWorksheet();
ws.objectRender.controller.onKeyPress(e); return ws.objectRender.controller.onKeyPress(e);
}, },
_onGetGraphicsInfo: function (x, y) { _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