Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
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
sdkjs
Commits
1e2fcf55
Commit
1e2fcf55
authored
Sep 28, 2016
by
konovalovsergey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
open/save math spreadsheet and presentation
parent
83dbff9a
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
228 additions
and
117 deletions
+228
-117
common/Drawings/Format/Format.js
common/Drawings/Format/Format.js
+2
-1
common/Shapes/Serialize.js
common/Shapes/Serialize.js
+72
-0
common/Shapes/SerializeWriter.js
common/Shapes/SerializeWriter.js
+72
-0
word/Editor/Serialize2.js
word/Editor/Serialize2.js
+82
-116
No files found.
common/Drawings/Format/Format.js
View file @
1e2fcf55
...
...
@@ -12647,7 +12647,8 @@ function CorrectUniColor(asc_color, unicolor, flag)
window
[
'
AscFormat
'
].
PARRUN_TYPE_RUN
=
1
;
window
[
'
AscFormat
'
].
PARRUN_TYPE_FLD
=
2
;
window
[
'
AscFormat
'
].
PARRUN_TYPE_BR
=
3
;
window
[
'
AscFormat
'
].
PARRUN_TYPE_TEXT_MATH
=
4
;
window
[
'
AscFormat
'
].
PARRUN_TYPE_MATH
=
4
;
window
[
'
AscFormat
'
].
PARRUN_TYPE_MATHPARA
=
5
;
window
[
'
AscFormat
'
].
_weight_body
=
_weight_body
;
window
[
'
AscFormat
'
].
_weight_chart
=
_weight_chart
;
...
...
common/Shapes/Serialize.js
View file @
1e2fcf55
...
...
@@ -160,6 +160,7 @@ function BinaryPPTYLoader()
this
.
RebuildImages
=
[];
this
.
textBodyTextFit
=
[];
this
.
DocReadResult
=
null
;
this
.
Start_UseFullUrl
=
function
()
{
...
...
@@ -8062,6 +8063,42 @@ function BinaryPPTYLoader()
}
break
;
}
case
AscFormat
.
PARRUN_TYPE_MATHPARA
:
case
AscFormat
.
PARRUN_TYPE_MATH
:
{
var
_end
=
s
.
cur
+
s
.
GetULong
()
+
4
;
var
_stream
=
new
AscCommon
.
FT_Stream2
();
_stream
.
data
=
s
.
data
;
_stream
.
pos
=
s
.
pos
;
_stream
.
cur
=
s
.
cur
;
_stream
.
size
=
s
.
size
;
var
parContentOld
=
par
.
Content
.
length
;
var
oParStruct
=
new
OpenParStruct
(
par
,
par
);
if
(
!
this
.
DocReadResult
)
{
this
.
DocReadResult
=
new
AscCommonWord
.
DocReadResult
(
null
);
}
var
boMathr
=
new
Binary_oMathReader
(
_stream
,
this
.
DocReadResult
,
null
);
var
nDocLength
=
_stream
.
GetULongLE
();
if
(
AscFormat
.
PARRUN_TYPE_MATHPARA
==
_type
)
{
var
props
=
{};
boMathr
.
bcr
.
Read1
(
nDocLength
,
function
(
t
,
l
){
return
boMathr
.
ReadMathOMathPara
(
t
,
l
,
oParStruct
,
props
);
});
}
else
{
var
oMath
=
new
ParaMath
();
oParStruct
.
addToContent
(
oMath
);
boMathr
.
bcr
.
Read1
(
nDocLength
,
function
(
t
,
l
){
return
boMathr
.
ReadMathArg
(
t
,
l
,
oMath
.
Root
,
oParStruct
);
});
oMath
.
Root
.
Correct_Content
(
true
);
}
s
.
Seek2
(
_end
);
EndPos
+=
par
.
Content
.
length
-
parContentOld
;
break
;
}
default
:
break
;
}
...
...
@@ -8622,6 +8659,41 @@ function CPres()
this
.
LogicDocument
=
oLogicDocument
;
return
oNewSpPr
;
};
this
.
ReadRunProperties
=
function
(
stream
,
type
)
{
if
(
this
.
Reader
==
null
)
this
.
Reader
=
new
AscCommon
.
BinaryPPTYLoader
();
var
oLogicDocument
=
this
.
LogicDocument
;
this
.
LogicDocument
=
null
;
this
.
Reader
.
ImageMapChecker
=
this
.
ImageMapChecker
;
if
(
null
==
this
.
stream
)
{
this
.
stream
=
new
AscCommon
.
FileStream
();
this
.
stream
.
obj
=
stream
.
obj
;
this
.
stream
.
data
=
stream
.
data
;
this
.
stream
.
size
=
stream
.
size
;
}
this
.
stream
.
pos
=
stream
.
pos
;
this
.
stream
.
cur
=
stream
.
cur
;
this
.
Reader
.
stream
=
this
.
stream
;
var
s
=
this
.
stream
;
var
_main_type
=
s
.
GetUChar
();
// 0!!!
var
oNewrPr
=
this
.
Reader
.
ReadRunProperties
();
stream
.
pos
=
s
.
pos
;
stream
.
cur
=
s
.
cur
;
this
.
LogicDocument
=
oLogicDocument
;
return
oNewrPr
;
};
this
.
ReadShape
=
function
()
{
...
...
common/Shapes/SerializeWriter.js
View file @
1e2fcf55
...
...
@@ -122,6 +122,7 @@ function CBinaryFileWriter()
this
.
IsUseFullUrl
=
false
;
this
.
PresentationThemesOrigin
=
""
;
this
.
DocSaveParams
=
null
;
var
oThis
=
this
;
this
.
Start_UseFullUrl
=
function
()
...
...
@@ -2714,6 +2715,39 @@ function CBinaryFileWriter()
break
;
}
case
para_Math
:
{
if
(
null
!=
_elem
.
Root
)
{
oThis
.
StartRecord
(
0
);
// subtype
oThis
.
StartRecord
(
AscFormat
.
PARRUN_TYPE_MATHPARA
);
var
_memory
=
new
AscCommon
.
CMemory
(
true
);
_memory
.
ImData
=
oThis
.
ImData
;
_memory
.
data
=
oThis
.
data
;
_memory
.
len
=
oThis
.
len
;
_memory
.
pos
=
oThis
.
pos
;
oThis
.
UseContinueWriter
=
true
;
if
(
!
oThis
.
DocSaveParams
)
{
oThis
.
DocSaveParams
=
new
AscCommonWord
.
DocSaveParams
(
false
,
false
);
}
var
boMaths
=
new
Binary_oMathWriter
(
_memory
,
null
,
oThis
.
DocSaveParams
);
boMaths
.
bs
.
WriteItemWithLength
(
function
(){
boMaths
.
WriteOMathPara
(
_elem
)});
oThis
.
ImData
=
_memory
.
ImData
;
oThis
.
data
=
_memory
.
data
;
oThis
.
len
=
_memory
.
len
;
oThis
.
pos
=
_memory
.
pos
;
oThis
.
UseContinueWriter
=
false
;
_memory
.
ImData
=
null
;
_memory
.
data
=
null
;
oThis
.
EndRecord
();
oThis
.
EndRecord
();
_count
++
;
}
}
default
:
break
;
}
...
...
@@ -4509,6 +4543,44 @@ function CBinaryFileWriter()
this
.
arrayStackStarts
.
splice
(
this
.
arrayStackStarts
.
length
-
1
,
1
);
}
}
this
.
WriteRunProperties
=
function
(
memory
,
rPr
)
{
if
(
this
.
BinaryFileWriter
.
UseContinueWriter
)
{
this
.
BinaryFileWriter
.
ImData
=
memory
.
ImData
;
this
.
BinaryFileWriter
.
data
=
memory
.
data
;
this
.
BinaryFileWriter
.
len
=
memory
.
len
;
this
.
BinaryFileWriter
.
pos
=
memory
.
pos
;
}
else
{
this
.
TreeDrawingIndex
++
;
this
.
arrayStackStarts
.
push
(
this
.
BinaryFileWriter
.
pos
);
}
var
_writer
=
this
.
BinaryFileWriter
;
_writer
.
StartRecord
(
0
);
_writer
.
WriteRunProperties
(
rPr
);
_writer
.
EndRecord
();
if
(
this
.
BinaryFileWriter
.
UseContinueWriter
)
{
memory
.
ImData
=
this
.
BinaryFileWriter
.
ImData
;
memory
.
data
=
this
.
BinaryFileWriter
.
data
;
memory
.
len
=
this
.
BinaryFileWriter
.
len
;
memory
.
pos
=
this
.
BinaryFileWriter
.
pos
;
}
else
{
this
.
TreeDrawingIndex
--
;
var
oldPos
=
this
.
arrayStackStarts
[
this
.
arrayStackStarts
.
length
-
1
];
memory
.
WriteBuffer
(
this
.
BinaryFileWriter
.
data
,
oldPos
,
this
.
BinaryFileWriter
.
pos
-
oldPos
);
this
.
BinaryFileWriter
.
pos
=
oldPos
;
this
.
arrayStackStarts
.
splice
(
this
.
arrayStackStarts
.
length
-
1
,
1
);
}
}
this
.
WriteDrawing
=
function
(
memory
,
grObject
,
Document
,
oMapCommentId
,
oNumIdMap
,
copyParams
,
saveParams
)
{
this
.
TreeDrawingIndex
++
;
...
...
word/Editor/Serialize2.js
View file @
1e2fcf55
This diff is collapsed.
Click to expand it.
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