Commit a61fe9f2 authored by Sergey Luzyanin's avatar Sergey Luzyanin Committed by GitHub

Merge pull request #47 from ONLYOFFICE/release/v4.1.0

Release/v4.1.0
parents 609004ce fada8909
......@@ -3225,8 +3225,30 @@ var editor;
return true;
};
spreadsheet_api.prototype.asc_Recalculate = function () {
History.EndTransaction();
this._onUpdateAfterApplyChanges();
History.EndTransaction();
this._onUpdateAfterApplyChanges();
};
spreadsheet_api.prototype.pre_Paste = function(_fonts, _images, callback)
{
var oFontMap = {};
for(var i = 0; i < _fonts.length; ++i){
oFontMap[_fonts[i].name] = 1;
}
this._loadFonts(oFontMap, function() {
var aImages = [];
for(var key in _images){
if(_images.hasOwnProperty(key)){
aImages.push(_images[key])
}
}
if(aImages.length > 0) {
window["Asc"]["editor"].ImageLoader.LoadDocumentImages(aImages, null);
}
callback();
});
};
spreadsheet_api.prototype._onEndLoadSdk = function() {
......
......@@ -1590,7 +1590,7 @@ CShapeDrawer.prototype =
if (_max_delta > 0.001)
{
this.Graphics.ArrayPoints = null;
DrawLineEnd(_x1, _y1, _x2, _y2, this.Ln.headEnd.type, this.Ln.headEnd.GetWidth(_pen_w, 7 / g_dKoef_mm_to_pix), this.Ln.headEnd.GetLen(_pen_w, 7 / g_dKoef_mm_to_pix), this, trans1);
DrawLineEnd(_x1, _y1, _x2, _y2, this.Ln.headEnd.type, this.Ln.headEnd.GetWidth(_pen_w, 7 / AscCommon.g_dKoef_mm_to_pix), this.Ln.headEnd.GetLen(_pen_w, 7 / AscCommon.g_dKoef_mm_to_pix), this, trans1);
this.Graphics.ArrayPoints = arr;
}
}
......@@ -1616,7 +1616,7 @@ CShapeDrawer.prototype =
if (_max_delta > 0.001)
{
this.Graphics.ArrayPoints = null;
DrawLineEnd(_x1, _y1, _x2, _y2, this.Ln.tailEnd.type, this.Ln.tailEnd.GetWidth(_pen_w, 7 / g_dKoef_mm_to_pix), this.Ln.tailEnd.GetLen(_pen_w, 7 / g_dKoef_mm_to_pix), this, trans1);
DrawLineEnd(_x1, _y1, _x2, _y2, this.Ln.tailEnd.type, this.Ln.tailEnd.GetWidth(_pen_w, 7 / AscCommon.g_dKoef_mm_to_pix), this.Ln.tailEnd.GetLen(_pen_w, 7 / AscCommon.g_dKoef_mm_to_pix), this, trans1);
this.Graphics.ArrayPoints = arr;
}
}
......
......@@ -2507,6 +2507,18 @@ Workbook.prototype.generateFontMap2=function(){
aRes.push(new AscFonts.CFont(i, 0, "", 0));
return aRes;
};
Workbook.prototype.getAllImageUrls = function(){
var aImageUrls = [];
for(var i = 0; i < this.aWorksheets.length; ++i){
this.aWorksheets[i].getAllImageUrls(aImageUrls);
}
return aImageUrls;
};
Workbook.prototype.reassignImageUrls = function(oImages){
for(var i = 0; i < this.aWorksheets.length; ++i){
this.aWorksheets[i].reassignImageUrls(oImages);
}
};
Workbook.prototype.recalcWB = function(isRecalcWB){
//todo
if ( this.dependencyFormulas.getNodesLength() > 0 ) {
......@@ -3408,6 +3420,16 @@ Woorksheet.prototype.generateFontMap=function(oFontMap){
}
}
};
Woorksheet.prototype.getAllImageUrls = function(aImages){
for(var i = 0; i < this.Drawings.length; ++i){
this.Drawings[i].graphicObject.getAllRasterImages(aImages);
}
};
Woorksheet.prototype.reassignImageUrls = function(oImages){
for(var i = 0; i < this.Drawings.length; ++i){
this.Drawings[i].graphicObject.Reassign_ImageUrls(oImages);
}
};
Woorksheet.prototype.clone=function(sNewId, sName, tableNames){
var i, elem, range;
var oNewWs = new Woorksheet(this.workbook, this.workbook.aWorksheets.length, sNewId);
......
......@@ -3589,7 +3589,7 @@
var sSrc = oGraphicObj.getBase64Img();
if(sSrc.length > 0)
{
sRes += "<img style=\"max-width:100%;\" width=\""+Math.round(ParaItem.Extent.W * g_dKoef_mm_to_pix)+"\" height=\""+Math.round(ParaItem.Extent.H * g_dKoef_mm_to_pix)+"\" src=\""+sSrc+"\" />";
sRes += "<img style=\"max-width:100%;\" width=\""+Math.round(ParaItem.Extent.W * AscCommon.g_dKoef_mm_to_pix)+"\" height=\""+Math.round(ParaItem.Extent.H * AscCommon.g_dKoef_mm_to_pix)+"\" src=\""+sSrc+"\" />";
break;
}
// var _canvas = document.createElement('canvas');
......
......@@ -306,7 +306,7 @@
};
Range.prototype.isOneCell = function () {
return this.r1 == this.r2 && this.c1 == this.c2;
return this.r1 === this.r2 && this.c1 === this.c2;
};
Range.prototype.union = function (range) {
......
This diff is collapsed.
......@@ -1021,6 +1021,9 @@
baseEditorsApi.prototype.onKeyUp = function(e)
{
};
baseEditorsApi.prototype.pre_Paste = function(_fonts, _images, callback)
{
};
// System input
baseEditorsApi.prototype.SetTextBoxInputMode = function(bIsEnable)
......
......@@ -1053,6 +1053,7 @@
prot = c_oAscAdvancedOptionsID;
prot['CSV'] = prot.CSV;
prot['TXT'] = prot.TXT;
prot['DRM'] = prot.DRM;
window['Asc']['c_oAscFontRenderingModeType'] = window['Asc'].c_oAscFontRenderingModeType = c_oAscFontRenderingModeType;
prot = c_oAscFontRenderingModeType;
prot['noHinting'] = prot.noHinting;
......
......@@ -440,7 +440,21 @@
}
else if (AscCommon.c_oEditorId.Spreadsheet === editorId)
{
window.g_asc_plugins.api.asc_Recalculate();
var oApi = window.g_asc_plugins.api;
var oFonts = oApi.wbModel._generateFontMap();
var aImages = oApi.wbModel.getAllImageUrls();
var oImages = {};
for (var i = 0; i < aImages.length; i++)
{
oImages[aImages[i]] = aImages[i];
}
window.g_asc_plugins.images_rename = oImages;
AscCommon.Check_LoadingDataBeforePrepaste(window.g_asc_plugins.api, oFonts, oImages,
function(){
oApi.wbModel.reassignImageUrls(window.g_asc_plugins.images_rename);
delete window.g_asc_plugins.images_rename;
window.g_asc_plugins.api.asc_Recalculate();
});
}
}
}
......
......@@ -1590,7 +1590,7 @@ CShapeDrawer.prototype =
if (_max_delta > 0.001)
{
this.Graphics.ArrayPoints = null;
DrawLineEnd(_x1, _y1, _x2, _y2, this.Ln.headEnd.type, this.Ln.headEnd.GetWidth(_pen_w, 7 / g_dKoef_mm_to_pix), this.Ln.headEnd.GetLen(_pen_w, 7 / g_dKoef_mm_to_pix), this, trans1);
DrawLineEnd(_x1, _y1, _x2, _y2, this.Ln.headEnd.type, this.Ln.headEnd.GetWidth(_pen_w, 7 / AscCommon.g_dKoef_mm_to_pix), this.Ln.headEnd.GetLen(_pen_w, 7 / AscCommon.g_dKoef_mm_to_pix), this, trans1);
this.Graphics.ArrayPoints = arr;
}
}
......@@ -1616,7 +1616,7 @@ CShapeDrawer.prototype =
if (_max_delta > 0.001)
{
this.Graphics.ArrayPoints = null;
DrawLineEnd(_x1, _y1, _x2, _y2, this.Ln.tailEnd.type, this.Ln.tailEnd.GetWidth(_pen_w, 7 / g_dKoef_mm_to_pix), this.Ln.tailEnd.GetLen(_pen_w, 7 / g_dKoef_mm_to_pix), this, trans1);
DrawLineEnd(_x1, _y1, _x2, _y2, this.Ln.tailEnd.type, this.Ln.tailEnd.GetWidth(_pen_w, 7 / AscCommon.g_dKoef_mm_to_pix), this.Ln.tailEnd.GetLen(_pen_w, 7 / AscCommon.g_dKoef_mm_to_pix), this, trans1);
this.Graphics.ArrayPoints = arr;
}
}
......
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