Commit ce0170c8 authored by Igor.Zotov's avatar Igor.Zotov Committed by Alexander.Trofimov

http://bugzserver/show_bug.cgi?id=24555 - Ошибка в консоли при копировании текста в автофигуре

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56992 954022d7-b5bf-4e40-9824-e11837661b57
parent 76eb15da
......@@ -3903,26 +3903,8 @@ PasteProcessor.prototype =
if(true == this.bUploadImage || true == this.bUploadFonts)
{
//����������� �� ��������� �������� ������ ������� � ��������.
this._Prepeare_recursive(node, true);
var aPrepeareFonts = [];
for(var font_family in this.oFonts)
{
//todo ��������� �����, ������ �� ��������
var oFontItem = this.oFonts[font_family];
//���� ����� ����� �������
var index = this.map_font_index[oFontItem.Name];
if(null != index)
{
this.oFonts[font_family].Index = index;
aPrepeareFonts.push(new CFont(oFontItem.Name, 0, "", 0));
}
else
{
this.oFonts[font_family] = {Name:"Arial", Index: -1};
aPrepeareFonts.push(new CFont("Arial", 0, "", 0));
}
}
var aPrepeareFonts = this._Prepeare_recursive(node, true, true);
var aImagesToDownload = [];
for(var image in this.oImages)
{
......@@ -3956,7 +3938,7 @@ PasteProcessor.prototype =
else
fCallback();
},
_Prepeare_recursive : function(node, bIgnoreStyle)
_Prepeare_recursive : function(node, bIgnoreStyle, isCheckFonts)
{
//����������� �� ����� ������, �������� ��� ������ � ��������
var nodeName = node.nodeName.toLowerCase();
......@@ -4131,6 +4113,30 @@ PasteProcessor.prototype =
}
this._Prepeare_recursive(child, false);
}
if(isCheckFonts)
{
var aPrepeareFonts = [];
for(var font_family in this.oFonts)
{
//todo ��������� �����, ������ �� ��������
var oFontItem = this.oFonts[font_family];
//���� ����� ����� �������
var index = this.map_font_index[oFontItem.Name];
if(null != index)
{
this.oFonts[font_family].Index = index;
aPrepeareFonts.push(new CFont(oFontItem.Name, 0, "", 0));
}
else
{
this.oFonts[font_family] = {Name:"Arial", Index: -1};
aPrepeareFonts.push(new CFont("Arial", 0, "", 0));
}
};
return aPrepeareFonts;
};
},
_IsBlockElem : function(name)
{
......
......@@ -1709,12 +1709,14 @@
targetDocContent.DrawingDocument.m_oLogicDocument = null;
var oPasteProcessor = new PasteProcessor({WordControl:{m_oLogicDocument: targetDocContent}, FontLoader: {}}, false, false, true, true);
oPasteProcessor.map_font_index = this.Api.FontLoader.map_font_index;
var newFonts;
if(onlyFromLocalStorage)
node = this.lStorage.htmlInShape ? this.lStorage.htmlInShape : this.lStorage;
oPasteProcessor._Prepeare_recursive(node, true);
oPasteProcessor._Prepeare_recursive(node, true, true);
oPasteProcessor.aContent = [];
......@@ -1727,7 +1729,8 @@
if(!oPasteProcessor.aContent || !oPasteProcessor.aContent.length)
return false;
worksheet._loadFonts(newFonts, function () {
worksheet._loadFonts(newFonts, function () {
History.Create_NewPoint();
oPasteProcessor.InsertInPlace(targetDocContent , oPasteProcessor.aContent);
worksheet.objectRender.controller.startRecalculate();
......
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