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

правка бага 21428 - Не применяется цветовая схема к теме презентации

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@50830 954022d7-b5bf-4e40-9824-e11837661b57
parent 3023c36a
...@@ -3538,7 +3538,6 @@ function CTheme() ...@@ -3538,7 +3538,6 @@ function CTheme()
this.Undo = function(data) this.Undo = function(data)
{ {
return;
switch(data.Type) switch(data.Type)
{ {
case historyitem_ChangeColorScheme: case historyitem_ChangeColorScheme:
...@@ -3558,11 +3557,26 @@ function CTheme() ...@@ -3558,11 +3557,26 @@ function CTheme()
break; break;
} }
} }
var _slides = editor.WordControl.m_oLogicDocument.Slides;
var _slide_count = _slides.length;
for(var _slide_index = 0; _slide_index < _slide_count; ++_slide_index)
{
_cur_slide =_slides[_slide_index];
_cur_theme = _cur_slide.Layout.Master.Theme;
if(_cur_theme === this)
{
_cur_slide.recalcAllColors();
_cur_slide.Layout.recalcAll();
_cur_slide.Layout.Master.recalcAll();
editor.WordControl.m_oLogicDocument.recalcMap[_cur_slide.Id] = _cur_slide;
editor.WordControl.m_oLogicDocument.recalcMap[_cur_slide.Layout.Id] = _cur_slide.Layout;
editor.WordControl.m_oLogicDocument.recalcMap[_cur_slide.Layout.Master.Id] = _cur_slide.Layout.Master;
}
}
}; };
this.Redo = function(data) this.Redo = function(data)
{ {
return;
switch(data.Type) switch(data.Type)
{ {
case historyitem_ChangeColorScheme: case historyitem_ChangeColorScheme:
...@@ -3582,6 +3596,23 @@ function CTheme() ...@@ -3582,6 +3596,23 @@ function CTheme()
break; break;
} }
} }
var _slides = editor.WordControl.m_oLogicDocument.Slides;
var _slide_count = _slides.length;
for(var _slide_index = 0; _slide_index < _slide_count; ++_slide_index)
{
_cur_slide =_slides[_slide_index];
_cur_theme = _cur_slide.Layout.Master.Theme;
if(_cur_theme === this)
{
_cur_slide.recalcAllColors();
_cur_slide.Layout.recalcAll();
_cur_slide.Layout.Master.recalcAll();
editor.WordControl.m_oLogicDocument.recalcMap[_cur_slide.Id] = _cur_slide;
editor.WordControl.m_oLogicDocument.recalcMap[_cur_slide.Layout.Id] = _cur_slide.Layout;
editor.WordControl.m_oLogicDocument.recalcMap[_cur_slide.Layout.Master.Id] = _cur_slide.Layout.Master;
}
}
}; };
this.Write_ToBinary2 = function(w) this.Write_ToBinary2 = function(w)
...@@ -3622,13 +3653,20 @@ function CTheme() ...@@ -3622,13 +3653,20 @@ function CTheme()
{ {
this.themeElements.clrScheme = new ClrScheme(); this.themeElements.clrScheme = new ClrScheme();
this.themeElements.clrScheme.Read_FromBinary2(r); this.themeElements.clrScheme.Read_FromBinary2(r);
var slides = editor.WordControl.m_oLogicDocument.Slides; var _slides = editor.WordControl.m_oLogicDocument.Slides;
for(var i = 0; i < slides.length; ++i) var _slide_count = _slides.length;
for(var _slide_index = 0; _slide_index < _slide_count; ++_slide_index)
{ {
var slide = slides[i]; _cur_slide =_slides[_slide_index];
if(slide.Layout && slide.Layout.Master && slide.Layout.Master.Theme === this) _cur_theme = _cur_slide.Layout.Master.Theme;
if(_cur_theme === this)
{ {
slide.recalcAllColors(); _cur_slide.recalcAllColors();
_cur_slide.Layout.recalcAll();
_cur_slide.Layout.Master.recalcAll();
editor.WordControl.m_oLogicDocument.recalcMap[_cur_slide.Id] = _cur_slide;
editor.WordControl.m_oLogicDocument.recalcMap[_cur_slide.Layout.Id] = _cur_slide.Layout;
editor.WordControl.m_oLogicDocument.recalcMap[_cur_slide.Layout.Master.Id] = _cur_slide.Layout.Master;
} }
} }
break; break;
...@@ -3637,13 +3675,20 @@ function CTheme() ...@@ -3637,13 +3675,20 @@ function CTheme()
{ {
this.themeElements.fontScheme = new FontScheme(); this.themeElements.fontScheme = new FontScheme();
this.themeElements.fontScheme.Read_FromBinary2(r); this.themeElements.fontScheme.Read_FromBinary2(r);
var slides = editor.WordControl.m_oLogicDocument.Slides; var _slides = editor.WordControl.m_oLogicDocument.Slides;
for(var i = 0; i < slides.length; ++i) var _slide_count = _slides.length;
for(var _slide_index = 0; _slide_index < _slide_count; ++_slide_index)
{ {
var slide = slides[i]; _cur_slide =_slides[_slide_index];
if(slide.Layout && slide.Layout.Master && slide.Layout.Master.Theme === this) _cur_theme = _cur_slide.Layout.Master.Theme;
if(_cur_theme === this)
{ {
slide.recalcAllColors(); _cur_slide.recalcAllColors();
_cur_slide.Layout.recalcAll();
_cur_slide.Layout.Master.recalcAll();
editor.WordControl.m_oLogicDocument.recalcMap[_cur_slide.Id] = _cur_slide;
editor.WordControl.m_oLogicDocument.recalcMap[_cur_slide.Layout.Id] = _cur_slide.Layout;
editor.WordControl.m_oLogicDocument.recalcMap[_cur_slide.Layout.Master.Id] = _cur_slide.Layout.Master;
} }
} }
break; break;
...@@ -3652,13 +3697,20 @@ function CTheme() ...@@ -3652,13 +3697,20 @@ function CTheme()
{ {
this.themeElements.fmtScheme = new FmtScheme(); this.themeElements.fmtScheme = new FmtScheme();
this.themeElements.fmtScheme.Read_FromBinary2(r); this.themeElements.fmtScheme.Read_FromBinary2(r);
var slides = editor.WordControl.m_oLogicDocument.Slides; var _slides = editor.WordControl.m_oLogicDocument.Slides;
for(var i = 0; i < slides.length; ++i) var _slide_count = _slides.length;
{ for(var _slide_index = 0; _slide_index < _slide_count; ++_slide_index)
var slide = slides[i]; {
if(slide.Layout && slide.Layout.Master && slide.Layout.Master.Theme === this) _cur_slide =_slides[_slide_index];
{ _cur_theme = _cur_slide.Layout.Master.Theme;
slide.recalcAllColors(); if(_cur_theme === this)
{
_cur_slide.recalcAllColors();
_cur_slide.Layout.recalcAll();
_cur_slide.Layout.Master.recalcAll();
editor.WordControl.m_oLogicDocument.recalcMap[_cur_slide.Id] = _cur_slide;
editor.WordControl.m_oLogicDocument.recalcMap[_cur_slide.Layout.Id] = _cur_slide.Layout;
editor.WordControl.m_oLogicDocument.recalcMap[_cur_slide.Layout.Master.Id] = _cur_slide.Layout.Master;
} }
} }
break; break;
......
...@@ -6149,26 +6149,29 @@ CPresentation.prototype = ...@@ -6149,26 +6149,29 @@ CPresentation.prototype =
var _cur_slide; var _cur_slide;
var _cur_theme; var _cur_theme;
var _old_color_scheme; var _old_color_scheme;
var recalc_map = {};
for(_slide_index = 0; _slide_index < _slide_count; ++_slide_index) for(_slide_index = 0; _slide_index < _slide_count; ++_slide_index)
{ {
_cur_slide =_slides[_slide_index]; _cur_slide =_slides[_slide_index];
_cur_theme = _cur_slide.Layout.Master.Theme; _cur_theme = _cur_slide.Layout.Master.Theme;
recalc_map[_cur_slide.Layout.Id] = _cur_slide.Layout;
recalc_map[_cur_slide.Layout.Master.Id] = _cur_slide.Layout.Master;
if(!_cur_theme.themeElements.clrScheme.isIdentical(colorScheme)) if(!_cur_theme.themeElements.clrScheme.isIdentical(colorScheme))
{ {
_old_color_scheme = _cur_theme.themeElements.clrScheme; _old_color_scheme = _cur_theme.themeElements.clrScheme;
_cur_theme.changeColorScheme(colorScheme.createDuplicate()); _cur_theme.changeColorScheme(colorScheme.createDuplicate());
} }
} }
for(_slide_index = 0; _slide_index < _slide_count; ++_slide_index) for(var key in recalc_map)
{ {
_cur_slide =_slides[_slide_index]; if(recalc_map[key].recalcAll)
_cur_theme = _cur_slide.Layout.Master.Theme;
if(!_cur_theme.themeElements.clrScheme.isIdentical(colorScheme))
{ {
_old_color_scheme = _cur_theme.themeElements.clrScheme; recalc_map[key].recalcAll();
_cur_theme.changeColorScheme(colorScheme.createDuplicate()); }
if(recalc_map[key].recalculate)
{
recalc_map[key].recalculate();
} }
} }
var _start_slide = this.Slides[this.CurPage]; var _start_slide = this.Slides[this.CurPage];
......
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