Commit 012b939c authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Переделал _loadFonts для вставки, принятия изменений и выбора шрифта

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@53545 954022d7-b5bf-4e40-9824-e11837661b57
parent 7d383cfb
......@@ -1280,7 +1280,10 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
return callback();
this.asyncMethodCallback = callback;
this.FontLoader.LoadDocumentFonts2(fonts.map(function(f){return {name: f};}));
var arrLoadFonts = [];
for(var i in fonts)
arrLoadFonts.push(new CFont(i, 0, "", 0));
this.FontLoader.LoadDocumentFonts2(arrLoadFonts);
},
_startOpenDocument: function (response) {
......@@ -2609,8 +2612,10 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
},
asc_setCellFontName: function (fontName) {
var t = this;
t._loadFonts([fontName], function () {
var t = this,
fonts = {};
fonts[fontName] = 1;
t._loadFonts(fonts, function () {
var ws = t.wb.getWorksheet();
if ( ws.objectRender.selectedGraphicObjectsExists() && ws.objectRender.controller.setCellFontName )
ws.objectRender.controller.setCellFontName(fontName);
......
......@@ -2184,11 +2184,8 @@ Workbook.prototype.DeserializeHistory = function(aChanges, fCallback){
oFontMap[aFonts[j]] = 1;
}
}
var aFontMap = new Array();
for(var i in oFontMap)
aFontMap.push(i);
window["Asc"]["editor"]._loadFonts(aFontMap, function(){
window["Asc"]["editor"]._loadFonts(oFontMap, function(){
History.Clear();
History.Create_NewPoint();
History.SetSelection(null);
......
This diff is collapsed.
......@@ -10121,19 +10121,9 @@
return this.autoFilters.getAddFormatTableOptions(ar);
};
WorksheetView.prototype._loadFonts = function (fontArr, callback) {
var originFonts = [];
var i, n, k = 0;
for (i = 0; i < fontArr.length ;++i) {
for (n = 0; n < fontArr[i].length; ++n) {
if(-1 == $.inArray(fontArr[i][n], originFonts)) {
originFonts[k] = fontArr[i][n];
k++;
}
}
}
WorksheetView.prototype._loadFonts = function (fonts, callback) {
var api = window["Asc"]["editor"];
api._loadFonts(originFonts, callback);
api._loadFonts(fonts, callback);
};
/*
......
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