Commit c28ea296 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@55897 954022d7-b5bf-4e40-9824-e11837661b57
parent 665c6694
......@@ -669,6 +669,7 @@ DrawingObjectsController.prototype =
selectObject: function(object, pageIndex)
{
object.select(this, pageIndex);
// this.sendDrawingObjectsProps();
},
deselectObject: function(object)
......@@ -1192,12 +1193,18 @@ DrawingObjectsController.prototype =
}
},
getTheme: function()
{
return this.draw
},
getParagraphTextPr: function()
{
var content = this.getTargetDocContent();
if(content)
{
return content.Get_Paragraph_TextPr();
var text_pr = content.Get_Paragraph_TextPr();
return text_pr;
}
else
{
......@@ -2188,6 +2195,7 @@ DrawingObjectsController.prototype =
calc_chart_type = c_oAscChartTypeSettings.unknown;
}
ret.type = calc_chart_type;
return ret;
},
getChartSpace: function(chart, options)
......@@ -2295,16 +2303,15 @@ DrawingObjectsController.prototype =
changeCurrentState: function(newState)
{
this.curState = newState;
//this.sendDrawingObjectsProps();
this.sendDrawingObjectsProps();
},
sendDrawingObjectsProps: function()
{
var objects_by_types = this.getSelectedObjectsByTypes();
//var ret = {};
//ret.chartProps = this.getChartProps();
//var objects_by_types = this.getSelectedObjectsByTypes();
var ret = {};
ret.chartProps = this.getChartProps();
window["Asc"]["editor"].handlers.trigger("asc_onChangeSelectDrawingObjects", ret);
},
......
This diff is collapsed.
......@@ -288,7 +288,7 @@ BinaryCommonWriter.prototype.WriteColorTheme = function(unifill, color)
case 12: nFormatId = EThemeColor.themecolorLight1;break;
case 13: nFormatId = EThemeColor.themecolorLight2;break;
case 14: nFormatId = EThemeColor.themecolorNone;break;
case 15: nFormatId = ThemeColor.themecolorText1;break;
case 15: nFormatId = EThemeColor.themecolorText1;break;
case 16: nFormatId = EThemeColor.themecolorText2;break;
}
this.memory.WriteByte(c_oSer_ColorThemeType.Color);
......
......@@ -153,10 +153,12 @@ CShape.prototype.handleUpdateFlip = function()
CShape.prototype.handleUpdateFill = function()
{
this.recalcBrush();
this.recalcFill();
this.addToRecalculate();
};
CShape.prototype.handleUpdateLn = function()
{
this.recalcPen();
this.recalcLine();
this.addToRecalculate();
};
......
......@@ -193,6 +193,10 @@ DrawingObjectsController.prototype.recalculate = function()
DrawingObjectsController.prototype.updateRecalcObjects = function()
{};
DrawingObjectsController.prototype. getTheme = function()
{
return window["Asc"]["editor"].wbModel.theme;
};
DrawingObjectsController.prototype.startRecalculate = function()
{
......
......@@ -7346,7 +7346,24 @@ CDocument.prototype =
var TextPr = this.Get_Paragraph_TextPr();
if ( null != TextPr )
{
var theme = this.Get_Theme();
if(theme && theme.themeElements && theme.themeElements.fontScheme)
{
if(TextPr.FontFamily)
{
TextPr.FontFamily.Name = theme.themeElements.fontScheme.checkFont(TextPr.FontFamily.Name);
}
if(TextPr.RFonts)
{
TextPr.RFonts.Ascii.Name = theme.themeElements.fontScheme.checkFont(TextPr.RFonts.Ascii.Name);
TextPr.RFonts.EastAsia.Name = theme.themeElements.fontScheme.checkFont(TextPr.RFonts.EastAsia.Name);
TextPr.RFonts.HAnsi.Name = theme.themeElements.fontScheme.checkFont(TextPr.RFonts.HAnsi.Name);
TextPr.RFonts.CS.Name = theme.themeElements.fontScheme.checkFont(TextPr.RFonts.CS.Name);
}
}
editor.UpdateTextPr(TextPr);
}
},
// Обновляем данные в интерфейсе о свойствах графики (картинки, автофигуры)
......
......@@ -6681,8 +6681,26 @@ CDocumentContent.prototype =
{
var TextPr = this.Get_Paragraph_TextPr();
if ( null != TextPr )
{
var theme = this.Get_Theme();
if(theme && theme.themeElements && theme.themeElements.fontScheme)
{
if(TextPr.FontFamily)
{
TextPr.FontFamily.Name = theme.themeElements.fontScheme.checkFont(TextPr.FontFamily.Name);
}
if(TextPr.RFonts)
{
TextPr.RFonts.Ascii.Name = theme.themeElements.fontScheme.checkFont(TextPr.RFonts.Ascii.Name);
TextPr.RFonts.EastAsia.Name = theme.themeElements.fontScheme.checkFont(TextPr.RFonts.EastAsia.Name);
TextPr.RFonts.HAnsi.Name = theme.themeElements.fontScheme.checkFont(TextPr.RFonts.HAnsi.Name);
TextPr.RFonts.CS.Name = theme.themeElements.fontScheme.checkFont(TextPr.RFonts.CS.Name);
}
}
editor.UpdateTextPr(TextPr);
}
},
Interface_Update_DrawingPr : function(Flag)
......
......@@ -30,6 +30,7 @@ StartAddNewShape.prototype =
this.drawingObjects.arrPreTrackObjects.push(new NewShapeTrack(this.preset, x, y, this.drawingObjects.document.theme, null, null, null, pageIndex));
this.bStart = true;
this.drawingObjects.swapTrackObjects();
return true;
},
onMouseMove: function(e, x, y, pageIndex)
......@@ -662,9 +663,9 @@ MoveState.prototype =
var tr_to_start_page_x;
var tr_to_start_page_y;
var t = CheckCoordsNeedPage(x, y, pageIndex, this.majorObject.parent.pageIndex, this.drawingObjects.drawingDocument);
var t = CheckCoordsNeedPage(x, y, pageIndex, this.majorObject.selectStartPage, this.drawingObjects.drawingDocument);
var startPage = this.drawingObjects.graphicPages[this.majorObject.parent.pageIndex];
var startPage = this.drawingObjects.graphicPages[this.majorObject.selectStartPage];
var startPos = {x: this.startX, y: this.startY};
var start_arr = startPage.beforeTextObjects.concat(startPage.wrappingObjects, startPage.inlineObjects, startPage.behindDocObjects);
var min_dx = null, min_dy = null;
......
......@@ -43,6 +43,17 @@ CChartSpace.prototype.getFullFlipV = CShape.prototype.getFullFlipV;
CChartSpace.prototype.Get_Theme = CShape.prototype.Get_Theme;
CChartSpace.prototype.Get_ColorMap = CShape.prototype.Get_ColorMap;
CChartSpace.prototype.handleUpdateFill = function()
{
this.recalcInfo.recalculatePenBrush = true;
this.addToRecalculate();
};
CChartSpace.prototype.handleUpdateLn = function()
{
this.recalcInfo.recalculatePenBrush = true;
this.addToRecalculate();
};
CChartSpace.prototype.setRecalculateInfo = function()
{
this.recalcInfo =
......@@ -68,7 +79,8 @@ CChartSpace.prototype.setRecalculateInfo = function()
recalculateHiLowLines: true,
recalculateUpDownBars: true,
recalculateLegend: true,
recalculateWrapPolygon: true
recalculateWrapPolygon: true,
recalculatePenBrush: true
};
this.baseColors = [];
this.bounds = {l: 0, t: 0, r: 0, b:0, w: 0, h:0};
......@@ -319,16 +331,20 @@ CChartSpace.prototype.recalculate = function()
this.recalcInfo.recalculateUpDownBars = false;
}
var b_recalc_legend = false;
if(this.recalcInfo.recalculateLegend)
{
this.recalculateLegend();
//this.recalcInfo.recalculateLegend = false;
this.recalcInfo.recalculateLegend = false;
b_recalc_legend = true;
}
var b_recalc_labels = false;
if(this.recalcInfo.recalculateAxisLabels)
{
this.recalculateAxisLabels();
this.recalcInfo.recalculateAxisLabels = false;
b_recalc_labels = true;
}
......@@ -336,7 +352,13 @@ CChartSpace.prototype.recalculate = function()
if(this.recalcInfo.recalculateAxisVal)
{
this.recalculateAxis();
//this.recalcInfo.recalculateAxisVal = false;
this.recalcInfo.recalculateAxisVal = false;
}
if(this.recalcInfo.recalculatePenBrush)
{
this.recalculatePenBrush();
this.recalcInfo.recalculatePenBrush = false;
}
if(this.recalcInfo.recalculateChart)
......@@ -355,35 +377,39 @@ CChartSpace.prototype.recalculate = function()
}
this.recalcInfo.dataLbls.length = 0;
if(this.chart && this.chart.title)
{
var pos = this.chartObj.reCalculatePositionText("title", this, this.chart.title);
this.chart.title.setPosition(pos.x, pos.y);
}
if(this.chart && this.chart.plotArea && this.chart.plotArea)
if(b_recalc_labels)
{
var hor_axis = this.chart.plotArea.getHorizontalAxis();
if(hor_axis && hor_axis.title)
if(this.chart && this.chart.title)
{
var old_cat_ax = this.chart.plotArea.catAx;
this.chart.plotArea.catAx = hor_axis;
var pos = this.chartObj.reCalculatePositionText("catAx", this, hor_axis.title);
hor_axis.title.setPosition(pos.x, pos.y);
this.chart.plotArea.catAx = old_cat_ax;
var pos = this.chartObj.reCalculatePositionText("title", this, this.chart.title);
this.chart.title.setPosition(pos.x, pos.y);
}
var vert_axis = this.chart.plotArea.getVerticalAxis();
if(vert_axis && vert_axis.title)
if(this.chart && this.chart.plotArea && this.chart.plotArea)
{
var old_val_ax = this.chart.plotArea.valAx;
this.chart.plotArea.valAx = vert_axis;
var pos = this.chartObj.reCalculatePositionText("valAx", this, vert_axis.title);
vert_axis.title.setPosition(pos.x, pos.y);
this.chart.plotArea.valAx = old_val_ax;
var hor_axis = this.chart.plotArea.getHorizontalAxis();
if(hor_axis && hor_axis.title)
{
var old_cat_ax = this.chart.plotArea.catAx;
this.chart.plotArea.catAx = hor_axis;
var pos = this.chartObj.reCalculatePositionText("catAx", this, hor_axis.title);
hor_axis.title.setPosition(pos.x, pos.y);
this.chart.plotArea.catAx = old_cat_ax;
}
var vert_axis = this.chart.plotArea.getVerticalAxis();
if(vert_axis && vert_axis.title)
{
var old_val_ax = this.chart.plotArea.valAx;
this.chart.plotArea.valAx = vert_axis;
var pos = this.chartObj.reCalculatePositionText("valAx", this, vert_axis.title);
vert_axis.title.setPosition(pos.x, pos.y);
this.chart.plotArea.valAx = old_val_ax;
}
}
}
if(this.chart && this.chart.legend)
if(b_recalc_legend && this.chart && this.chart.legend)
{
var pos = this.chartObj.reCalculatePositionText("legend", this, this.chart.legend);
this.chart.legend.setPosition(pos.x, pos.y);
......@@ -399,6 +425,7 @@ CChartSpace.prototype.recalculate = function()
this.recalculateWrapPolygon();
this.recalcInfo.recalculateWrapPolygon = false;
}
this.recalcInfo.axisLabels.length = 0;
this.bNeedUpdatePosition = true;
......
......@@ -5,6 +5,21 @@ CGroupShape.prototype.addToRecalculate = CShape.prototype.addToRecalculate;
CGroupShape.prototype.Get_Theme = CShape.prototype.Get_Theme;
CGroupShape.prototype.setStartPage = CShape.prototype.setStartPage;
CGroupShape.prototype.handleUpdateFill = function()
{
for(var i = 0; i < this.spTree.length; ++i)
{
this.spTree[i].handleUpdateFill();
}
};
CGroupShape.prototype.handleUpdateLn = function()
{
for(var i = 0; i < this.spTree.length; ++i)
{
this.spTree[i].handleUpdateLn();
}
};
CGroupShape.prototype.getRecalcObject = CShape.prototype.getRecalcObject;
CGroupShape.prototype.setRecalcObject = CShape.prototype.setRecalcObject;
CGroupShape.prototype.Get_ColorMap = CShape.prototype.Get_ColorMap;
......
......@@ -96,6 +96,11 @@ CGraphicObjects.prototype =
return this.selectedObjects;
},
getTheme: function()
{
return this.document.theme;
},
updateCursorType: function(pageIndex, x, y, e, bTextFlag)
{
var ret;
......@@ -2047,6 +2052,11 @@ CGraphicObjects.prototype =
if(isRealObject(ret))
{
var object = g_oTableId.Get_ById(ret.objectId);
if(isRealObject(object))
{
if(object.group)
object = object.getMainGroup();
}
if(isRealObject(object) && isRealObject(object.parent))
{
return ret.bMarker ? DRAWING_ARRAY_TYPE_BEFORE : object.parent.getDrawingArrayType();
......@@ -2379,7 +2389,18 @@ CGraphicObjects.prototype =
},
Refresh_RecalcData: function(data)
{}
{
History.RecalcData_Add({All: true});
for(var i = 0; i < this.drawingObjects.length; ++i)
{
if(this.drawingObjects[i].GraphicObj)
{
this.drawingObjects[i].GraphicObj.handleUpdateFill();
this.drawingObjects[i].GraphicObj.handleUpdateLn();
}
}
}
};
function ComparisonByZIndexSimpleParent(obj1, obj2)
......
......@@ -6528,7 +6528,7 @@ CTextPr.prototype =
this.CS = false;
this.RTL = false;
this.Lang.Init_Default();
this.Unifill = CreateUnfilFromRGB(0,0,0);
this.Unifill = undefined;//CreateUnfilFromRGB(0,0,0);
},
Set_FromObject : function(TextPr)
......
......@@ -3809,7 +3809,10 @@ asc_docs_api.prototype.put_TextColor = function(color)
if ( false === this.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Paragraph_Content) )
{
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint();
this.WordControl.m_oLogicDocument.Paragraph_Add( new ParaTextPr( { Color : { r : color.get_r(), g : color.get_g(), b : color.get_b(), Auto : color.get_auto() } } ) );
var Unifill = new CUniFill();
Unifill.fill = new CSolidFill();
Unifill.fill.color = CorrectUniColor(color, Unifill.fill.color);
this.WordControl.m_oLogicDocument.Paragraph_Add( new ParaTextPr( { Unifill : Unifill} ) );
if ( true === this.isMarkerFormat )
this.sync_MarkerFormatCallback( false );
......@@ -6121,14 +6124,14 @@ asc_docs_api.prototype.ChangeColorScheme = function(index_scheme)
{
History.TurnOff();
}
this.chartStyleManager.init();
this.chartPreviewManager.init();
//this.chartStyleManager.init();
//this.chartPreviewManager.init();
if(is_on)
{
History.TurnOn();
}
this.asc_fireCallback("asc_onUpdateChartStyles");
_changer.calculateAfterChangeTheme();
this.WordControl.m_oLogicDocument.Recalculate();
// TODO:
this.WordControl.m_oDrawingDocument.ClearCachePages();
......
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