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

git-svn-id:...

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@53256 954022d7-b5bf-4e40-9824-e11837661b57
parent 72e60839
......@@ -2913,6 +2913,7 @@ function DrawingObjects() {
var taskTimerId = setInterval(drawTaskFunction, 5);
var api = window["Asc"]["editor"];
userId = api.User.asc_getId();
documentId = api.documentId;
worksheet = currentSheet;
......@@ -2942,6 +2943,7 @@ function DrawingObjects() {
aImagesSync = [];
aObjectsSync = [];
var theme = api.wbModel.theme;
for (var i = 0; currentSheet.model.Drawings && (i < currentSheet.model.Drawings.length); i++) {
var drawingObject = _this.cloneDrawingObject(currentSheet.model.Drawings[i]);
......@@ -2974,7 +2976,7 @@ function DrawingObjects() {
drawingObject.graphicObject.chart.worksheet = worksheet;
drawingObject.graphicObject.chart.rebuildSeries();
drawingObject.graphicObject.init();
drawingObject.graphicObject.init(theme);
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterInit2Chart, null, null,
new UndoRedoDataGraphicObjects(drawingObject.graphicObject.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
drawingObject.graphicObject.addToDrawingObjects();
......@@ -2989,7 +2991,7 @@ function DrawingObjects() {
drawingObject.graphicObject.setDrawingObjects(_this);
drawingObject.graphicObject.setDrawingDocument(_this.drawingDocument);
var xfrm = drawingObject.graphicObject.spPr.xfrm;
drawingObject.graphicObject.checkThemeFonts(theme);
if(!xfrm)
{
drawingObject.graphicObject.setXfrmObject(new CXfrm());
......@@ -3041,6 +3043,7 @@ function DrawingObjects() {
drawingObject.graphicObject.setDrawingObjects(_this);
var xfrm = drawingObject.graphicObject.spPr.xfrm;
drawingObject.graphicObject.checkThemeFonts(theme);
if(!xfrm)
{
drawingObject.graphicObject.setXfrmObject(new CXfrm());
......
......@@ -338,7 +338,7 @@ CChartAsGroup.prototype =
this.spPr.xfrm = xfrm;
},
init: function()
init: function(theme)
{
if(isRealObject(this.drawingBase))
{
......@@ -379,6 +379,7 @@ CChartAsGroup.prototype =
content.Content[i].setDrawingDocument(this.drawingObjects.drawingDocument);
content.Content[i].setParent(content);
content.Content[i].setTextPr(new ParaTextPr());
content.Content[i].checkThemeFonts(theme);
}
this.chart.header.title = this.chartTitle.txBody.content.getTextString();
......@@ -416,6 +417,7 @@ CChartAsGroup.prototype =
content.Content[i].setDrawingDocument(this.drawingObjects.drawingDocument);
content.Content[i].setParent(content);
content.Content[i].setTextPr(new ParaTextPr());
content.Content[i].checkThemeFonts(theme);
}
this.chart.xAxis.title = this.hAxisTitle.txBody.content.getTextString();
......@@ -458,6 +460,7 @@ CChartAsGroup.prototype =
content.Content[i].setDrawingDocument(this.drawingObjects.drawingDocument);
content.Content[i].setParent(content);
content.Content[i].setTextPr(new ParaTextPr());
content.Content[i].checkThemeFonts(theme);
}
this.chart.yAxis.title = this.vAxisTitle.txBody.content.getTextString();
......
......@@ -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)
{
//if(this.recalcInfo.recalculateTransform)
......
......@@ -173,6 +173,57 @@ Paragraph.prototype =
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()
{
return CLASS_TYPE_PARAGRAPH;
......
......@@ -2925,6 +2925,18 @@ CShape.prototype =
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)
{
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