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
fd45d9f3
Commit
fd45d9f3
authored
May 03, 2017
by
GoshaZotov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
+ previous revision
parent
6a1945cd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
48 deletions
+58
-48
word/Math/mathContent.js
word/Math/mathContent.js
+58
-48
No files found.
word/Math/mathContent.js
View file @
fd45d9f3
...
...
@@ -7251,29 +7251,61 @@ CMathContent.prototype.GetTextContent = function(arr, str)
str
=
""
;
}
var
addText
=
function
(
value
)
{
arr
.
push
(
value
);
str
+=
value
;
};
var
getMathSymbol
=
function
(
elem
)
{
var
res
=
""
;
var
res
=
[];
var
getVal
=
function
(
val
,
position
)
{
var
newVal
=
{};
newVal
.
prePosition
=
!!
position
;
newVal
.
value
=
undefined
!==
val
?
val
:
""
;
return
newVal
;
};
if
(
elem
instanceof
CDegree
)
{
res
=
"
^
"
;
if
(
DEGREE_SUPERSCRIPT
===
elem
.
Pr
.
type
)
{
res
.
push
(
getVal
(
"
^
"
));
}
else
{
res
.
push
(
getVal
(
"
_
"
));
}
}
else
if
(
elem
instanceof
CDelimiter
)
{
res
=
"
Delimiter
"
;
res
[
-
1
]
=
getVal
(
"
(
"
,
true
);
res
.
push
(
getVal
(
"
)
"
));
}
else
if
(
elem
instanceof
CNary
)
{
res
=
"
CNary
"
;
res
[
-
1
]
=
getVal
(
String
.
fromCharCode
(
elem
.
Pr
.
chr
),
true
);
if
(
!
elem
.
Pr
.
supHide
)
{
res
.
push
(
getVal
(
"
_
"
,
true
));
}
if
(
!
elem
.
Pr
.
subHide
)
{
res
.
push
(
getVal
(
"
^
"
,
true
));
}
res
.
push
(
getVal
(
"
▒
"
,
true
));
}
else
if
(
elem
instanceof
CFraction
)
{
res
=
"
/
"
;
res
.
push
(
getVal
(
"
/
"
))
;
}
else
if
(
elem
instanceof
CRadical
)
{
res
=
"
√
"
;
//8730
res
.
push
(
getVal
(
"
√
"
,
true
));
//8730;
}
return
res
;
...
...
@@ -7293,15 +7325,12 @@ CMathContent.prototype.GetTextContent = function(arr, str)
}
else
if
(
para_Math_Text
===
this
.
Content
[
i
].
Content
[
j
].
Type
)
{
arr
.
push
(
String
.
fromCharCode
(
this
.
Content
[
i
].
Content
[
j
].
value
));
str
+=
String
.
fromCharCode
(
this
.
Content
[
i
].
Content
[
j
].
value
);
addText
(
String
.
fromCharCode
(
this
.
Content
[
i
].
Content
[
j
].
value
));
}
else
if
(
para_Math_BreakOperator
===
this
.
Content
[
i
].
Content
[
j
].
Type
)
{
arr
.
push
(
String
.
fromCharCode
(
this
.
Content
[
i
].
Content
[
j
].
value
));
str
+=
String
.
fromCharCode
(
this
.
Content
[
i
].
Content
[
j
].
value
);
addText
(
String
.
fromCharCode
(
this
.
Content
[
i
].
Content
[
j
].
value
));
}
}
break
;
...
...
@@ -7314,62 +7343,43 @@ CMathContent.prototype.GetTextContent = function(arr, str)
{
if
(
para_Math_Content
===
this
.
Content
[
i
].
Content
[
j
].
Type
)
{
if
(
this
.
Content
[
i
].
Content
.
length
>
1
)
if
(
j
===
0
&&
symbol
[
-
1
]
&&
symbol
[
-
1
].
prePosition
)
{
arr
.
push
(
"
(
"
);
str
+=
"
(
"
;
addText
(
symbol
[
-
1
].
value
);
}
str
=
this
.
Content
[
i
].
Content
[
j
].
GetTextContent
(
arr
,
str
);
if
(
this
.
Content
[
i
].
Content
.
length
>
1
)
if
(
symbol
[
j
]
&&
symbol
[
j
].
prePosition
)
{
arr
.
push
(
"
)
"
);
str
+=
"
)
"
;
addText
(
symbol
[
j
].
value
);
}
if
(
j
!==
this
.
Content
[
i
].
Content
.
length
-
1
)
{
/*if(this.Content[i].Content.length > 1)
{
arr.push(")");
str += ")";
}*/
addText
(
"
(
"
);
str
=
this
.
Content
[
i
].
Content
[
j
].
GetTextContent
(
arr
,
str
);
arr
.
push
(
symbol
);
str
+=
symbol
;
addText
(
"
)
"
);
/*if(this.Content[i].Content.length > 1
)
if
(
symbol
[
j
]
&&
!
symbol
[
j
].
prePosition
)
{
arr.push("(");
str += "(";
}*/
addText
(
symbol
[
j
].
value
);
}
}
else
if
(
para_Math_Text
===
this
.
Content
[
i
].
Content
[
j
].
Type
)
{
arr
.
push
(
String
.
fromCharCode
(
this
.
Content
[
i
].
Content
[
j
].
value
));
str
+=
String
.
fromCharCode
(
this
.
Content
[
i
].
Content
[
j
].
value
);
addText
(
String
.
fromCharCode
(
this
.
Content
[
i
].
Content
[
j
].
value
));
}
else
if
(
para_Math_BreakOperator
===
this
.
Content
[
i
].
Content
[
j
].
Type
)
{
arr
.
push
(
String
.
fromCharCode
(
this
.
Content
[
i
].
Content
[
j
].
value
));
str
+=
String
.
fromCharCode
(
this
.
Content
[
i
].
Content
[
j
].
value
);
addText
(
String
.
fromCharCode
(
this
.
Content
[
i
].
Content
[
j
].
value
));
}
}
/*if(this.Content[i].Content.length > 1)
{
arr.push(")");
str += ")";
}*/
break
;
}
case
para_Math_Text
:
/*
case para_Math_Text:
{
arr
.
push
(
String
.
fromCharCode
(
this
.
Content
[
i
].
value
));
str
+=
String
.
fromCharCode
(
this
.
Content
[
i
].
value
);
addText(String.fromCharCode(this.Content[i].Content[j].value));
break;
}
}
*/
}
}
...
...
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