Commit e2415348 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Поправил проверку в getFullImageSrc2 на совпадение начала ссылки

Перевел Excel на getFullImageSrc2

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@63965 954022d7-b5bf-4e40-9824-e11837661b57
parent 150a94e1
...@@ -29,32 +29,6 @@ function DrawingBounds(minX, maxX, minY, maxY) ...@@ -29,32 +29,6 @@ function DrawingBounds(minX, maxX, minY, maxY)
this.minY = minY; this.minY = minY;
this.maxY = maxY; this.maxY = maxY;
} }
function getFullImageSrc(src) {
if ( 0 != src.indexOf("http:") && 0 != src.indexOf("data:") && 0 != src.indexOf("https:") && 0 != src.indexOf("ftp:") && 0 != src.indexOf("file:") ) {
var api = window["Asc"]["editor"];
if(api)
{
if ( 0 == src.indexOf(g_sResourceServiceLocalUrl + api.documentId) )
return src;
return g_sResourceServiceLocalUrl + api.documentId + "/media/" + src;
}
else
{
if(editor)
{
if (0 == src.indexOf(editor.DocumentUrl))
return src;
return editor.DocumentUrl + "media/" + src;
}
else
{
return src;
}
}
}
else
return src;
}
function getCurrentTime() { function getCurrentTime() {
var currDate = new Date(); var currDate = new Date();
...@@ -956,7 +930,7 @@ function DrawingObjects() { ...@@ -956,7 +930,7 @@ function DrawingObjects() {
for(i = 0; i < aImagesSync.length; ++i) for(i = 0; i < aImagesSync.length; ++i)
{ {
aImagesSync[i] = getFullImageSrc(aImagesSync[i]); aImagesSync[i] = getFullImageSrc2(aImagesSync[i]);
} }
// Загружаем все картинки листа // Загружаем все картинки листа
...@@ -2620,7 +2594,7 @@ function DrawingObjects() { ...@@ -2620,7 +2594,7 @@ function DrawingObjects() {
var imageUrl = selectedObjects[0].getImageUrl(); var imageUrl = selectedObjects[0].getImageUrl();
var _image = api.ImageLoader.map_image_index[getFullImageSrc(imageUrl)]; var _image = api.ImageLoader.map_image_index[getFullImageSrc2(imageUrl)];
if (_image != undefined && _image.Image != null && _image.Status == ImageLoadStatus.Complete) { if (_image != undefined && _image.Image != null && _image.Status == ImageLoadStatus.Complete) {
var _w = 1, _h = 1; var _w = 1, _h = 1;
......
...@@ -91,7 +91,7 @@ function CBinaryFileWriter() ...@@ -91,7 +91,7 @@ function CBinaryFileWriter()
this.Start_UseDocumentOrigin = function(origin) this.Start_UseDocumentOrigin = function(origin)
{ {
this.PresentationThemesOrigin = origin + "/presentationthemes/"; this.PresentationThemesOrigin = origin + "/presentationthemes/";
} };
this.End_UseFullUrl = function() this.End_UseFullUrl = function()
{ {
......
...@@ -197,8 +197,8 @@ function getFullImageSrc2 (src) { ...@@ -197,8 +197,8 @@ function getFullImageSrc2 (src) {
return themesUrl + src; return themesUrl + src;
if (0 !== start.indexOf('http:') && 0 !== start.indexOf('data:') && 0 !== start.indexOf('https:') && if (0 !== start.indexOf('http:') && 0 !== start.indexOf('data:') && 0 !== start.indexOf('https:') &&
0 !== start.indexOf('file:') && 0 !== start.indexOf('ftp:') && 0 !== start.indexOf(documentUrl) && 0 !== start.indexOf('file:') && 0 !== start.indexOf('ftp:') && 0 !== src.indexOf(documentUrl) &&
0 !== start.indexOf(themesUrl)) 0 !== src.indexOf(themesUrl))
return documentUrl + 'media/' + src; return documentUrl + 'media/' + src;
return src; return src;
} }
......
...@@ -2254,7 +2254,7 @@ function CDrawingDocument(drawingObjects) ...@@ -2254,7 +2254,7 @@ function CDrawingDocument(drawingObjects)
var _len = _imgs.length; var _len = _imgs.length;
for (var j = 0; j < _len; j++) for (var j = 0; j < _len; j++)
{ {
if (getFullImageSrc(_imgs[j]) == src) if (getFullImageSrc2(_imgs[j]) == src)
{ {
this.StopRenderingPage(i); this.StopRenderingPage(i);
bIsRaster = true; bIsRaster = true;
...@@ -4317,7 +4317,7 @@ function CDrawingDocument(drawingObjects) ...@@ -4317,7 +4317,7 @@ function CDrawingDocument(drawingObjects)
return; return;
var api = window["Asc"]["editor"]; var api = window["Asc"]["editor"];
var _img = api.ImageLoader.map_image_index[getFullImageSrc(this.LastDrawingUrl)]; var _img = api.ImageLoader.map_image_index[getFullImageSrc2(this.LastDrawingUrl)];
if (_img != undefined && _img.Image != null && _img.Status != ImageLoadStatus.Loading) if (_img != undefined && _img.Image != null && _img.Status != ImageLoadStatus.Loading)
{ {
var _x = 0; var _x = 0;
......
...@@ -51,13 +51,7 @@ ...@@ -51,13 +51,7 @@
for (var id in _images) for (var id in _images)
{ {
/* this.images_loading[this.images_loading.length] = getFullImageSrc2(_images[id]);
if (isUrl === false)
this.images_loading[this.images_loading.length] = _images[id];
else
this.images_loading[this.images_loading.length] = getFullImageSrc(_images[id]);
*/
this.images_loading[this.images_loading.length] = getFullImageSrc(_images[id]);
} }
if (!this.bIsAsyncLoadDocumentImages) if (!this.bIsAsyncLoadDocumentImages)
......
...@@ -828,11 +828,11 @@ CShapeDrawer.prototype = ...@@ -828,11 +828,11 @@ CShapeDrawer.prototype =
{ {
if (null == this.UniFill.fill.tile || this.Graphics.m_oContext === undefined) if (null == this.UniFill.fill.tile || this.Graphics.m_oContext === undefined)
{ {
this.Graphics.put_brushTexture(getFullImageSrc(this.UniFill.fill.RasterImageId), 0); this.Graphics.put_brushTexture(getFullImageSrc2(this.UniFill.fill.RasterImageId), 0);
} }
else else
{ {
this.Graphics.put_brushTexture(getFullImageSrc(this.UniFill.fill.RasterImageId), 1); this.Graphics.put_brushTexture(getFullImageSrc2(this.UniFill.fill.RasterImageId), 1);
} }
if (bIsIntegerGridTRUE) if (bIsIntegerGridTRUE)
...@@ -861,13 +861,13 @@ CShapeDrawer.prototype = ...@@ -861,13 +861,13 @@ CShapeDrawer.prototype =
if ((null == this.UniFill.transparent) || (this.UniFill.transparent == 255)) if ((null == this.UniFill.transparent) || (this.UniFill.transparent == 255))
{ {
this.Graphics.drawImage(getFullImageSrc(this.UniFill.fill.RasterImageId), this.min_x, this.min_y, (this.max_x - this.min_x), (this.max_y - this.min_y), undefined, this.UniFill.fill.srcRect, this.UniFill.fill.canvas); this.Graphics.drawImage(getFullImageSrc2(this.UniFill.fill.RasterImageId), this.min_x, this.min_y, (this.max_x - this.min_x), (this.max_y - this.min_y), undefined, this.UniFill.fill.srcRect, this.UniFill.fill.canvas);
} }
else else
{ {
var _old_global_alpha = this.Graphics.m_oContext.globalAlpha; var _old_global_alpha = this.Graphics.m_oContext.globalAlpha;
this.Graphics.m_oContext.globalAlpha = this.UniFill.transparent / 255; this.Graphics.m_oContext.globalAlpha = this.UniFill.transparent / 255;
this.Graphics.drawImage(getFullImageSrc(this.UniFill.fill.RasterImageId), this.min_x, this.min_y, (this.max_x - this.min_x), (this.max_y - this.min_y), undefined, this.UniFill.fill.srcRect, this.UniFill.fill.canvas); this.Graphics.drawImage(getFullImageSrc2(this.UniFill.fill.RasterImageId), this.min_x, this.min_y, (this.max_x - this.min_x), (this.max_y - this.min_y), undefined, this.UniFill.fill.srcRect, this.UniFill.fill.canvas);
this.Graphics.m_oContext.globalAlpha = _old_global_alpha; this.Graphics.m_oContext.globalAlpha = _old_global_alpha;
} }
} }
...@@ -878,13 +878,13 @@ CShapeDrawer.prototype = ...@@ -878,13 +878,13 @@ CShapeDrawer.prototype =
if (this.Graphics.IsNoSupportTextDraw == true || true == this.Graphics.IsTrack || (null == this.UniFill.transparent) || (this.UniFill.transparent == 255)) if (this.Graphics.IsNoSupportTextDraw == true || true == this.Graphics.IsTrack || (null == this.UniFill.transparent) || (this.UniFill.transparent == 255))
{ {
this.Graphics.drawImage(getFullImageSrc(this.UniFill.fill.RasterImageId), this.min_x, this.min_y, (this.max_x - this.min_x), (this.max_y - this.min_y), undefined, this.UniFill.fill.srcRect, this.UniFill.fill.canvas); this.Graphics.drawImage(getFullImageSrc2(this.UniFill.fill.RasterImageId), this.min_x, this.min_y, (this.max_x - this.min_x), (this.max_y - this.min_y), undefined, this.UniFill.fill.srcRect, this.UniFill.fill.canvas);
} }
else else
{ {
var _old_global_alpha = this.Graphics.m_oContext.globalAlpha; var _old_global_alpha = this.Graphics.m_oContext.globalAlpha;
this.Graphics.m_oContext.globalAlpha = this.UniFill.transparent / 255; this.Graphics.m_oContext.globalAlpha = this.UniFill.transparent / 255;
this.Graphics.drawImage(getFullImageSrc(this.UniFill.fill.RasterImageId), this.min_x, this.min_y, (this.max_x - this.min_x), (this.max_y - this.min_y), undefined, this.UniFill.fill.srcRect, this.UniFill.fill.canvas); this.Graphics.drawImage(getFullImageSrc2(this.UniFill.fill.RasterImageId), this.min_x, this.min_y, (this.max_x - this.min_x), (this.max_y - this.min_y), undefined, this.UniFill.fill.srcRect, this.UniFill.fill.canvas);
this.Graphics.m_oContext.globalAlpha = _old_global_alpha; this.Graphics.m_oContext.globalAlpha = _old_global_alpha;
} }
...@@ -894,7 +894,7 @@ CShapeDrawer.prototype = ...@@ -894,7 +894,7 @@ CShapeDrawer.prototype =
else else
{ {
var editor = window["Asc"]["editor"]; var editor = window["Asc"]["editor"];
var _img = editor.ImageLoader.map_image_index[getFullImageSrc(this.UniFill.fill.RasterImageId)]; var _img = editor.ImageLoader.map_image_index[getFullImageSrc2(this.UniFill.fill.RasterImageId)];
var _img_native = this.UniFill.fill.canvas; var _img_native = this.UniFill.fill.canvas;
if ((!_img_native) && (_img == undefined || _img.Image == null || _img.Status == ImageLoadStatus.Loading)) if ((!_img_native) && (_img == undefined || _img.Image == null || _img.Status == ImageLoadStatus.Loading))
{ {
...@@ -903,13 +903,13 @@ CShapeDrawer.prototype = ...@@ -903,13 +903,13 @@ CShapeDrawer.prototype =
if (this.Graphics.IsNoSupportTextDraw === true || true == this.Graphics.IsTrack || (null == this.UniFill.transparent) || (this.UniFill.transparent == 255)) if (this.Graphics.IsNoSupportTextDraw === true || true == this.Graphics.IsTrack || (null == this.UniFill.transparent) || (this.UniFill.transparent == 255))
{ {
this.Graphics.drawImage(getFullImageSrc(this.UniFill.fill.RasterImageId), this.min_x, this.min_y, (this.max_x - this.min_x), (this.max_y - this.min_y)); this.Graphics.drawImage(getFullImageSrc2(this.UniFill.fill.RasterImageId), this.min_x, this.min_y, (this.max_x - this.min_x), (this.max_y - this.min_y));
} }
else else
{ {
var _old_global_alpha = this.Graphics.m_oContext.globalAlpha; var _old_global_alpha = this.Graphics.m_oContext.globalAlpha;
this.Graphics.m_oContext.globalAlpha = this.UniFill.transparent / 255; this.Graphics.m_oContext.globalAlpha = this.UniFill.transparent / 255;
this.Graphics.drawImage(getFullImageSrc(this.UniFill.fill.RasterImageId), this.min_x, this.min_y, (this.max_x - this.min_x), (this.max_y - this.min_y)); this.Graphics.drawImage(getFullImageSrc2(this.UniFill.fill.RasterImageId), this.min_x, this.min_y, (this.max_x - this.min_x), (this.max_y - this.min_y));
this.Graphics.m_oContext.globalAlpha = _old_global_alpha; this.Graphics.m_oContext.globalAlpha = _old_global_alpha;
} }
...@@ -1342,21 +1342,7 @@ CShapeDrawer.prototype = ...@@ -1342,21 +1342,7 @@ CShapeDrawer.prototype =
{ {
if (this.UniFill.fill.RasterImageId && this.UniFill.fill.RasterImageId.indexOf(".svg") != 0) if (this.UniFill.fill.RasterImageId && this.UniFill.fill.RasterImageId.indexOf(".svg") != 0)
{ {
/* this.Graphics.put_brushTexture(getFullImageSrc2(this.UniFill.fill.RasterImageId), 0);
this.Graphics.SaveGrState();
this.Graphics.StartClipPath();
this.Graphics.EndClipPath();
this.Graphics.drawImage(getFullImageSrc(this.UniFill.fill.RasterImageId), this.min_x, this.min_y, (this.max_x - this.min_x), (this.max_y - this.min_y), undefined, undefined);
bIsFill = false;
// это чтобы слипы были не пустые - и отменились при восстановлении
var _histClip = new CHist_Clip();
this.Graphics.GrState.Clips.push(_histClip);
this.Graphics.RestoreGrState();
*/
this.Graphics.put_brushTexture(getFullImageSrc(this.UniFill.fill.RasterImageId), 0);
} }
else else
{ {
...@@ -1366,28 +1352,13 @@ CShapeDrawer.prototype = ...@@ -1366,28 +1352,13 @@ CShapeDrawer.prototype =
} }
else else
{ {
this.Graphics.put_brushTexture(getFullImageSrc(this.UniFill.fill.RasterImageId), 0); this.Graphics.put_brushTexture(getFullImageSrc2(this.UniFill.fill.RasterImageId), 0);
} }
} }
} }
else else
{ {
/* this.Graphics.drawImage(getFullImageSrc2(this.UniFill.fill.RasterImageId), this.min_x, this.min_y, (this.max_x - this.min_x), (this.max_y - this.min_y), undefined, this.UniFill.fill.srcRect);
this.Graphics.SaveGrState();
this.Graphics.StartClipPath();
this.Graphics.EndClipPath();
this.Graphics.drawImage(getFullImageSrc(this.UniFill.fill.RasterImageId), this.min_x, this.min_y, (this.max_x - this.min_x), (this.max_y - this.min_y), undefined, this.UniFill.fill.srcRect);
bIsFill = false;
// это чтобы слипы были не пустые - и отменились при восстановлении
var _histClip = new CHist_Clip();
this.Graphics.GrState.Clips.push(_histClip);
this.Graphics.RestoreGrState();
*/
this.Graphics.drawImage(getFullImageSrc(this.UniFill.fill.RasterImageId), this.min_x, this.min_y, (this.max_x - this.min_x), (this.max_y - this.min_y), undefined, this.UniFill.fill.srcRect);
bIsFill = false; bIsFill = false;
} }
} }
...@@ -1399,7 +1370,7 @@ CShapeDrawer.prototype = ...@@ -1399,7 +1370,7 @@ CShapeDrawer.prototype =
} }
else else
{ {
this.Graphics.put_brushTexture(getFullImageSrc(this.UniFill.fill.RasterImageId), 1); this.Graphics.put_brushTexture(getFullImageSrc2(this.UniFill.fill.RasterImageId), 1);
} }
} }
this.Graphics.put_BrushTextureAlpha(this.UniFill.transparent); this.Graphics.put_BrushTextureAlpha(this.UniFill.transparent);
...@@ -1905,7 +1876,7 @@ function ShapeToImageConverter(shape, pageIndex) ...@@ -1905,7 +1876,7 @@ function ShapeToImageConverter(shape, pageIndex)
catch (err) catch (err)
{ {
if (shape.brush != null && shape.brush.fill && shape.brush.fill.RasterImageId) if (shape.brush != null && shape.brush.fill && shape.brush.fill.RasterImageId)
_ret.ImageUrl = getFullImageSrc(shape.brush.fill.RasterImageId); _ret.ImageUrl = getFullImageSrc2(shape.brush.fill.RasterImageId);
else else
_ret.ImageUrl = ""; _ret.ImageUrl = "";
} }
......
...@@ -3127,7 +3127,7 @@ ...@@ -3127,7 +3127,7 @@
if(isImage) if(isImage)
imageUrl = cloneImg.graphicObject.getImageUrl(); imageUrl = cloneImg.graphicObject.getImageUrl();
if(isImage && imageUrl) if(isImage && imageUrl)
url = getFullImageSrc(imageUrl); url = getFullImageSrc2(imageUrl);
else else
url = cloneImg.graphicObject.getBase64Img(); url = cloneImg.graphicObject.getBase64Img();
curImage.alt = altAttr; curImage.alt = altAttr;
......
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