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

git-svn-id:...

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@53347 954022d7-b5bf-4e40-9824-e11837661b57
parent 0e05e1c2
......@@ -21,12 +21,13 @@ namespace Joiner
string strRoot = strApplication + "\\OfficeWeb\\";
List<string> files = new List<string>();
files.Add("../ServerComponents/DoctRenderer/COMMON/native.js");
//files.Add("../ServerComponents/DoctRenderer/COMMON/native.js");
//files.Add("Common/3rdparty/XRegExp/xregexp-all.js");
//files.Add("../ServerComponents/DoctRenderer/COMMON/jquery_native.js");
files.Add("Common/browser.js");
files.Add("Common/3rdparty/XRegExp/xregexp-all.js");
files.Add("Excel/jquery/jquery-1.7.1.js");
files.Add("../ServerComponents/DoctRenderer/COMMON/native_xls/jquery_corrector.js");
//files.Add("Excel/jquery/jquery-1.7.1.js");
//files.Add("../ServerComponents/DoctRenderer/COMMON/native_xls/jquery_corrector.js");
files.Add("Common/editorscommon.js");
files.Add("Common/downloaderfiles.js");
......@@ -37,7 +38,7 @@ namespace Joiner
files.Add("Common/commonDefines.js");
files.Add("Common/apiCommon.js");
files.Add("../ServerComponents/DoctRenderer/COMMON/native_xls/corrector2.js");
//files.Add("../ServerComponents/DoctRenderer/COMMON/native_xls/corrector2.js");
files.Add("Common/FontsFreeType/font_engine.js");
files.Add("Common/FontsFreeType/FontFile.js");
......@@ -159,7 +160,7 @@ namespace Joiner
files.Add("Excel/model/DrawingObjects/Format/ChartTitle.js");
files.Add("Excel/model/DrawingObjects/Format/ChartLegend.js");
files.Add("../ServerComponents/DoctRenderer/COMMON/native_xls/corrector.js");
//files.Add("../ServerComponents/DoctRenderer/COMMON/native_xls/corrector.js");
StringBuilder oBuilder = new StringBuilder();
......
This diff is collapsed.
......@@ -113,6 +113,8 @@ function native_canvas()
this.id = "";
this.width = 300;
this.height = 150;
this.nodeType = 1;
}
native_canvas.prototype =
{
......@@ -170,6 +172,8 @@ _null_object.prop = function() { return this; };
_null_object.val = function() { return this; };
_null_object.remove = function() {};
window._null_object = _null_object;
document.createElement = function(type)
{
if (type && type.toLowerCase)
......@@ -201,9 +205,13 @@ document.body = _null_object;
var native = CreateNativeEngine();
window.native = native;
window["native"] = native;
window.native.v6a = window.native.GetFontBinary;
var native_renderer = null;
var _api = null;
var Asc = null;
var h = null;
function NativeOpenFile()
{
......@@ -226,33 +234,12 @@ function NativeOpenFile()
}
else
{
_api = new spreadsheet_api("", "");
_api.DocumentUrl = "TeamlabNative";
Asc = window["Asc"];
h = Asc;
Asc["editor"] = _api;
_api.User = new Asc["asc_CUser"];
_api.User.asc_setId("TM");
_api.User.asc_setUserName("native");
window.asc_wb = new Workbook(_api.DocumentUrl, _api.handlers, _api);
_api.initGlobalObjects(window.asc_wb);
_api.wbModel = window.asc_wb;
var oBinaryFileReader = new BinaryFileReader(_api.DocumentUrl);
_api = new window["Asc"]["spreadsheet_api"];
var doc_bin = window.native.GetFileString(g_file_path);
oBinaryFileReader.Read(doc_bin, window.asc_wb);
_api._coAuthoringInit();
_api.wb = new Asc["WorkbookView"](
_api.wbModel,
_api.controller,
_api.handlers,
_null_object,
_null_object,
_api,
_api.collaborativeEditing,
_api.fontRenderingMode,
_api.options);
_api.asc_nativeOpenFile(doc_bin);
}
}
......@@ -265,8 +252,7 @@ function NativeCalculateFile()
}
else
{
window.adjustPrint = new asc_CAdjustPrint();
window.printPagesData = _api.wb.calcPagesPrint(window.adjustPrint);
_api.asc_nativeCalculateFile();
}
}
......@@ -305,8 +291,7 @@ function NativeApplyChanges()
}
}
_api.CoAuthoringApi.onSaveChanges(__changes, false);
_api.collaborativeEditing.applyChanges();
_api.asc_nativeApplyChanges(__changes);
}
}
function NativeGetFileString()
......@@ -324,9 +309,7 @@ function NativeGetFileString()
}
else
{
_api.wb._initCommentsToSave();
var oBinaryFileWriter = new BinaryFileWriter(_api.wbModel);
return oBinaryFileWriter.Write();
return _api.asc_nativeGetFile();
}
}
......@@ -337,9 +320,12 @@ function GetNativeCountPages()
else if (NATIVE_DOCUMENT_TYPE == "presentation")
return window.editor.WordControl.m_oDrawingDocument.SlidesCount;
else
return 1;
return _api.asc_nativePrintPagesCount();
}
window.memory1 = null;
window.memory2 = null;
function GetNativePageBase64(pageIndex)
{
if (NATIVE_DOCUMENT_TYPE == "presentation" || NATIVE_DOCUMENT_TYPE == "document")
......@@ -376,22 +362,29 @@ function GetNativePageBase64(pageIndex)
}
else
{
if (null == window.memory1)
window.memory1 = CreateNativeMemoryStream();
else
window.memory1.ClearNoAttack();
if (null == window.memory2)
window.memory2 = CreateNativeMemoryStream();
else
window.memory2.ClearNoAttack();
// TODO:
if (native_renderer == null)
{
native_renderer = new CPdfPrinter(_api.wbModel.sUrlPath);
native_renderer.DocumentRenderer.Memory = CreateNativeMemoryStream();
native_renderer.DocumentRenderer.VectorMemoryForPrint = CreateNativeMemoryStream();
native_renderer = _api.asc_nativeCheckPdfRenderer(window.memory1, window.memory2);
}
else
{
native_renderer.DocumentRenderer.Memory.ClearNoAttack();
native_renderer.DocumentRenderer.VectorMemoryForPrint.ClearNoAttack();
window.memory1.ClearNoAttack();
window.memory2.ClearNoAttack();
}
var isEndPrint = _api.wb.printSheet(native_renderer, window.printPagesData);
return native_renderer.DocumentRenderer.Memory;
_api.asc_nativePrint(native_renderer, 0);
return window.memory1;
}
//return native_renderer.Memory.GetBase64Memory();
......
CFontFileLoader.prototype.LoadFontNative = function()
{
var __font_data_idx = g_fonts_streams.length;
var _data = window.native.GetFontBinary(this.Id);
g_fonts_streams[__font_data_idx] = new FT_Stream(_data, _data.length);
this.SetStreamIndex(__font_data_idx);
this.Status = 0;
};
BinaryFileReader.prototype.ReadNative = function(data)
{
try
{
this.stream = new FT_Stream2(data, data.length);
this.PreLoadPrepare();
this.ReadMainTable();
this.PostLoadPrepare();
}
catch(e)
{
if(e.message == g_sErrorCharCountMessage)
return false;
else
throw e;
}
return true;
};
CChartAsGroup.prototype.draw = function(graphics, pageIndex)
{
return;
};
function CCacheManager()
{
}
var NATIVE_DOCUMENT_TYPE = "spreadsheet";
var Asc = window["Asc"];
var spreadsheet_api = Asc["spreadsheet_api"];
var asc_CAdjustPrint = Asc["asc_CAdjustPrint"];
$.ready();
$.prototype.clone = function(_clone) { return _clone; };
$.prototype.clean = function() { return []; };
$.prototype.buildFragment = _return_empty_html_element;
$.prototype.init = function(selector, context, rootjQuery)
{
// Handle $(""), $(null), or $(undefined)
if ( !selector ) {
return this;
}
// Handle $(DOMElement)
if ( selector.nodeType ) {
this.context = this[0] = selector;
this.length = 1;
return this;
}
return _null_object;
};
Asc["DrawingContext"].prototype.setCanvas = function (_canvas) {
if (!_canvas)
return;
this.canvas = new Array();
this.canvas.push(_canvas);
this.ctx = this.canvas[0].getContext("2d");
if (this.ctx.mozImageSmoothingEnabled) {
this.ctx.mozImageSmoothingEnabled = false;
}
};
Asc["WorkbookView"].prototype.init = function (fontRenderingMode) {
var self = this;
var asc_DC = Asc["DrawingContext"];
var asc_CE = Asc["CellEditor"];
var asc_SR = Asc["StringRender"];
// Init font managers rendering
// c_oAscFontRenderingModeType.hintingAndSubpixeling
this.setFontRenderingMode(fontRenderingMode, /*isInit*/true);
this.canvas = new Array(); this.canvas.push(document.createElement("canvas"));
this.canvasOverlay = new Array(); this.canvasOverlay.push(document.createElement("canvas"));
this.buffers.main = asc_DC({canvas: this.canvas[0], units: 1/*pt*/,
fmgrGraphics: this.fmgrGraphics, font: this.m_oFont});
this.buffers.overlay = asc_DC({canvas: this.canvasOverlay[0], units: 1/*pt*/,
fmgrGraphics: this.fmgrGraphics, font: this.m_oFont});
this.buffers.overlay.ctx.isOverlay = true; // _activateOverlayCtx / _deactivateOverlayCtx
this.drawingCtx = this.buffers.main;
this.overlayCtx = this.buffers.overlay;
// Shapes
this.buffers.shapeCtx = new CGraphics();
this.buffers.shapeCtx.init(this.drawingCtx.ctx, this.drawingCtx.getWidth(0), this.drawingCtx.getHeight(0), this.drawingCtx.getWidth(3), this.drawingCtx.getHeight(3));
this.buffers.shapeCtx.m_oFontManager = this.fmgrGraphics[2];
this.buffers.shapeOverlayCtx = new CGraphics();
this.buffers.shapeOverlayCtx.init(this.overlayCtx.ctx, this.overlayCtx.getWidth(0), this.overlayCtx.getHeight(0), this.overlayCtx.getWidth(3), this.overlayCtx.getHeight(3));
this.buffers.shapeOverlayCtx.m_oFontManager = this.fmgrGraphics[2];
this.drawingCtxCharts = asc_DC({units: 1/*pt*/, fmgrGraphics: this.fmgrGraphics, font: this.m_oFont});
this.stringRender = asc_SR(this.buffers.main);
this.stringRender.setDefaultFont(this.defaultFont);
// 100%
this._calcMaxDigitWidth();
this.cellEditor = null;
this.clipboard.Api = this.Api;
this.clipboard.init();
return this;
};
Asc["spreadsheet_api"].prototype._loadFonts = function(_fonts, callback)
{
return callback();
};
Asc["asc_CEventsController"].prototype.reinitializeScroll = function() {};
\ No newline at end of file
var CColor = window.CColor;
\ No newline at end of file
var jQuery = window.jQuery;var $ = window.$;
\ No newline at end of file
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