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
f3a25fe0
Commit
f3a25fe0
authored
Jul 21, 2016
by
konovalovsergey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix Bug 32808 Matrix without MPr
parent
bd98aa69
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
35 deletions
+47
-35
word/Editor/Serialize2.js
word/Editor/Serialize2.js
+47
-35
No files found.
word/Editor/Serialize2.js
View file @
f3a25fe0
...
...
@@ -9847,13 +9847,47 @@ function Binary_oMathReader(stream, oReadResult)
}
else
if
(
c_oSer_OMathContentType
.
Matrix
===
type
)
{
var
oMatrix
=
{};
var
arrContent
=
[];
props
.
mcs
=
[];
var
oMatrCounter
=
{
row
:
0
,
column
:
0
};
res
=
this
.
bcr
.
Read1
(
length
,
function
(
t
,
l
){
return
oThis
.
ReadMathMatrix
(
t
,
l
,
props
,
oElem
,
oMatrix
,
arrContent
,
oMatrCounter
);
});
return
oThis
.
ReadMathMatrix
(
t
,
l
,
props
,
arrContent
);
});
if
(
oElem
)
{
//create props by content, important before creation matrix
var
rowMax
=
arrContent
.
length
;
var
colMax
=
0
;
for
(
var
i
=
0
;
i
<
arrContent
.
length
;
++
i
)
{
var
row
=
arrContent
[
i
];
if
(
colMax
<
row
.
length
)
{
colMax
=
row
.
length
;
}
}
props
.
row
=
rowMax
;
var
colMaxMc
=
0
;
for
(
var
i
=
0
;
i
<
props
.
mcs
.
length
;
++
i
)
{
colMaxMc
+=
props
.
mcs
[
i
].
count
;
}
if
(
colMaxMc
<
colMax
)
{
props
.
mcs
.
push
({
count
:
colMax
-
colMaxMc
,
mcJc
:
MCJC_CENTER
});
}
//create matrix
var
oMatrix
=
new
CMathMatrix
(
props
);
initMathRevisions
(
oMatrix
,
props
);
oElem
.
addElementToContent
(
oMatrix
);
//read rows
var
nOldPos
=
this
.
stream
.
GetCurPos
();
for
(
var
i
=
0
;
i
<
arrContent
.
length
;
++
i
)
{
var
row
=
arrContent
[
i
];
for
(
var
j
=
0
;
j
<
row
.
length
;
++
j
)
{
var
cell
=
row
[
j
];
this
.
stream
.
Seek2
(
cell
.
pos
);
res
=
this
.
bcr
.
Read1
(
cell
.
length
,
function
(
t
,
l
){
return
oThis
.
ReadMathArg
(
t
,
l
,
oMatrix
.
getElement
(
i
,
j
));
});
}
}
this
.
stream
.
Seek2
(
nOldPos
);
}
}
else
if
(
c_oSer_OMathContentType
.
Nary
===
type
)
{
...
...
@@ -10833,7 +10867,7 @@ function Binary_oMathReader(stream, oReadResult)
res
=
c_oSerConstants
.
ReadUnknown
;
return
res
;
};
this
.
ReadMathMatrix
=
function
(
type
,
length
,
props
,
oParent
,
oMatr
,
arrContent
,
oMatrCounter
)
this
.
ReadMathMatrix
=
function
(
type
,
length
,
props
,
arrContent
)
{
var
res
=
c_oSerConstants
.
ReadOk
;
var
oThis
=
this
;
...
...
@@ -10842,31 +10876,16 @@ function Binary_oMathReader(stream, oReadResult)
res
=
this
.
bcr
.
Read1
(
length
,
function
(
t
,
l
){
return
oThis
.
ReadMathMPr
(
t
,
l
,
props
);
});
var
oMatrix
=
new
CMathMatrix
(
props
);
initMathRevisions
(
oMatrix
,
props
);
if
(
oParent
)
oParent
.
addElementToContent
(
oMatrix
);
oMatr
.
content
=
oMatrix
;
var
column
=
0
;
for
(
var
i
=
0
;
i
<
props
.
mcs
.
length
;
i
++
)
column
+=
props
.
mcs
[
i
].
count
;
for
(
var
i
=
0
;
i
<
props
.
row
;
i
++
)
{
arrContent
[
i
]
=
[];
for
(
var
j
=
0
;
j
<
column
;
j
++
)
arrContent
[
i
][
j
]
=
oMatrix
.
getElement
(
i
,
j
);
}
}
else
if
(
c_oSer_OMathContentType
.
Mr
===
type
)
{
var
row
=
[];
res
=
this
.
bcr
.
Read1
(
length
,
function
(
t
,
l
){
return
oThis
.
ReadMathMr
(
t
,
l
,
oMatr
.
content
,
arrContent
,
oMatrCounter
);
return
oThis
.
ReadMathMr
(
t
,
l
,
row
);
});
oMatrCounter
.
row
++
;
if
(
row
.
length
>
0
)
{
arrContent
.
push
(
row
);
}
}
else
res
=
c_oSerConstants
.
ReadUnknown
;
...
...
@@ -11031,21 +11050,14 @@ function Binary_oMathReader(stream, oReadResult)
res
=
c_oSerConstants
.
ReadUnknown
;
return
res
;
};
this
.
ReadMathMr
=
function
(
type
,
length
,
oMatrix
,
arrContent
,
oMatrCounter
)
this
.
ReadMathMr
=
function
(
type
,
length
,
arrContent
)
{
var
res
=
c_oSerConstants
.
ReadOk
;
var
oThis
=
this
;
if
(
c_oSer_OMathContentType
.
Element
===
type
)
{
var
lRow
=
oMatrCounter
.
row
;
var
lColumn
=
oMatrCounter
.
column
;
res
=
this
.
bcr
.
Read1
(
length
,
function
(
t
,
l
){
return
oThis
.
ReadMathArg
(
t
,
l
,
arrContent
[
lRow
][
lColumn
]);
});
oMatrCounter
.
column
++
;
if
(
oMatrix
.
nCol
==
oMatrCounter
.
column
)
oMatrCounter
.
column
=
0
;
arrContent
.
push
({
pos
:
this
.
stream
.
GetCurPos
(),
length
:
length
});
res
=
c_oSerConstants
.
ReadUnknown
;
}
else
res
=
c_oSerConstants
.
ReadUnknown
;
...
...
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