mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
first test
This commit is contained in:
@ -199,6 +199,10 @@ bool CV8RealTimeWorker::OpenFile(const std::wstring& sBasePath, const std::wstri
|
||||
pNative->m_strFontsDirectory = sBasePath + L"/sdkjs/common";
|
||||
pNative->m_strImagesDirectory = path + L"/media";
|
||||
|
||||
NSGraphics::CGraphics::m_sApplicationFontsDirectory = pNative->m_strFontsDirectory;
|
||||
NSGraphics::CGraphics::m_sApplicationImagesDirectory = pNative->m_strImagesDirectory;
|
||||
NSGraphics::CGraphics::m_sApplicationThemesDirectory = sBasePath + L"/sdkjs/slide/themes";
|
||||
|
||||
pNative->CheckFonts();
|
||||
|
||||
if (0 == m_nFileType)
|
||||
|
||||
@ -318,7 +318,6 @@ namespace NSDoctRenderer
|
||||
oWorker.m_bIsUseSystemFonts = bIsCheckSystemFonts;
|
||||
oWorker.m_bIsNeedThumbnails = false;
|
||||
oWorker.m_sDirectory = sDirectory;
|
||||
NSGraphics::CGraphics::m_sApplicationFontsDirectory = sDirectory;
|
||||
NSFonts::IApplicationFonts* pFonts = oWorker.Check();
|
||||
if(pFonts)
|
||||
pFonts->Release();
|
||||
|
||||
@ -635,13 +635,18 @@ namespace NSDoctRenderer
|
||||
|
||||
LOGGER_SPEED_LAP("compile")
|
||||
|
||||
context->runScript(strScript, try_catch, sCachePath);
|
||||
JSSmart<CJSValue> res = context->runScript(strScript, try_catch, sCachePath);
|
||||
if(try_catch->Check())
|
||||
{
|
||||
strError = L"code=\"run\"";
|
||||
bIsBreak = true;
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
std::string sRes = res->toStringA();
|
||||
std::cout << sRes << std::endl;
|
||||
#endif
|
||||
|
||||
LOGGER_SPEED_LAP("run")
|
||||
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@ -12,18 +12,18 @@ function CNativeGraphics(_writer)
|
||||
this.m_dDpiY = 96.0;
|
||||
this.m_bIsBreak = false;
|
||||
|
||||
this.m_oPen = new AscCommon.CPen();
|
||||
//this.m_oPen = new AscCommon.CPen();
|
||||
this.m_bPenColorInit = false;
|
||||
this.m_oBrush = new AscCommon.CBrush();
|
||||
//this.m_oBrush = new AscCommon.CBrush();
|
||||
this.m_bBrushColorInit = false;
|
||||
|
||||
this.m_oFontManager = null;
|
||||
|
||||
this.m_oCoordTransform = new AscCommon.CMatrixL();
|
||||
this.m_oBaseTransform = new AscCommon.CMatrixL();
|
||||
this.m_oTransform = new AscCommon.CMatrixL();
|
||||
this.m_oFullTransform = new AscCommon.CMatrixL();
|
||||
this.m_oInvertFullTransform = new AscCommon.CMatrixL();
|
||||
//this.m_oCoordTransform = new AscCommon.CMatrixL();
|
||||
//this.m_oBaseTransform = new AscCommon.CMatrixL();
|
||||
//this.m_oTransform = new AscCommon.CMatrixL();
|
||||
//this.m_oFullTransform = new AscCommon.CMatrixL();
|
||||
//this.m_oInvertFullTransform = new AscCommon.CMatrixL();
|
||||
|
||||
this.ArrayPoints = null;
|
||||
|
||||
@ -37,15 +37,15 @@ function CNativeGraphics(_writer)
|
||||
|
||||
// RFonts
|
||||
this.m_oTextPr = null;
|
||||
this.m_oGrFonts = new AscCommon.CGrRFonts();
|
||||
this.m_oLastFont = new AscCommon.CFontSetup();
|
||||
//this.m_oGrFonts = new AscCommon.CGrRFonts();
|
||||
//this.m_oLastFont = new AscCommon.CFontSetup();
|
||||
|
||||
this.LastFontOriginInfo = { Name : "", Replace : null };
|
||||
|
||||
this.m_bIntegerGrid = true;
|
||||
|
||||
this.ClipManager = new AscCommon.CClipManager();
|
||||
this.ClipManager.BaseObject = this;
|
||||
//this.ClipManager = new AscCommon.CClipManager();
|
||||
//this.ClipManager.BaseObject = this;
|
||||
|
||||
this.TextureFillTransformScaleX = 1;
|
||||
this.TextureFillTransformScaleY = 1;
|
||||
@ -53,8 +53,8 @@ function CNativeGraphics(_writer)
|
||||
|
||||
this.IsDemonstrationMode = false;
|
||||
|
||||
this.GrState = new AscCommon.CGrState();
|
||||
this.GrState.Parent = this;
|
||||
//this.GrState = new AscCommon.CGrState();
|
||||
//this.GrState.Parent = this;
|
||||
|
||||
this.globalAlpha = 1;
|
||||
|
||||
@ -1349,3 +1349,16 @@ CNativeGraphics.prototype =
|
||||
this.Native["DrawFootnoteRect"](x, y, w, h);
|
||||
}
|
||||
};
|
||||
|
||||
function CTest()
|
||||
{
|
||||
this.a = 10;
|
||||
}
|
||||
|
||||
CTest.prototype =
|
||||
{
|
||||
getA : function()
|
||||
{
|
||||
return this.a;
|
||||
}
|
||||
}
|
||||
|
||||
11
DesktopEditor/doctrenderer/js/test.js
Normal file
11
DesktopEditor/doctrenderer/js/test.js
Normal file
@ -0,0 +1,11 @@
|
||||
|
||||
var MyTest = new CTest(); // It's work
|
||||
// MyTest.getA(); // It's work
|
||||
|
||||
|
||||
var MyGraphics = new CNativeGraphics(null); // It's doesn't work. only works with comments
|
||||
|
||||
// var MyNativeGraphics = CreateNativeGraphics(); // It's work. This is CGraphicsEmbed::CreateObjectInContext("CreateNativeGraphics", context);
|
||||
// var MyGraphics2 = new CNativeGraphics(MyNativeGraphics); // It's doesn't work either
|
||||
|
||||
MyGraphics.GetIntegerGrid();
|
||||
Reference in New Issue
Block a user