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

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@53256 954022d7-b5bf-4e40-9824-e11837661b57
parent 72e60839
......@@ -285,7 +285,7 @@ asc_CChart.prototype = {
return Math.min( 255, ((255 - val) * percent + val) >> 0 );
else
return Math.max( 0, (val * (1 + percent)) >> 0 );
},
},
_generateColor: function (oColor, percent) {
return new CColor(this._generateColorPart(oColor.r, percent),
......@@ -2447,11 +2447,11 @@ prot["asc_getIndex"] = prot.asc_getIndex;
//-----------------------------------------------------------------------------------
// Manager
//-----------------------------------------------------------------------------------
function GraphicOption(ws, type, delta) {
var _this = this;
_this.ws = ws;
_this.type = type;
_this.ws = ws;
_this.type = type;
_this.delta = delta; // Scroll offset: + Down || - Up
function checkCol(col) {
......@@ -2547,8 +2547,8 @@ function GraphicOption(ws, type, delta) {
break;
}
return vr;
}
}
}
}
function Exception(error) {
var err = error;
......@@ -2912,7 +2912,8 @@ function DrawingObjects() {
_this.init = function(currentSheet) {
var taskTimerId = setInterval(drawTaskFunction, 5);
var api = window["Asc"]["editor"];
userId = api.User.asc_getId();
documentId = api.documentId;
worksheet = currentSheet;
......@@ -2941,7 +2942,8 @@ function DrawingObjects() {
aObjects = [];
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