Commit 3bd84a77 authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander.Trofimov

native

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@53225 954022d7-b5bf-4e40-9824-e11837661b57
parent cbbb09f2
...@@ -5,6 +5,9 @@ var bIsLocalFontsUse = false; ...@@ -5,6 +5,9 @@ var bIsLocalFontsUse = false;
function _is_support_cors() function _is_support_cors()
{ {
if (window.NATIVE_EDITOR_ENJINE === true)
return false;
var xhrSupported = new XMLHttpRequest(); var xhrSupported = new XMLHttpRequest();
return !!xhrSupported && ("withCredentials" in xhrSupported); return !!xhrSupported && ("withCredentials" in xhrSupported);
} }
...@@ -741,17 +744,27 @@ CFontInfo.prototype = ...@@ -741,17 +744,27 @@ CFontInfo.prototype =
else else
fontfile = font_loader.fontFiles[index]; fontfile = font_loader.fontFiles[index];
if (fontfile.Status != 0 && (this.Type == FONT_TYPE_STANDART || this.Type == FONT_TYPE_ADDITIONAL) && if (window.NATIVE_EDITOR_ENJINE === undefined)
null != _embedded_cur.map_name_cutindex && undefined !== _embedded_cur.map_name_cutindex[this.Name])
{ {
// нормальный шрифт пока не подгрузился... берем обрезанный if (fontfile.Status != 0 && (this.Type == FONT_TYPE_STANDART || this.Type == FONT_TYPE_ADDITIONAL) &&
var _font_info = _embedded_cur.map_name_cutindex[this.Name]; null != _embedded_cur.map_name_cutindex && undefined !== _embedded_cur.map_name_cutindex[this.Name])
if (_font_info !== undefined)
{ {
return _font_info.LoadFont(window.g_font_loader, fontManager, fEmSize, lStyle, dHorDpi, dVerDpi, transform); // нормальный шрифт пока не подгрузился... берем обрезанный
var _font_info = _embedded_cur.map_name_cutindex[this.Name];
if (_font_info !== undefined)
{
return _font_info.LoadFont(window.g_font_loader, fontManager, fEmSize, lStyle, dHorDpi, dVerDpi, transform);
}
} }
} }
else
{
if (fontfile.Status != 0)
{
fontfile.LoadFontNative();
}
}
var _ext = ""; var _ext = "";
if (bNeedBold) if (bNeedBold)
......
...@@ -1154,12 +1154,21 @@ CMetafile.prototype = ...@@ -1154,12 +1154,21 @@ CMetafile.prototype =
this.Memory.WriteDouble(h); this.Memory.WriteDouble(h);
return; return;
} }
var _src = "";
if (!window.native)
{
var _img = window.editor.ImageLoader.map_image_index[img];
if (_img == undefined || _img.Image == null)
return;
var _img = window.editor.ImageLoader.map_image_index[img]; _src = _img.src;
if (_img == undefined || _img.Image == null) }
return; else
{
_src = img;
}
var _src = _img.src;
var _search = window.editor.DocumentUrl; var _search = window.editor.DocumentUrl;
if (0 == _src.indexOf(_search)) if (0 == _src.indexOf(_search))
_src = _src.substring(_search.length); _src = _src.substring(_search.length);
...@@ -1311,7 +1320,7 @@ CMetafile.prototype = ...@@ -1311,7 +1320,7 @@ CMetafile.prototype =
if (_lastFont.Index == -1 || _lastFont.Index === undefined) if (_lastFont.Index == -1 || _lastFont.Index === undefined)
{ {
_lastFont.Index = g_map_font_index[_lastFont.Name]; _lastFont.Index = window.g_map_font_index[_lastFont.Name];
} }
_lastFont.Size = this.m_oTextPr.FontSize; _lastFont.Size = this.m_oTextPr.FontSize;
...@@ -1327,7 +1336,7 @@ CMetafile.prototype = ...@@ -1327,7 +1336,7 @@ CMetafile.prototype =
if (_lastFont.Index == -1 || _lastFont.Index === undefined) if (_lastFont.Index == -1 || _lastFont.Index === undefined)
{ {
_lastFont.Index = g_map_font_index[_lastFont.Name]; _lastFont.Index = window.g_map_font_index[_lastFont.Name];
} }
_lastFont.Size = this.m_oTextPr.FontSizeCS; _lastFont.Size = this.m_oTextPr.FontSizeCS;
...@@ -1343,7 +1352,7 @@ CMetafile.prototype = ...@@ -1343,7 +1352,7 @@ CMetafile.prototype =
if (_lastFont.Index == -1 || _lastFont.Index === undefined) if (_lastFont.Index == -1 || _lastFont.Index === undefined)
{ {
_lastFont.Index = g_map_font_index[_lastFont.Name]; _lastFont.Index = window.g_map_font_index[_lastFont.Name];
} }
_lastFont.Size = this.m_oTextPr.FontSize; _lastFont.Size = this.m_oTextPr.FontSize;
...@@ -1360,7 +1369,7 @@ CMetafile.prototype = ...@@ -1360,7 +1369,7 @@ CMetafile.prototype =
if (_lastFont.Index == -1 || _lastFont.Index === undefined) if (_lastFont.Index == -1 || _lastFont.Index === undefined)
{ {
_lastFont.Index = g_map_font_index[_lastFont.Name]; _lastFont.Index = window.g_map_font_index[_lastFont.Name];
} }
_lastFont.Size = this.m_oTextPr.FontSize; _lastFont.Size = this.m_oTextPr.FontSize;
...@@ -1592,6 +1601,9 @@ CDocumentRenderer.prototype = ...@@ -1592,6 +1601,9 @@ CDocumentRenderer.prototype =
// images // images
drawImage : function(img,x,y,w,h,alpha,srcRect) drawImage : function(img,x,y,w,h,alpha,srcRect)
{ {
if (img == null || img == undefined || img == "")
return;
if (0 != this.m_lPagesCount) if (0 != this.m_lPagesCount)
{ {
if (!srcRect) if (!srcRect)
...@@ -1906,6 +1918,9 @@ CDocumentRenderer.prototype = ...@@ -1906,6 +1918,9 @@ CDocumentRenderer.prototype =
}, },
put_brushTexture : function(src, mode) put_brushTexture : function(src, mode)
{ {
if (src == null || src == undefined)
src = "";
if (0 != this.m_lPagesCount) if (0 != this.m_lPagesCount)
this.m_arrayPages[this.m_lPagesCount - 1].put_brushTexture(src, mode); this.m_arrayPages[this.m_lPagesCount - 1].put_brushTexture(src, mode);
}, },
......
...@@ -1355,6 +1355,12 @@ CDocument.prototype = ...@@ -1355,6 +1355,12 @@ CDocument.prototype =
this.FullRecalc.PageIndex = _PageIndex; this.FullRecalc.PageIndex = _PageIndex;
this.FullRecalc.Start = _bStart; this.FullRecalc.Start = _bStart;
this.FullRecalc.StartIndex = _StartIndex; this.FullRecalc.StartIndex = _StartIndex;
if (window.NATIVE_EDITOR_ENJINE_SYNC_RECALC === true)
{
this.Recalculate_Page( _PageIndex, _bStart, _StartIndex );
return;
}
//this.Recalculate_Page( _PageIndex, _bStart, _StartIndex ); //this.Recalculate_Page( _PageIndex, _bStart, _StartIndex );
......
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