Commit 8ddf9879 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin

правка бага 22108 - [Copy&Paste] Слайд с текстом с измененным шрифтом...

правка бага  22108 - [Copy&Paste] Слайд с текстом с измененным шрифтом копируется в другую презентацию не корректно

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@51742 954022d7-b5bf-4e40-9824-e11837661b57
parent b4e82db6
......@@ -3420,14 +3420,15 @@ PasteProcessor.prototype =
var p_height = stream.GetULong()/100000;
var kw = presentation.Width/p_width;
var kh = presentation.Height/p_height;
var fonts = [];
switch(first_string)
{
case "TeamLab1":
{
var shape = this.ReadPresentationText(stream);
var fonts = [];
var font_map = {};
var images = [];
shape.getAllFonts(fonts);
shape.getAllFonts(font_map);
if(shape.getAllImages)
shape.getAllImages(images);
var presentation = editor.WordControl.m_oLogicDocument;
......@@ -3485,6 +3486,9 @@ PasteProcessor.prototype =
var w = shape.txBody.getRectWidth(presentation.Width*2/3);
var h = shape.txBody.getRectHeight(2000, w);
shape.setXfrm((presentation.Width - w)/2, (presentation.Height - h)/2, w, h, null, null, null);
shape.getAllFonts(font_map);
for(var i in font_map)
fonts.push(new CFont(i, 0, "", 0));
editor.WordControl.m_oLogicDocument.recalcMap[shape.Id] = shape;
}
break;
......@@ -3508,12 +3512,12 @@ PasteProcessor.prototype =
var arr_shapes = objects.arrShapes;
var presentation = editor.WordControl.m_oLogicDocument;
oThis = this;
var fonts = [];
var font_map = {};
var images = [];
for(var i = 0; i < arr_shapes.length; ++i)
{
if(arr_shapes[i].getAllFonts)
arr_shapes[i].getAllFonts(fonts);
arr_shapes[i].getAllFonts(font_map);
if(arr_shapes[i].getAllImages)
arr_shapes[i].getAllImages(images);
}
......@@ -3562,6 +3566,8 @@ PasteProcessor.prototype =
}
}
for(var i in font_map)
fonts.push(new CFont(i, 0, "", 0));
var aImagesToDownload = [];
for(var i in oImagesToDownload)
aImagesToDownload.push(i);
......@@ -3752,15 +3758,25 @@ PasteProcessor.prototype =
var presentation = editor.WordControl.m_oLogicDocument;
oThis = this;
var fonts = [];
var font_map = {};
var images = [];
for(var i = 0; i < arr_slides.length; ++i)
{
if(arr_slides[i].getAllFonts)
arr_slides[i].getAllFonts(fonts);
arr_slides[i].getAllFonts(font_map);
if(arr_slides[i].getAllImages)
arr_slides[i].getAllImages(images);
}
for(var i = 0; i < arr_layouts.length; ++i)
{
if(arr_layouts[i].getAllFonts)
arr_layouts[i].getAllFonts(font_map);
if(arr_layouts[i].getAllImages)
arr_layouts[i].getAllImages(images);
}
for(var i in font_map)
fonts.push(new CFont(i, 0, "", 0));
var paste_callback = function()
{
if(false == oThis.bNested)
......
......@@ -1233,6 +1233,7 @@ CSolidFill.prototype =
Write_ToBinary2 : function(Writer)
{
Writer.WriteLong(this.type);
this.color.Write_ToBinary2(Writer);
},
......
......@@ -61,8 +61,22 @@ function CChartAsGroup(parent)
CChartAsGroup.prototype =
{
getAllFonts: function()
{},
getAllFonts: function(fonts)
{
fonts["Calibri"] = true;
if(this.chartTitle && this.chartTitle.txBody && this.chartTitle.txBody.content)
{
this.chartTitle.txBody.content.Document_Get_AllFontNames(fonts);
}
if(this.hAxisTitle && this.hAxisTitle.txBody && this.hAxisTitle.txBody.content)
{
this.hAxisTitle.txBody.content.Document_Get_AllFontNames(fonts);
}
if(this.vAxisTitle && this.vAxisTitle.txBody && this.vAxisTitle.txBody.content)
{
this.vAxisTitle.txBody.content.Document_Get_AllFontNames(fonts);
}
},
getSearchResults: function()
{
......@@ -2139,6 +2153,8 @@ CChartAsGroup.prototype =
this.recalculate();
},
copy: function(parent, group)
{
var _group = isRealObject(group) ? group : null;
......
......@@ -69,6 +69,22 @@ CGraphicFrame.prototype =
return sp;
},
getAllFonts: function(fonts)
{
if(this.graphicObject)
{
for(var i = 0; i < this.graphicObject.Content.length; ++i)
{
var row = this.graphicObject.Content[i];
var cells = row.Content;
for(var j = 0; j < cells.length;++j)
{
cells[j].Content.Document_Get_AllFontNames(fonts);
}
}
}
},
isSimpleObject: function()
{
return true;
......
......@@ -853,6 +853,14 @@ SlideLayout.prototype =
this.Id = r.GetString2();
},
getAllFonts: function(fonts)
{
for(var i = 0; i < this.cSld.spTree.length; ++i)
{
if(typeof this.cSld.spTree[i].getAllFonts === "function")
this.cSld.spTree[i].getAllFonts(fonts);
}
},
Refresh_RecalcData: function()
......
......@@ -713,6 +713,14 @@ MasterSlide.prototype =
this.Id = r.GetString2();
},
getAllFonts: function(fonts)
{
for(var i = 0; i < this.cSld.spTree.length; ++i)
{
if(typeof this.cSld.spTree[i].getAllFonts === "function")
this.cSld.spTree[i].getAllFonts(fonts);
}
},
Save_Changes: function(data, w)
{
w.WriteLong(data.Type);
......
......@@ -5099,6 +5099,7 @@ CTextPr.prototype =
Flags |= 2097152;
}
//Writer.WriteString2("tets");
Writer.WriteBool(isRealObject(this.unifill));
if(isRealObject(this.unifill))
{
......@@ -5307,6 +5308,10 @@ CTextPr.prototype =
if ( undefined != this.RFonts.CS )
AllFonts[this.RFonts.CS.Name] = true;
if(this.FontFamily && typeof this.FontFamily.Name === "string")
{
AllFonts[this.FontFamily.Name] = true;
}
},
Document_CreateFontMap : function(FontMap)
......
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