Commit c51cd598 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@58508 954022d7-b5bf-4e40-9824-e11837661b57
parent e44128d7
......@@ -676,6 +676,7 @@ var historyitem_SlideLayoutSetShowPhAnim = 2652;
var historyitem_SlideLayoutSetShowMasterSp = 2653;
var historyitem_SlideLayoutSetClrMapOverride = 2654;
var historyitem_SlideLayoutAddToSpTree = 2655;
var historyitem_SlideLayoutSetSize = 2656;
var historyitem_SlideMasterAddToSpTree = 2656;
var historyitem_SlideMasterSetTheme = 2657;
......@@ -684,6 +685,8 @@ var historyitem_SlideMasterSetTxStyles = 2659;
var historyitem_SlideMasterSetCSldName = 2660;
var historyitem_SlideMasterSetClrMapOverride = 2661;
var historyitem_SlideMasterAddLayout = 2662;
var historyitem_SlideMasterSetThemeIndex = 2663;
var historyitem_SlideMasterSetSize = 2664;
var historyitem_ThemeSetColorScheme = 2663;
var historyitem_ThemeSetFontScheme = 2664;
......
......@@ -496,8 +496,7 @@ function BinaryPPTYLoader()
for (var i = 0; i < _sm_count; i++)
{
this.presentation.slideMasters[i] = this.ReadSlideMaster();
this.presentation.slideMasters[i].Width = this.presentation.Width;
this.presentation.slideMasters[i].Height = this.presentation.Height;
this.presentation.slideMasters[i].setSlideSize(this.presentation.Width, this.presentation.Height);
}
}
......
......@@ -26,7 +26,7 @@ function CThemeLoader()
this.CurrentLoadThemeIndex = -1;
this.ThemesUrl = "";
this.IsReloadBinaryThemeEditor = true;
this.IsReloadBinaryThemeEditor = false;
this.IsReloadBinaryThemeEditorNow = false;
var oThis = this;
......@@ -118,7 +118,7 @@ function CThemeLoader()
_loader.Load(g_th, pres);
for(var i = 0; i < pres.slideMasters.length; ++i)
{
pres.slideMasters[i].ThemeIndex = oThis.CurrentLoadThemeIndex;
pres.slideMasters[i].setThemeIndex(oThis.CurrentLoadThemeIndex);
}
History.MinorChanges = false;
......
......@@ -13,9 +13,12 @@ DrawingObjectsController.prototype.getDrawingArray = function()
DrawingObjectsController.prototype.checkSelectedObjectsAndCallback = function(callback, args)
{
History.Create_NewPoint();
callback.apply(this, args);
this.startRecalculate();
if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false)
{
History.Create_NewPoint();
callback.apply(this, args);
this.startRecalculate();
}
};
DrawingObjectsController.prototype.startRecalculate = function()
{
......
......@@ -88,6 +88,7 @@ CGraphicFrame.prototype =
this.graphicObject.RecalcInfo.Reset(true);
}
this.recalcInfo.recalculateTable = true;
this.recalcInfo.recalculateSizes = true;
},
Get_TextBackGroundColor: function()
......@@ -643,13 +644,19 @@ CGraphicFrame.prototype =
{
if(this.graphicObject.Is_TableBorder( tx, ty, 0))
{
History.Create_NewPoint();
if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false)
{
History.Create_NewPoint();
}
else
{
return;
}
}
}
this.graphicObject.Selection_SetStart(tx, ty, 0, e);
this.graphicObject.RecalculateCurPos();
return
return;
}
},
......
......@@ -56,6 +56,12 @@ SlideLayout.prototype =
{
switch (data.Type)
{
case historyitem_SlideLayoutSetSize:
{
this.Width = data.oldW;
this.Height = data.oldH;
break;
}
case historyitem_SlideLayoutSetMaster :
{
this.Master = data.oldPr;
......@@ -113,6 +119,12 @@ SlideLayout.prototype =
{
switch (data.Type)
{
case historyitem_SlideLayoutSetSize:
{
this.Width = data.newW;
this.Height = data.newH;
break;
}
case historyitem_SlideLayoutSetMaster :
{
this.Master = data.newPr;
......@@ -172,6 +184,12 @@ SlideLayout.prototype =
w.WriteLong(data.Type);
switch (data.Type)
{
case historyitem_SlideLayoutSetSize:
{
writeDouble(w, data.newW);
writeDouble(w, data.newH);
break;
}
case historyitem_SlideLayoutSetMaster :
case historyitem_SlideLayoutSetClrMapOverride:
{
......@@ -215,6 +233,12 @@ SlideLayout.prototype =
var type = r.GetLong();
switch (type)
{
case historyitem_SlideLayoutSetSize:
{
this.Width = readDouble(r);
this.Height = readDouble(r);
break;
}
case historyitem_SlideLayoutSetMaster :
{
this.Master = readObject(r);
......@@ -364,51 +388,20 @@ SlideLayout.prototype =
},
changeSize: function(kw, kh)
setSlideSize: function(w, h)
{
this.Width *= kw;
this.Height *= kh;
for(var i = 0; i < this.cSld.spTree.length; ++i)
{
this.cSld.spTree[i].changeSize(kw, kh);
}
History.Add(this, {Type: historyitem_SlideLayoutSetSize, oldW: this.Width, oldH: this.Height, newW: w, newH: h});
this.Width = w;
this.Height = h;
},
changeSize: Slide.prototype.changeSize,
Get_Id: function()
{
return this.Id;
},
setSize: function(width, height)
{
var _k_h = height/this.Height;
var _k_w = width/this.Width;
this.Width = width;
this.Height = height;
var _graphic_objects = this.cSld.spTree;
var _objects_count = _graphic_objects.length;
var _object_index;
for(_object_index = 0; _object_index < _objects_count; ++_object_index)
{
_graphic_objects[_object_index].updateProportions(_k_w, _k_h);
}
},
calculateColors: function()
{
var _shapes = this.cSld.spTree;
var _shapes_count = _shapes.length;
var _shape_index;
for(_shape_index = 0; _shape_index < _shapes_count; ++_shape_index)
{
if(_shapes[_shape_index].calculateColors)
{
_shapes[_shape_index].calculateColors();
}
}
},
draw: function(graphics)
{
for(var i=0; i < this.cSld.spTree.length; ++i)
......
......@@ -2184,17 +2184,35 @@ CPresentation.prototype =
var graphic_objects = this.Slides[this.CurPage].graphicObjects;
var target_content = graphic_objects.getTargetDocContent(), drawing_props = graphic_objects.getDrawingProps(), i;
var para_pr = graphic_objects.getParagraphParaPr(), text_pr = graphic_objects.getParagraphTextPr();
var flag = undefined;
if(!para_pr)
{
para_pr = new CParaPr();
flag = true;
}
if(!text_pr)
{
text_pr = new CTextPr();
}
var theme = graphic_objects.getTheme();
if(text_pr.RFonts)
{
if(text_pr.RFonts.Ascii)
text_pr.RFonts.Ascii.Name = theme.themeElements.fontScheme.checkFont(text_pr.RFonts.Ascii.Name);
if(text_pr.RFonts.EastAsia)
text_pr.RFonts.EastAsia.Name = theme.themeElements.fontScheme.checkFont(text_pr.RFonts.EastAsia.Name);
if(text_pr.RFonts.HAnsi)
text_pr.RFonts.HAnsi.Name = theme.themeElements.fontScheme.checkFont(text_pr.RFonts.HAnsi.Name);
if(text_pr.RFonts.CS)
text_pr.RFonts.CS.Name = theme.themeElements.fontScheme.checkFont(text_pr.RFonts.CS.Name);
}
if(text_pr.FontFamily)
{
text_pr.FontFamily.Name = theme.themeElements.fontScheme.checkFont(text_pr.FontFamily.Name);
}
if(!target_content)
{
editor.UpdateParagraphProp( para_pr );
editor.UpdateParagraphProp( para_pr, flag );
editor.sync_PrLineSpacingCallBack(para_pr.Spacing);
//if(selected_objects.length === 1 )
//{
......@@ -2228,7 +2246,7 @@ CPresentation.prototype =
{
if(para_pr)
{
editor.UpdateParagraphProp( para_pr );
editor.UpdateParagraphProp( para_pr, flag );
editor.sync_PrLineSpacingCallBack(para_pr.Spacing);
//if(selected_objects.length === 1 )
......@@ -2239,18 +2257,6 @@ CPresentation.prototype =
}
if(text_pr)
{
if(text_pr.RFonts)
{
var theme = graphic_objects.getTheme();
if(text_pr.RFonts.Ascii)
text_pr.RFonts.Ascii.Name = theme.themeElements.fontScheme.checkFont(text_pr.RFonts.Ascii.Name);
if(text_pr.RFonts.EastAsia)
text_pr.RFonts.EastAsia.Name = theme.themeElements.fontScheme.checkFont(text_pr.RFonts.EastAsia.Name);
if(text_pr.RFonts.HAnsi)
text_pr.RFonts.HAnsi.Name = theme.themeElements.fontScheme.checkFont(text_pr.RFonts.HAnsi.Name);
if(text_pr.RFonts.CS)
text_pr.RFonts.CS.Name = theme.themeElements.fontScheme.checkFont(text_pr.RFonts.CS.Name);
}
editor.UpdateTextPr(text_pr);
}
}
......
......@@ -81,21 +81,6 @@ Slide.prototype =
return editor.WordControl.m_oLogicDocument.DrawingDocument;
},
//---------------------
setSize: function(width, height)
{
var _k_h = height/this.Height;
var _k_w = width/this.Width;
this.Width = width;
this.Height = height;
var _graphic_objects = this.cSld.spTree;
var _objects_count = _graphic_objects.length;
var _object_index;
for(_object_index = 0; _object_index < _objects_count; ++_object_index)
{
_graphic_objects[_object_index].updateProportions(_k_w, _k_h);
}
},
getMatchingShape: function(type, idx, bSingleBody)
{
......@@ -772,8 +757,7 @@ Slide.prototype =
changeSize: function(kw, kh)
{
this.Width *= kw;
this.Height *= kh;
this.setSlideSize(this.Width*kw, this.Height*kh);
for(var i = 0; i < this.cSld.spTree.length; ++i)
{
this.cSld.spTree[i].changeSize(kw, kh);
......
......@@ -66,10 +66,27 @@ MasterSlide.prototype =
return historyitem_type_SlideMaster;
},
setThemeIndex: function(index)
{
History.Add(this, {Type: historyitem_SlideMasterSetThemeIndex, oldPr: this.ThemeIndex, newPr: index});
this.ThemeIndex = index;
},
Undo: function(data)
{
switch(data.Type)
{
case historyitem_SlideMasterSetSize:
{
this.Width = data.oldW;
this.Height = data.oldH;
break;
}
case historyitem_SlideMasterSetThemeIndex:
{
this.ThemeIndex = data.oldPr;
break;
}
case historyitem_SlideMasterAddToSpTree:
{
this.cSld.spTree.splice(data.Pos, 1);
......@@ -112,6 +129,17 @@ MasterSlide.prototype =
{
switch(data.Type)
{
case historyitem_SlideMasterSetSize:
{
this.Width = data.newW;
this.Height = data.newH;
break;
}
case historyitem_SlideMasterSetThemeIndex:
{
this.ThemeIndex = data.newPr;
break;
}
case historyitem_SlideMasterAddToSpTree:
{
this.cSld.spTree.splice(data.Pos, 0, data.Item);
......@@ -168,6 +196,12 @@ MasterSlide.prototype =
w.WriteLong(data.Type);
switch(data.Type)
{
case historyitem_SlideMasterSetSize:
{
writeDouble(w, data.newW);
writeDouble(w, data.newH);
break;
}
case historyitem_SlideMasterAddToSpTree:
case historyitem_SlideMasterAddLayout :
{
......@@ -193,6 +227,11 @@ MasterSlide.prototype =
writeObject(w, data.newPr);
break;
}
case historyitem_SlideMasterSetThemeIndex:
{
writeLong(w, data.newPr);
break;
}
}
},
......@@ -201,6 +240,12 @@ MasterSlide.prototype =
var type = r.GetLong();
switch(type)
{
case historyitem_SlideMasterSetSize:
{
this.Width = readDouble(r);
this.Height = readDouble(r);
break;
}
case historyitem_SlideMasterAddToSpTree:
{
var Pos = readLong(r);
......@@ -262,6 +307,25 @@ MasterSlide.prototype =
this.sldLayoutLst.splice(Pos, 0, Item);
break;
}
case historyitem_SlideMasterSetThemeIndex:
{
this.ThemeIndex = readLong(r);
if (isRealNumber(this.ThemeIndex) && editor && editor.ThemeLoader)
{
var theme_loader = editor.ThemeLoader;
var theme_load_info = new CThemeLoadInfo();
theme_load_info.Master = this;
theme_load_info.Theme = this.Theme;
var _lay_cnt = this.sldLayoutLst.length;
for (var i = 0; i < _lay_cnt; i++)
theme_load_info.Layouts[i] = this.sldLayoutLst[i];
theme_loader.themes_info_editor[this.ThemeIndex] = theme_load_info;
}
break;
}
}
},
......@@ -274,42 +338,7 @@ MasterSlide.prototype =
}
},
setSize: function(width, height)
{
var _k_h = height/this.Height;
var _k_w = width/this.Width;
this.Width = width;
this.Height = height;
var _graphic_objects = this.cSld.spTree;
var _objects_count = _graphic_objects.length;
var _object_index;
for(_object_index = 0; _object_index < _objects_count; ++_object_index)
{
_graphic_objects[_object_index].updateProportions(_k_w, _k_h);
}
var _layouts = this.sldLayoutLst;
var _layout_count = _layouts.length;
var _layout_index;
for(_layout_index = 0; _layout_index < _layout_count; ++_layout_index)
{
_layouts[_layout_index].setSize(width, height);
}
},
calculateColors: function()
{
var _shapes = this.cSld.spTree;
var _shapes_count = _shapes.length;
var _shape_index;
for(_shape_index = 0; _shape_index < _shapes_count; ++_shape_index)
{
if(_shapes[_shape_index].calculateColors)
{
_shapes[_shape_index].calculateColors();
}
}
},
getMatchingLayout: function(type, matchingName, cSldName, themeFlag)
{
......@@ -559,16 +588,15 @@ MasterSlide.prototype =
}
},
changeSize: function(kw, kh)
setSlideSize: function(w, h)
{
this.Width *= kw;
this.Height *= kh;
for(var i = 0; i < this.cSld.spTree.length; ++i)
{
this.cSld.spTree[i].changeSize(kw, kh);
}
History.Add(this, {Type: historyitem_SlideMasterSetSize, oldW: this.Width, oldH: this.Height, newW: w, newH: h});
this.Width = w;
this.Height = h;
},
changeSize: Slide.prototype.changeSize,
setTheme: function(theme)
{
History.Add(this, {Type: historyitem_SlideMasterSetTheme, oldPr: this.Theme, newPr: theme});
......
......@@ -1268,7 +1268,7 @@ asc_docs_api.prototype.sync_VerticalTextAlign = function(align)
this.asc_fireCallback("asc_onVerticalTextAlign", align);
}
asc_docs_api.prototype.UpdateParagraphProp = function(ParaPr){
asc_docs_api.prototype.UpdateParagraphProp = function(ParaPr, bParaPr){
ParaPr.StyleName = "";
var TextPr = editor.WordControl.m_oLogicDocument.Get_Paragraph_TextPr();
......@@ -1367,7 +1367,8 @@ asc_docs_api.prototype.UpdateParagraphProp = function(ParaPr){
this.sync_PrAlignCallBack(ParaPr.Jc);
this.sync_ParaStyleName(ParaPr.StyleName);
this.sync_ListType(ParaPr.ListType);
this.sync_PrPropCallback(ParaPr);
if(!(bParaPr === true))
this.sync_PrPropCallback(ParaPr);
}
/*----------------------------------------------------------------*/
/*functions for working with clipboard, document*/
......
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