Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
onlyoffice_core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
onlyoffice_core
Commits
ed373b7e
Commit
ed373b7e
authored
Sep 12, 2017
by
Oleg Korshul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pivot table build on server
parent
a67eb564
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
18 deletions
+48
-18
DesktopEditor/doctrenderer/docbuilder_p.h
DesktopEditor/doctrenderer/docbuilder_p.h
+13
-2
DesktopEditor/doctrenderer/doctrenderer.cpp
DesktopEditor/doctrenderer/doctrenderer.cpp
+21
-10
DesktopEditor/doctrenderer/nativecontrol.cpp
DesktopEditor/doctrenderer/nativecontrol.cpp
+6
-0
DesktopEditor/doctrenderer/nativecontrol.h
DesktopEditor/doctrenderer/nativecontrol.h
+2
-0
DesktopEditor/doctrenderer/test/main.cpp
DesktopEditor/doctrenderer/test/main.cpp
+6
-6
No files found.
DesktopEditor/doctrenderer/docbuilder_p.h
View file @
ed373b7e
...
...
@@ -387,11 +387,22 @@ public:
CChangesWorker
oWorkerLoader
;
int
nVersion
=
oWorkerLoader
.
OpenNative
(
pNative
->
GetFilePath
());
v8
::
Handle
<
v8
::
Value
>
args_open
[
2
];
v8
::
Handle
<
v8
::
Value
>
args_open
[
3
];
args_open
[
0
]
=
oWorkerLoader
.
GetDataFull
();
args_open
[
1
]
=
v8
::
Integer
::
New
(
m_isolate
,
nVersion
);
func_open
->
Call
(
global_js
,
2
,
args_open
);
std
::
wstring
sXlsx
=
NSCommon
::
GetDirectoryName
(
pNative
->
GetFilePath
())
+
L"/Editor.xlsx"
;
if
(
NSFile
::
CFileBinary
::
Exists
(
sXlsx
))
{
std
::
string
sXlsxA
=
U_TO_UTF8
(
sXlsx
);
args_open
[
2
]
=
v8
::
String
::
NewFromUtf8
(
m_isolate
,
(
char
*
)(
sXlsxA
.
c_str
()));
}
else
{
args_open
[
2
]
=
v8
::
Undefined
(
m_isolate
);
}
func_open
->
Call
(
global_js
,
3
,
args_open
);
if
(
try_catch
.
HasCaught
())
{
...
...
DesktopEditor/doctrenderer/doctrenderer.cpp
View file @
ed373b7e
...
...
@@ -730,11 +730,22 @@ namespace NSDoctRenderer
CChangesWorker
oWorkerLoader
;
int
nVersion
=
oWorkerLoader
.
OpenNative
(
pNative
->
GetFilePath
());
v8
::
Handle
<
v8
::
Value
>
args_open
[
2
];
v8
::
Handle
<
v8
::
Value
>
args_open
[
3
];
args_open
[
0
]
=
oWorkerLoader
.
GetDataFull
();
args_open
[
1
]
=
v8
::
Integer
::
New
(
isolate
,
nVersion
);
func_open
->
Call
(
global_js
,
2
,
args_open
);
std
::
wstring
sXlsx
=
NSCommon
::
GetDirectoryName
(
pNative
->
GetFilePath
())
+
L"/Editor.xlsx"
;
if
(
NSFile
::
CFileBinary
::
Exists
(
sXlsx
))
{
std
::
string
sXlsxA
=
U_TO_UTF8
(
sXlsx
);
args_open
[
2
]
=
v8
::
String
::
NewFromUtf8
(
isolate
,
(
char
*
)(
sXlsxA
.
c_str
()));
}
else
{
args_open
[
2
]
=
v8
::
Undefined
(
isolate
);
}
func_open
->
Call
(
global_js
,
3
,
args_open
);
if
(
try_catch
.
HasCaught
())
{
...
...
DesktopEditor/doctrenderer/nativecontrol.cpp
View file @
ed373b7e
...
...
@@ -461,6 +461,12 @@ v8::Handle<v8::ObjectTemplate> CreateNativeControlTemplate(v8::Isolate* isolate)
result
->
Set
(
v8
::
String
::
NewFromUtf8
(
current
,
"ConsoleLog"
),
v8
::
FunctionTemplate
::
New
(
current
,
_ConsoleLog
));
result
->
Set
(
v8
::
String
::
NewFromUtf8
(
current
,
"ZipOpen"
),
v8
::
FunctionTemplate
::
New
(
current
,
_zipOpenFile
));
result
->
Set
(
v8
::
String
::
NewFromUtf8
(
current
,
"ZipOpenBase64"
),
v8
::
FunctionTemplate
::
New
(
current
,
_zipOpenFileBase64
));
result
->
Set
(
v8
::
String
::
NewFromUtf8
(
current
,
"ZipFileAsString"
),
v8
::
FunctionTemplate
::
New
(
current
,
_zipGetFileAsString
));
result
->
Set
(
v8
::
String
::
NewFromUtf8
(
current
,
"ZipFileAsBinary"
),
v8
::
FunctionTemplate
::
New
(
current
,
_zipGetFileAsBinary
));
result
->
Set
(
v8
::
String
::
NewFromUtf8
(
current
,
"ZipClose"
),
v8
::
FunctionTemplate
::
New
(
current
,
_zipCloseFile
));
// возвращаем временный хэндл хитрым образом, который переносит наш хэндл в предыдущий HandleScope и не дает ему
// уничтожиться при уничтожении "нашего" HandleScope - handle_scope
...
...
DesktopEditor/doctrenderer/nativecontrol.h
View file @
ed373b7e
...
...
@@ -76,6 +76,7 @@ public:
{
m_sTmpFolder
=
m_sWorkerFolder
+
L"/nativeZip"
;
COfficeUtils
oUtils
;
NSDirectory
::
CreateDirectory
(
m_sTmpFolder
);
if
(
S_OK
!=
oUtils
.
ExtractToDirectory
(
sFile
,
m_sTmpFolder
,
NULL
,
0
))
return
false
;
...
...
@@ -102,6 +103,7 @@ public:
m_sTmpFolder
=
m_sWorkerFolder
+
L"/nativeZip"
;
COfficeUtils
oUtils
;
NSDirectory
::
CreateDirectory
(
m_sTmpFolder
);
if
(
S_OK
!=
oUtils
.
ExtractToDirectory
(
sTmpFile
,
m_sTmpFolder
,
NULL
,
0
))
{
NSFile
::
CFileBinary
::
Remove
(
sTmpFile
);
...
...
DesktopEditor/doctrenderer/test/main.cpp
View file @
ed373b7e
...
...
@@ -42,15 +42,15 @@ int main(int argc, char *argv[])
#if 1
std
::
wstring
strXml
=
L"<Settings>\
<SrcFileType>
0
</SrcFileType>\
<DstFileType>
3
</DstFileType>\
<SrcFilePath>D:
\\
DE_CAD4
</SrcFilePath>\
<DstFilePath>D:
\\
DE_CAD4
\\
EditorWithChanges.bin</DstFilePath>\
<SrcFileType>
1
</SrcFileType>\
<DstFileType>
1
</DstFileType>\
<SrcFilePath>D:
\\
source
</SrcFilePath>\
<DstFilePath>D:
\\
source
\\
EditorWithChanges.bin</DstFilePath>\
<FontsDirectory>D:
\\
activex
\\
AVS
\\
Sources
\\
TeamlabOffice
\\
trunk
\\
ServerComponents
\\
DesktopEditor
\\
ChromiumBasedEditors2
\\
app
\\
test
\\
src
\\
build
\\
win64
\\
Debug
\\
Local
\\
converter
\\
fonts
\\
</FontsDirectory>\
<ImagesDirectory>D:
\\
DE_CAD4
\\
media</ImagesDirectory>\
<ImagesDirectory>D:
\\
source
\\
media</ImagesDirectory>\
<ThemesDirectory>D:
\\
activex
\\
AVS
\\
Sources
\\
TeamlabOffice
\\
trunk
\\
ServerComponents
\\
Test
\\
Applications
\\
TestAVSOfficeDocxFile2
\\
TestAVSOfficeDocxFile2
\\
bin
\\
x86
\\
presentationthemes</ThemesDirectory>\
<Changes TopItem=
\"
-1
\"
>\
<Change>D:
\\
DE_CAD4
\\
changes
\\
changes0.json</Change>\
<Change>D:
\\
source
\\
changes
\\
changes0.json</Change>\
</Changes>\
</Settings>"
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment