Commit 3946ae0c authored by Sergey.Luzyanin's avatar Sergey.Luzyanin

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@53256 954022d7-b5bf-4e40-9824-e11837661b57
parent 8195468a
...@@ -285,7 +285,7 @@ asc_CChart.prototype = { ...@@ -285,7 +285,7 @@ asc_CChart.prototype = {
return Math.min( 255, ((255 - val) * percent + val) >> 0 ); return Math.min( 255, ((255 - val) * percent + val) >> 0 );
else else
return Math.max( 0, (val * (1 + percent)) >> 0 ); return Math.max( 0, (val * (1 + percent)) >> 0 );
}, },
_generateColor: function (oColor, percent) { _generateColor: function (oColor, percent) {
return new CColor(this._generateColorPart(oColor.r, percent), return new CColor(this._generateColorPart(oColor.r, percent),
...@@ -2447,11 +2447,11 @@ prot["asc_getIndex"] = prot.asc_getIndex; ...@@ -2447,11 +2447,11 @@ prot["asc_getIndex"] = prot.asc_getIndex;
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
// Manager // Manager
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
function GraphicOption(ws, type, delta) { function GraphicOption(ws, type, delta) {
var _this = this; var _this = this;
_this.ws = ws; _this.ws = ws;
_this.type = type; _this.type = type;
_this.delta = delta; // Scroll offset: + Down || - Up _this.delta = delta; // Scroll offset: + Down || - Up
function checkCol(col) { function checkCol(col) {
...@@ -2547,8 +2547,8 @@ function GraphicOption(ws, type, delta) { ...@@ -2547,8 +2547,8 @@ function GraphicOption(ws, type, delta) {
break; break;
} }
return vr; return vr;
} }
} }
function Exception(error) { function Exception(error) {
var err = error; var err = error;
...@@ -2912,7 +2912,8 @@ function DrawingObjects() { ...@@ -2912,7 +2912,8 @@ function DrawingObjects() {
_this.init = function(currentSheet) { _this.init = function(currentSheet) {
var taskTimerId = setInterval(drawTaskFunction, 5); var taskTimerId = setInterval(drawTaskFunction, 5);
var api = window["Asc"]["editor"];
userId = api.User.asc_getId(); userId = api.User.asc_getId();
documentId = api.documentId; documentId = api.documentId;
worksheet = currentSheet; worksheet = currentSheet;
...@@ -2941,7 +2942,8 @@ function DrawingObjects() { ...@@ -2941,7 +2942,8 @@ function DrawingObjects() {
aObjects = []; aObjects = [];
aImagesSync = []; aImagesSync = [];
aObjectsSync = []; aObjectsSync = [];
var theme = api.wbModel.theme;
for (var i = 0; currentSheet.model.Drawings && (i < currentSheet.model.Drawings.length); i++) { for (var i = 0; currentSheet.model.Drawings && (i < currentSheet.model.Drawings.length); i++) {
var drawingObject = _this.cloneDrawingObject(currentSheet.model.Drawings[i]); var drawingObject = _this.cloneDrawingObject(currentSheet.model.Drawings[i]);
...@@ -2974,7 +2976,7 @@ function DrawingObjects() { ...@@ -2974,7 +2976,7 @@ function DrawingObjects() {
drawingObject.graphicObject.chart.worksheet = worksheet; drawingObject.graphicObject.chart.worksheet = worksheet;
drawingObject.graphicObject.chart.rebuildSeries(); drawingObject.graphicObject.chart.rebuildSeries();
drawingObject.graphicObject.init(); drawingObject.graphicObject.init(theme);
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterInit2Chart, null, null, History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterInit2Chart, null, null,
new UndoRedoDataGraphicObjects(drawingObject.graphicObject.Get_Id(), new UndoRedoDataGOSingleProp(null, null))); new UndoRedoDataGraphicObjects(drawingObject.graphicObject.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
drawingObject.graphicObject.addToDrawingObjects(); drawingObject.graphicObject.addToDrawingObjects();
...@@ -2989,7 +2991,7 @@ function DrawingObjects() { ...@@ -2989,7 +2991,7 @@ function DrawingObjects() {
drawingObject.graphicObject.setDrawingObjects(_this); drawingObject.graphicObject.setDrawingObjects(_this);
drawingObject.graphicObject.setDrawingDocument(_this.drawingDocument); drawingObject.graphicObject.setDrawingDocument(_this.drawingDocument);
var xfrm = drawingObject.graphicObject.spPr.xfrm; var xfrm = drawingObject.graphicObject.spPr.xfrm;
drawingObject.graphicObject.checkThemeFonts(theme);
if(!xfrm) if(!xfrm)
{ {
drawingObject.graphicObject.setXfrmObject(new CXfrm()); drawingObject.graphicObject.setXfrmObject(new CXfrm());
...@@ -3041,6 +3043,7 @@ function DrawingObjects() { ...@@ -3041,6 +3043,7 @@ function DrawingObjects() {
drawingObject.graphicObject.setDrawingObjects(_this); drawingObject.graphicObject.setDrawingObjects(_this);
var xfrm = drawingObject.graphicObject.spPr.xfrm; var xfrm = drawingObject.graphicObject.spPr.xfrm;
drawingObject.graphicObject.checkThemeFonts(theme);
if(!xfrm) if(!xfrm)
{ {
drawingObject.graphicObject.setXfrmObject(new CXfrm()); drawingObject.graphicObject.setXfrmObject(new CXfrm());
......
...@@ -338,7 +338,7 @@ CChartAsGroup.prototype = ...@@ -338,7 +338,7 @@ CChartAsGroup.prototype =
this.spPr.xfrm = xfrm; this.spPr.xfrm = xfrm;
}, },
init: function() init: function(theme)
{ {
if(isRealObject(this.drawingBase)) if(isRealObject(this.drawingBase))
{ {
...@@ -379,6 +379,7 @@ CChartAsGroup.prototype = ...@@ -379,6 +379,7 @@ CChartAsGroup.prototype =
content.Content[i].setDrawingDocument(this.drawingObjects.drawingDocument); content.Content[i].setDrawingDocument(this.drawingObjects.drawingDocument);
content.Content[i].setParent(content); content.Content[i].setParent(content);
content.Content[i].setTextPr(new ParaTextPr()); content.Content[i].setTextPr(new ParaTextPr());
content.Content[i].checkThemeFonts(theme);
} }
this.chart.header.title = this.chartTitle.txBody.content.getTextString(); this.chart.header.title = this.chartTitle.txBody.content.getTextString();
...@@ -416,6 +417,7 @@ CChartAsGroup.prototype = ...@@ -416,6 +417,7 @@ CChartAsGroup.prototype =
content.Content[i].setDrawingDocument(this.drawingObjects.drawingDocument); content.Content[i].setDrawingDocument(this.drawingObjects.drawingDocument);
content.Content[i].setParent(content); content.Content[i].setParent(content);
content.Content[i].setTextPr(new ParaTextPr()); content.Content[i].setTextPr(new ParaTextPr());
content.Content[i].checkThemeFonts(theme);
} }
this.chart.xAxis.title = this.hAxisTitle.txBody.content.getTextString(); this.chart.xAxis.title = this.hAxisTitle.txBody.content.getTextString();
...@@ -458,6 +460,7 @@ CChartAsGroup.prototype = ...@@ -458,6 +460,7 @@ CChartAsGroup.prototype =
content.Content[i].setDrawingDocument(this.drawingObjects.drawingDocument); content.Content[i].setDrawingDocument(this.drawingObjects.drawingDocument);
content.Content[i].setParent(content); content.Content[i].setParent(content);
content.Content[i].setTextPr(new ParaTextPr()); content.Content[i].setTextPr(new ParaTextPr());
content.Content[i].checkThemeFonts(theme);
} }
this.chart.yAxis.title = this.vAxisTitle.txBody.content.getTextString(); this.chart.yAxis.title = this.vAxisTitle.txBody.content.getTextString();
......
...@@ -621,6 +621,17 @@ CGroupShape.prototype = ...@@ -621,6 +621,17 @@ CGroupShape.prototype =
} }
}, },
checkThemeFonts: function(theme)
{
for(var i =0; i < this.spTree.length; ++i)
{
if(this.spTree[i].checkThemeFonts)
{
this.spTree[i].checkThemeFonts(theme);
}
}
},
recalculate: function(aImages) recalculate: function(aImages)
{ {
//if(this.recalcInfo.recalculateTransform) //if(this.recalcInfo.recalculateTransform)
......
...@@ -173,6 +173,57 @@ Paragraph.prototype = ...@@ -173,6 +173,57 @@ Paragraph.prototype =
textPr.setParent(this); textPr.setParent(this);
}, },
checkThemeFonts: function(theme)
{
for(var i = 0; i < this.Content.length; ++i)
{
var para_item = this.Content[i];
if(isRealObject(para_item) && para_item.Type === para_TextPr)
{
var text_pr = para_item.Value;
if(isRealObject(text_pr.FontFamily) && isThemeFont(text_pr.FontFamily.Name))
{
if(theme && theme.themeElements && theme.themeElements.fontScheme)
text_pr.FontFamily.Name = getFontInfo(text_pr.FontFamily.Name)(theme.themeElements.fontScheme);
else
text_pr.FontFamily.Name = "Arial";
}
if(isRealObject(text_pr.RFonts))
{
if(isRealObject(text_pr.RFonts.Ascii) && isThemeFont(text_pr.RFonts.Ascii.Name))
{
if(theme && theme.themeElements && theme.themeElements.fontScheme)
text_pr.RFonts.Ascii.Name = getFontInfo(text_pr.RFonts.Ascii.Name)(theme.themeElements.fontScheme);
else
text_pr.RFonts.Ascii.Name = "Arial";
}
if(isRealObject(text_pr.RFonts.CS) && isThemeFont(text_pr.RFonts.CS.Name))
{
if(theme && theme.themeElements && theme.themeElements.fontScheme)
text_pr.RFonts.CS.Name = getFontInfo(text_pr.RFonts.CS.Name)(theme.themeElements.fontScheme);
else
text_pr.RFonts.CS.Name = "Arial";
}
if(isRealObject(text_pr.RFonts.EastAsia) && isThemeFont(text_pr.RFonts.EastAsia.Name))
{
if(theme && theme.themeElements && theme.themeElements.fontScheme)
text_pr.RFonts.EastAsia.Name = getFontInfo(text_pr.RFonts.EastAsia.Name)(theme.themeElements.fontScheme);
else
text_pr.RFonts.EastAsia.Name = "Arial";
}
if(isRealObject(text_pr.RFonts.HAnsi) && isThemeFont(text_pr.RFonts.HAnsi.Name))
{
if(theme && theme.themeElements && theme.themeElements.fontScheme)
text_pr.RFonts.HAnsi.Name = getFontInfo(text_pr.RFonts.HAnsi.Name)(theme.themeElements.fontScheme);
else
text_pr.RFonts.HAnsi.Name = "Arial";
}
}
}
}
},
getObjectType: function() getObjectType: function()
{ {
return CLASS_TYPE_PARAGRAPH; return CLASS_TYPE_PARAGRAPH;
......
...@@ -2925,6 +2925,18 @@ CShape.prototype = ...@@ -2925,6 +2925,18 @@ CShape.prototype =
return this.hitInInnerArea(x, y) || this.hitInPath(x, y) || this.hitInTextRect(x, y); return this.hitInInnerArea(x, y) || this.hitInPath(x, y) || this.hitInTextRect(x, y);
}, },
checkThemeFonts: function(theme)
{
if(this.txBody && this.txBody.content)
{
var content = this.txBody.content.Content;
for(var i = 0; i < content.length; ++i)
{
content[i].checkThemeFonts(theme);
}
}
},
hitInPath: function(x, y) hitInPath: function(x, y)
{ {
if(x < this.bounds.x if(x < this.bounds.x
......
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