Commit 6a836f34 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@60420 954022d7-b5bf-4e40-9824-e11837661b57
parent a52cdfb4
......@@ -336,8 +336,14 @@ CPresentation.prototype =
for(var i = 0; i < this.Slides.length; ++i)
{
ret.layouts[this.Slides[i].Layout.Id] = this.Slides[i].Layout;
ret.masters[this.Slides[i].Layout.Master.Id] = this.Slides[i].Layout.Master;
if(this.Slides[i].Layout)
{
ret.layouts[this.Slides[i].Layout.Id] = this.Slides[i].Layout;
if(this.Slides[i].Layout.Master)
{
ret.masters[this.Slides[i].Layout.Master.Id] = this.Slides[i].Layout.Master;
}
}
}
return ret;
},
......@@ -3788,7 +3794,17 @@ CPresentation.prototype =
}
this.clearThemeTimeouts();
this.addSlideMaster(this.slideMasters.length, themeInfo.Master);
for(i = 0; i < this.slideMasters.length; ++i)
{
if(this.slideMasters[i] === themeInfo.Master)
{
break;
}
}
if(i === this.slideMasters.length)
{
this.addSlideMaster(this.slideMasters.length, themeInfo.Master);
}
var _new_master = themeInfo.Master;
_new_master.presentation = this;
var _master_width = _new_master.Width;
......
......@@ -3801,24 +3801,27 @@ asc_docs_api.prototype.OpenDocumentEndCallback = function()
var _masters = this.WordControl.m_oLogicDocument.slideMasters;
for (var i = 0; i < _masters.length; i++)
{
var theme_load_info = new CThemeLoadInfo();
theme_load_info.Master = _masters[i];
theme_load_info.Theme = _masters[i].Theme;
if(_masters[i].ThemeIndex < 0)//только темы презентации
{
var theme_load_info = new CThemeLoadInfo();
theme_load_info.Master = _masters[i];
theme_load_info.Theme = _masters[i].Theme;
var _lay_cnt = _masters[i].sldLayoutLst.length;
for (var j = 0; j < _lay_cnt; j++)
theme_load_info.Layouts[j] = _masters[i].sldLayoutLst[j];
var _lay_cnt = _masters[i].sldLayoutLst.length;
for (var j = 0; j < _lay_cnt; j++)
theme_load_info.Layouts[j] = _masters[i].sldLayoutLst[j];
var th_info = {};
th_info["Name"] = "Doc Theme " + i;
th_info["Url"] = "";
th_info["Thumbnail"] = _masters[i].ImageBase64;
var th_info = {};
th_info["Name"] = "Doc Theme " + i;
th_info["Url"] = "";
th_info["Thumbnail"] = _masters[i].ImageBase64;
var th = new CAscThemeInfo(th_info);
this.ThemeLoader.Themes.DocumentThemes[this.ThemeLoader.Themes.DocumentThemes.length] = th;
th.Index = -this.ThemeLoader.Themes.DocumentThemes.length;
var th = new CAscThemeInfo(th_info);
this.ThemeLoader.Themes.DocumentThemes[this.ThemeLoader.Themes.DocumentThemes.length] = th;
th.Index = -this.ThemeLoader.Themes.DocumentThemes.length;
this.ThemeLoader.themes_info_document[this.ThemeLoader.Themes.DocumentThemes.length - 1] = theme_load_info;
this.ThemeLoader.themes_info_document[this.ThemeLoader.Themes.DocumentThemes.length - 1] = theme_load_info;
}
}
this.sync_InitEditorThemes(this.ThemeLoader.Themes.EditorThemes, this.ThemeLoader.Themes.DocumentThemes);
......
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