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
1ee1e2e2
Commit
1ee1e2e2
authored
Oct 20, 2016
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
3d47a865
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
246 additions
and
249 deletions
+246
-249
ASCOfficeDocxFile2/BinWriter/BinEquationWriter.h
ASCOfficeDocxFile2/BinWriter/BinEquationWriter.h
+4
-4
Common/DocxFormat/Source/DocxFormat/Math/oMath.cpp
Common/DocxFormat/Source/DocxFormat/Math/oMath.cpp
+1
-1
Common/DocxFormat/Source/MathEquation/LEStream.h
Common/DocxFormat/Source/MathEquation/LEStream.h
+2
-2
Common/DocxFormat/Source/MathEquation/MathEquation.cpp
Common/DocxFormat/Source/MathEquation/MathEquation.cpp
+3
-3
Common/DocxFormat/Source/MathEquation/MathEquation.h
Common/DocxFormat/Source/MathEquation/MathEquation.h
+1
-1
Common/DocxFormat/Source/MathEquation/OutputDev.h
Common/DocxFormat/Source/MathEquation/OutputDev.h
+1
-1
Common/DocxFormat/Source/MathEquation/StringOutput.h
Common/DocxFormat/Source/MathEquation/StringOutput.h
+234
-234
Common/DocxFormat/Source/MathEquation/Types.h
Common/DocxFormat/Source/MathEquation/Types.h
+0
-3
No files found.
ASCOfficeDocxFile2/BinWriter/BinEquationWriter.h
View file @
1ee1e2e2
...
...
@@ -453,7 +453,7 @@ namespace MathEquation
{
nTextSize
=
nSize
*
2
;
}
virtual
void
BeginChar
(
Unicode_t
uChar
,
uint8_t
nTypeFace
,
bool
bSpecialSymbol
)
virtual
void
BeginChar
(
unsigned
short
uChar
,
unsigned
char
nTypeFace
,
bool
bSpecialSymbol
)
{
bool
bIsOpen
;
if
(
!
m_aCommandStack
.
empty
())
...
...
@@ -540,7 +540,7 @@ namespace MathEquation
}
}*/
}
virtual
void
BeginMatrix
(
uint8_t
nVAlign
,
MMATRIXHORALIGN
eHorAlign
,
MMATRIXVERALIGN
eVerAlign
,
bool
bEqualRows
,
bool
bEqualCols
,
uint8_t
nRows
,
uint8_t
nCols
,
uint8_t
*
pVerBorders
,
uint8_t
*
pHorBorders
)
virtual
void
BeginMatrix
(
unsigned
char
nVAlign
,
MMATRIXHORALIGN
eHorAlign
,
MMATRIXVERALIGN
eVerAlign
,
bool
bEqualRows
,
bool
bEqualCols
,
unsigned
char
nRows
,
unsigned
char
nCols
,
unsigned
char
*
pVerBorders
,
unsigned
char
*
pHorBorders
)
{
if
(
!
oRManager
.
IsEmpty
())
WriteRun
();
...
...
@@ -587,7 +587,7 @@ namespace MathEquation
m_aMatrixStack
.
pop
();
}
}
virtual
void
StartPile
(
uint8_t
nHAlign
,
uint8_t
nVAlign
)
virtual
void
StartPile
(
unsigned
char
nHAlign
,
unsigned
char
nVAlign
)
{
switch
(
nHAlign
)
{
...
...
@@ -1490,7 +1490,7 @@ namespace MathEquation
}
}
void
AddFont
(
uint8_t
nTypeFace
,
std
::
string
sName
,
bool
bBold
,
bool
bItalic
)
void
AddFont
(
unsigned
char
nTypeFace
,
std
::
string
sName
,
bool
bBold
,
bool
bItalic
)
{
TMathFont
aFont
;
aFont
.
sName
=
sName
;
...
...
Common/DocxFormat/Source/DocxFormat/Math/oMath.cpp
View file @
1ee1e2e2
...
...
@@ -172,4 +172,4 @@ namespace OOX
}
}
}
//namespace Logic
}
//namespace OOX
\ No newline at end of file
}
//namespace OOX
Common/DocxFormat/Source/MathEquation/LEStream.h
View file @
1ee1e2e2
...
...
@@ -109,12 +109,12 @@ public :
nValue
=
ReadUInt32
();
}
void
operator
>>
(
int8_t
&
nValue
)
void
operator
>>
(
char
&
nValue
)
{
nValue
=
ReadUInt8
();
}
void
operator
>>
(
int16_
t
&
nValue
)
void
operator
>>
(
shor
t
&
nValue
)
{
nValue
=
ReadUInt16
();
}
...
...
Common/DocxFormat/Source/MathEquation/MathEquation.cpp
View file @
1ee1e2e2
...
...
@@ -225,7 +225,7 @@ void CEquationReader::HandleNudge()
}
int
CEquationReader
::
HandleChar
(
unsigned
char
nTag
)
{
Unicode_
t
nChar
;
unsigned
shor
t
nChar
;
int
nRet
=
1
;
if
(
xfAUTO
(
nTag
))
...
...
@@ -749,7 +749,7 @@ void CEquationReader::HandleFont()
*
pS
>>
nTFace
;
*
pS
>>
nStyle
;
Char_t
nChar8
;
char
nChar8
;
do
{
*
pS
>>
nChar8
;
...
...
@@ -760,7 +760,7 @@ void CEquationReader::HandleFont()
pOutputDev
->
AddFont
(
128
-
nTFace
,
sName
.
GetValue
(),
nStyle
&
0x01
,
nStyle
&
0x02
);
}
bool
CEquationReader
::
IsSpecialChar
(
Unicode_
t
nChar
)
bool
CEquationReader
::
IsSpecialChar
(
unsigned
shor
t
nChar
)
{
switch
(
nChar
)
{
...
...
Common/DocxFormat/Source/MathEquation/MathEquation.h
View file @
1ee1e2e2
...
...
@@ -111,7 +111,7 @@ namespace MathEquation
void
HandleSetSize
(
MTOKENS
eType
);
void
HandleRuler
();
void
HandleFont
();
bool
IsSpecialChar
(
Unicode_
t
nChar
);
bool
IsSpecialChar
(
unsigned
shor
t
nChar
);
private:
...
...
Common/DocxFormat/Source/MathEquation/OutputDev.h
View file @
1ee1e2e2
...
...
@@ -54,7 +54,7 @@ namespace MathEquation
virtual
void
SetSize
(
_UINT16
nSize
)
=
0
;
// Добавляем символ. К символу могут быть добавлены разные элементы. Зачеркивание, добавление акцента и т.д.
virtual
void
BeginChar
(
Unicode_
t
uChar
,
unsigned
char
nTypeFace
,
bool
bSpecialSymbol
)
=
0
;
virtual
void
BeginChar
(
unsigned
shor
t
uChar
,
unsigned
char
nTypeFace
,
bool
bSpecialSymbol
)
=
0
;
virtual
void
AddCharEmbel
(
MEMBELTYPE
eType
)
=
0
;
virtual
void
EndChar
()
=
0
;
...
...
Common/DocxFormat/Source/MathEquation/StringOutput.h
View file @
1ee1e2e2
...
...
@@ -36,8 +36,8 @@
#include "String.h"
#include <stack>
#ifndef APPEND
#define APPEND(str,ascii) str.Append(ascii)
#ifndef APPEND
#define APPEND(str,ascii) str.Append(ascii)
#endif
#define OUTPUTCHARS
...
...
@@ -80,7 +80,7 @@ namespace MathEquation
}
}
virtual
void
BeginChar
(
Unicode_
t
uChar
,
uint8_t
nTypeFace
,
bool
bSpecialSymbol
)
virtual
void
BeginChar
(
unsigned
shor
t
uChar
,
uint8_t
nTypeFace
,
bool
bSpecialSymbol
)
{
WriteNodeBegin
(
"char"
,
true
);
...
...
@@ -88,11 +88,11 @@ namespace MathEquation
{
switch
(
uChar
)
{
case
specialsymAlignment
:
WriteStringAttribute
(
"value"
,
"Alignment symbol"
);
break
;
case
specialsymZeroSpace
:
WriteStringAttribute
(
"value"
,
"ZeroSpace"
);
break
;
case
specialsymThinSpace
:
WriteStringAttribute
(
"value"
,
"ThinSpace"
);
break
;
case
specialsymThickSpace
:
WriteStringAttribute
(
"value"
,
"ThickSpace"
);
break
;
case
specialsymLargeSpace
:
WriteStringAttribute
(
"value"
,
"LargeSpace"
);
break
;
case
specialsymAlignment
:
WriteStringAttribute
(
"value"
,
"Alignment symbol"
);
break
;
case
specialsymZeroSpace
:
WriteStringAttribute
(
"value"
,
"ZeroSpace"
);
break
;
case
specialsymThinSpace
:
WriteStringAttribute
(
"value"
,
"ThinSpace"
);
break
;
case
specialsymThickSpace
:
WriteStringAttribute
(
"value"
,
"ThickSpace"
);
break
;
case
specialsymLargeSpace
:
WriteStringAttribute
(
"value"
,
"LargeSpace"
);
break
;
case
specialsymOnePtSpace
:
WriteStringAttribute
(
"value"
,
"OnePtSpace"
);
break
;
}
}
...
...
@@ -122,13 +122,13 @@ namespace MathEquation
bEmbel
=
true
;
}
switch
(
eType
)
{
case
embelDot
:
APPEND
(
rRet
,
" dot "
);
break
;
case
embelDDot
:
APPEND
(
rRet
,
" ddot "
);
break
;
case
embelDDDot
:
APPEND
(
rRet
,
" dddot "
);
break
;
case
embelPrime
:
APPEND
(
rRet
,
" prime "
);
break
;
case
embelDPrime
:
APPEND
(
rRet
,
" double prime "
);
break
;
switch
(
eType
)
{
case
embelDot
:
APPEND
(
rRet
,
" dot "
);
break
;
case
embelDDot
:
APPEND
(
rRet
,
" ddot "
);
break
;
case
embelDDDot
:
APPEND
(
rRet
,
" dddot "
);
break
;
case
embelPrime
:
APPEND
(
rRet
,
" prime "
);
break
;
case
embelDPrime
:
APPEND
(
rRet
,
" double prime "
);
break
;
case
embelLPrime
:
APPEND
(
rRet
,
" left prime "
);
break
;
case
embelTilde
:
APPEND
(
rRet
,
" tilde "
);
break
;
case
embelHat
:
APPEND
(
rRet
,
" hat "
);
break
;
...
...
@@ -142,7 +142,7 @@ namespace MathEquation
case
embelBar
:
APPEND
(
rRet
,
" bar "
);
break
;
case
embelTPrime
:
APPEND
(
rRet
,
" triple prime "
);
break
;
case
embelFrown
:
APPEND
(
rRet
,
" frown "
);
break
;
case
embelSmile
:
APPEND
(
rRet
,
" smiple "
);
break
;
case
embelSmile
:
APPEND
(
rRet
,
" smiple "
);
break
;
}
}
virtual
void
EndChar
()
...
...
@@ -158,133 +158,133 @@ namespace MathEquation
WriteIntAttribute
(
"value"
,
nSize
);
WriteNodeEnd
(
true
);
}
virtual
void
BeginMatrix
(
uint8_t
nVAlign
,
MMATRIXHORALIGN
eHorAlign
,
MMATRIXVERALIGN
eVerAlign
,
bool
bEqualRows
,
bool
bEqualCols
,
uint8_t
nRows
,
uint8_t
nCols
,
uint8_t
*
pVerBorders
,
uint8_t
*
pHorBorders
)
{
CMatrixCommand
*
pCommand
=
(
CMatrixCommand
*
)
PushCommand
(
commandMatrix
);
pCommand
->
SetProps
(
nRows
,
nCols
);
WriteNodeBegin
(
"matrix"
,
true
);
WriteIntAttribute
(
"rows"
,
nRows
);
WriteIntAttribute
(
"cols"
,
nCols
);
switch
(
eHorAlign
)
{
case
matrixhoralignLeft
:
WriteStringAttribute
(
"horalign"
,
"left"
);
break
;
case
matrixhoralignCenter
:
WriteStringAttribute
(
"horalign"
,
"center"
);
break
;
case
matrixhoralignRight
:
WriteStringAttribute
(
"horalign"
,
"right"
);
break
;
case
matrixhoralignEqualSign
:
WriteStringAttribute
(
"horalign"
,
"equal"
);
break
;
case
matrixhoralignCommaSign
:
WriteStringAttribute
(
"horalign"
,
"comma"
);
break
;
}
switch
(
eVerAlign
)
{
case
matrixveralignTop
:
WriteStringAttribute
(
"veralign"
,
"top"
);
break
;
case
matrixveralignBaseLine
:
WriteStringAttribute
(
"veralign"
,
"baseline"
);
break
;
case
matrixveralginBottom
:
WriteStringAttribute
(
"veralign"
,
"bottom"
);
break
;
}
WriteBoolAttribute
(
"equalrows"
,
bEqualRows
);
WriteBoolAttribute
(
"equalcols"
,
bEqualCols
);
std
::
string
sVerBorders
;
for
(
int
nVerIndex
=
0
;
nVerIndex
<=
nRows
;
nVerIndex
++
)
{
MMATRIXBORDERTYPE
eType
=
(
MMATRIXBORDERTYPE
)
pVerBorders
[
nVerIndex
];
switch
(
eType
)
{
case
matrixborderNone
:
sVerBorders
.
append
(
" none "
);
break
;
case
matrixborderSolid
:
sVerBorders
.
append
(
" solid "
);
break
;
case
matrixborderDash
:
sVerBorders
.
append
(
" dash "
);
break
;
case
matrixborderDot
:
sVerBorders
.
append
(
" dot "
);
break
;
}
}
std
::
string
sHorBorders
;
for
(
int
nHorIndex
=
0
;
nHorIndex
<=
nCols
;
nHorIndex
++
)
{
MMATRIXBORDERTYPE
eType
=
(
MMATRIXBORDERTYPE
)
pHorBorders
[
nHorIndex
];
switch
(
eType
)
{
case
matrixborderNone
:
sHorBorders
.
append
(
" none "
);
break
;
case
matrixborderSolid
:
sHorBorders
.
append
(
" solid "
);
break
;
case
matrixborderDash
:
sHorBorders
.
append
(
" dash "
);
break
;
case
matrixborderDot
:
sHorBorders
.
append
(
" dot "
);
break
;
}
}
WriteStringAttribute
(
"verborders"
,
sVerBorders
);
WriteStringAttribute
(
"horborders"
,
sHorBorders
);
WriteNodeEnd
(
false
);
}
virtual
void
EndMatrix
()
{
PopCommand
();
WriteNodeEnd
(
"matrix"
);
}
virtual
void
StartPile
(
uint8_t
nHAlign
,
uint8_t
nVAlign
)
{
//switch(nHAlign)
//{
//case 1:
//default:
// APPEND(rRet,"alignl {");
// break;
//case 2:
// APPEND(rRet,"alignc {");
// break;
//case 3:
// APPEND(rRet,"alignr {");
// break;
//}
//switch(nVAlign)
//{
//}
WriteNodeBegin
(
"pile"
,
false
);
}
virtual
void
BeginMatrix
(
uint8_t
nVAlign
,
MMATRIXHORALIGN
eHorAlign
,
MMATRIXVERALIGN
eVerAlign
,
bool
bEqualRows
,
bool
bEqualCols
,
uint8_t
nRows
,
uint8_t
nCols
,
uint8_t
*
pVerBorders
,
uint8_t
*
pHorBorders
)
{
CMatrixCommand
*
pCommand
=
(
CMatrixCommand
*
)
PushCommand
(
commandMatrix
);
pCommand
->
SetProps
(
nRows
,
nCols
);
WriteNodeBegin
(
"matrix"
,
true
);
WriteIntAttribute
(
"rows"
,
nRows
);
WriteIntAttribute
(
"cols"
,
nCols
);
switch
(
eHorAlign
)
{
case
matrixhoralignLeft
:
WriteStringAttribute
(
"horalign"
,
"left"
);
break
;
case
matrixhoralignCenter
:
WriteStringAttribute
(
"horalign"
,
"center"
);
break
;
case
matrixhoralignRight
:
WriteStringAttribute
(
"horalign"
,
"right"
);
break
;
case
matrixhoralignEqualSign
:
WriteStringAttribute
(
"horalign"
,
"equal"
);
break
;
case
matrixhoralignCommaSign
:
WriteStringAttribute
(
"horalign"
,
"comma"
);
break
;
}
switch
(
eVerAlign
)
{
case
matrixveralignTop
:
WriteStringAttribute
(
"veralign"
,
"top"
);
break
;
case
matrixveralignBaseLine
:
WriteStringAttribute
(
"veralign"
,
"baseline"
);
break
;
case
matrixveralginBottom
:
WriteStringAttribute
(
"veralign"
,
"bottom"
);
break
;
}
WriteBoolAttribute
(
"equalrows"
,
bEqualRows
);
WriteBoolAttribute
(
"equalcols"
,
bEqualCols
);
std
::
string
sVerBorders
;
for
(
int
nVerIndex
=
0
;
nVerIndex
<=
nRows
;
nVerIndex
++
)
{
MMATRIXBORDERTYPE
eType
=
(
MMATRIXBORDERTYPE
)
pVerBorders
[
nVerIndex
];
switch
(
eType
)
{
case
matrixborderNone
:
sVerBorders
.
append
(
" none "
);
break
;
case
matrixborderSolid
:
sVerBorders
.
append
(
" solid "
);
break
;
case
matrixborderDash
:
sVerBorders
.
append
(
" dash "
);
break
;
case
matrixborderDot
:
sVerBorders
.
append
(
" dot "
);
break
;
}
}
std
::
string
sHorBorders
;
for
(
int
nHorIndex
=
0
;
nHorIndex
<=
nCols
;
nHorIndex
++
)
{
MMATRIXBORDERTYPE
eType
=
(
MMATRIXBORDERTYPE
)
pHorBorders
[
nHorIndex
];
switch
(
eType
)
{
case
matrixborderNone
:
sHorBorders
.
append
(
" none "
);
break
;
case
matrixborderSolid
:
sHorBorders
.
append
(
" solid "
);
break
;
case
matrixborderDash
:
sHorBorders
.
append
(
" dash "
);
break
;
case
matrixborderDot
:
sHorBorders
.
append
(
" dot "
);
break
;
}
}
WriteStringAttribute
(
"verborders"
,
sVerBorders
);
WriteStringAttribute
(
"horborders"
,
sHorBorders
);
WriteNodeEnd
(
false
);
}
virtual
void
EndMatrix
()
{
PopCommand
();
WriteNodeEnd
(
"matrix"
);
}
virtual
void
StartPile
(
uint8_t
nHAlign
,
uint8_t
nVAlign
)
{
//switch(nHAlign)
//{
//case 1:
//default:
// APPEND(rRet,"alignl {");
// break;
//case 2:
// APPEND(rRet,"alignc {");
// break;
//case 3:
// APPEND(rRet,"alignr {");
// break;
//}
//switch(nVAlign)
//{
//}
WriteNodeBegin
(
"pile"
,
false
);
}
virtual
void
EndPile
()
{
WriteNodeEnd
(
"pile"
);
}
virtual
void
BeginBrackets
(
MBRACKETSTYPE
eType
,
bool
bOpen
,
bool
bClose
)
{
PushCommand
(
commandBrackets
);
WriteNodeBegin
(
"brackets"
,
true
);
switch
(
eType
)
{
case
bracketsAngle
:
WriteStringAttribute
(
"type"
,
"angle"
);
break
;
case
bracketsRound
:
WriteStringAttribute
(
"type"
,
"round"
);
break
;
case
bracketsCurve
:
WriteStringAttribute
(
"type"
,
"curve"
);
break
;
case
bracketsSquare
:
WriteStringAttribute
(
"type"
,
"square"
);
break
;
case
bracketsLine
:
WriteStringAttribute
(
"type"
,
"line"
);
break
;
case
bracketsDLine
:
WriteStringAttribute
(
"type"
,
"double line"
);
break
;
case
bracketsFloor
:
WriteStringAttribute
(
"type"
,
"floor"
);
break
;
case
bracketsCeil
:
WriteStringAttribute
(
"type"
,
"ceil"
);
break
;
case
bracketsSquareOpenOpen
:
WriteStringAttribute
(
"type"
,
"square open open"
);
break
;
case
bracketsSquareRound
:
WriteStringAttribute
(
"type"
,
"square-round"
);
break
;
case
bracketsSquareCloseClose
:
WriteStringAttribute
(
"type"
,
"square close close"
);
break
;
case
bracketsSquareCloseOpen
:
WriteStringAttribute
(
"type"
,
"square close open"
);
break
;
case
bracketsRoundSquare
:
WriteStringAttribute
(
"type"
,
"round-square"
);
break
;
}
WriteBoolAttribute
(
"open"
,
bOpen
);
WriteBoolAttribute
(
"close"
,
bClose
);
WriteNodeEnd
(
false
);
}
virtual
void
BeginBrackets
(
MBRACKETSTYPE
eType
,
bool
bOpen
,
bool
bClose
)
{
PushCommand
(
commandBrackets
);
WriteNodeBegin
(
"brackets"
,
true
);
switch
(
eType
)
{
case
bracketsAngle
:
WriteStringAttribute
(
"type"
,
"angle"
);
break
;
case
bracketsRound
:
WriteStringAttribute
(
"type"
,
"round"
);
break
;
case
bracketsCurve
:
WriteStringAttribute
(
"type"
,
"curve"
);
break
;
case
bracketsSquare
:
WriteStringAttribute
(
"type"
,
"square"
);
break
;
case
bracketsLine
:
WriteStringAttribute
(
"type"
,
"line"
);
break
;
case
bracketsDLine
:
WriteStringAttribute
(
"type"
,
"double line"
);
break
;
case
bracketsFloor
:
WriteStringAttribute
(
"type"
,
"floor"
);
break
;
case
bracketsCeil
:
WriteStringAttribute
(
"type"
,
"ceil"
);
break
;
case
bracketsSquareOpenOpen
:
WriteStringAttribute
(
"type"
,
"square open open"
);
break
;
case
bracketsSquareRound
:
WriteStringAttribute
(
"type"
,
"square-round"
);
break
;
case
bracketsSquareCloseClose
:
WriteStringAttribute
(
"type"
,
"square close close"
);
break
;
case
bracketsSquareCloseOpen
:
WriteStringAttribute
(
"type"
,
"square close open"
);
break
;
case
bracketsRoundSquare
:
WriteStringAttribute
(
"type"
,
"round-square"
);
break
;
}
WriteBoolAttribute
(
"open"
,
bOpen
);
WriteBoolAttribute
(
"close"
,
bClose
);
WriteNodeEnd
(
false
);
}
virtual
void
EndBrackets
(
MBRACKETSTYPE
eType
,
bool
bOpen
,
bool
bClose
)
{
PopCommand
();
WriteNodeEnd
(
"brackets"
);
PopCommand
();
WriteNodeEnd
(
"brackets"
);
}
virtual
void
BeginRoot
(
bool
bDegree
)
{
PushCommand
(
commandRoot
);
WriteNodeBegin
(
"root"
,
true
);
WriteBoolAttribute
(
"nroot"
,
bDegree
);
WriteNodeEnd
(
false
);
WriteNodeBegin
(
"root"
,
true
);
WriteBoolAttribute
(
"nroot"
,
bDegree
);
WriteNodeEnd
(
false
);
}
virtual
void
EndRoot
()
{
...
...
@@ -292,97 +292,97 @@ namespace MathEquation
WriteNodeEnd
(
"root"
);
}
virtual
void
BeginFraction
(
MFRACTIONTYPES
eType
,
bool
bInline
)
{
PushCommand
(
commandFraction
);
WriteNodeBegin
(
"fraction"
,
true
);
WriteBoolAttribute
(
"inline"
,
bInline
);
WriteNodeEnd
(
false
);
}
virtual
void
BeginFraction
(
MFRACTIONTYPES
eType
,
bool
bInline
)
{
PushCommand
(
commandFraction
);
WriteNodeBegin
(
"fraction"
,
true
);
WriteBoolAttribute
(
"inline"
,
bInline
);
WriteNodeEnd
(
false
);
}
virtual
void
EndFraction
()
{
PopCommand
();
WriteNodeEnd
(
"fraction"
);
}
virtual
void
BeginScript
(
MSCRIPTALIGN
eAlign
,
bool
bBase
=
false
,
bool
bSup
=
false
,
bool
bSub
=
false
,
bool
bInline
=
true
)
{
CScriptCommand
*
pCommand
=
(
CScriptCommand
*
)
PushCommand
(
commandScript
);
pCommand
->
SetProps
(
bInline
,
bBase
,
bSup
,
bSub
);
WriteNodeBegin
(
"script"
,
true
);
switch
(
eAlign
)
{
virtual
void
BeginScript
(
MSCRIPTALIGN
eAlign
,
bool
bBase
=
false
,
bool
bSup
=
false
,
bool
bSub
=
false
,
bool
bInline
=
true
)
{
CScriptCommand
*
pCommand
=
(
CScriptCommand
*
)
PushCommand
(
commandScript
);
pCommand
->
SetProps
(
bInline
,
bBase
,
bSup
,
bSub
);
WriteNodeBegin
(
"script"
,
true
);
switch
(
eAlign
)
{
case
scriptalignRight
:
WriteStringAttribute
(
"align"
,
"right"
);
break
;
case
scriptalignCenter
:
WriteStringAttribute
(
"align"
,
"center"
);
break
;
case
scriptalignLeft
:
WriteStringAttribute
(
"align"
,
"left"
);
break
;
}
WriteBoolAttribute
(
"base"
,
bBase
);
WriteBoolAttribute
(
"sup"
,
bSup
);
WriteBoolAttribute
(
"sub"
,
bSub
);
WriteBoolAttribute
(
"inline"
,
bInline
);
WriteNodeEnd
(
false
);
}
virtual
void
EndScript
()
{
PopCommand
();
WriteNodeEnd
(
"script"
);
}
virtual
void
BeginBar
(
MBARTYPE
eType
,
bool
bTop
)
{
PushCommand
(
commandBar
);
WriteNodeBegin
(
"bar"
,
true
);
switch
(
eType
)
{
}
WriteBoolAttribute
(
"base"
,
bBase
);
WriteBoolAttribute
(
"sup"
,
bSup
);
WriteBoolAttribute
(
"sub"
,
bSub
);
WriteBoolAttribute
(
"inline"
,
bInline
);
WriteNodeEnd
(
false
);
}
virtual
void
EndScript
()
{
PopCommand
();
WriteNodeEnd
(
"script"
);
}
virtual
void
BeginBar
(
MBARTYPE
eType
,
bool
bTop
)
{
PushCommand
(
commandBar
);
WriteNodeBegin
(
"bar"
,
true
);
switch
(
eType
)
{
case
bartypeLine
:
WriteStringAttribute
(
"type"
,
"line"
);
break
;
case
bartypeDoubleLine
:
WriteStringAttribute
(
"type"
,
"doubleline"
);
break
;
case
bartypeArrowLeft
:
WriteStringAttribute
(
"type"
,
"arrow-left"
);
break
;
case
bartypeArrowRight
:
WriteStringAttribute
(
"type"
,
"arrow-right"
);
break
;
case
bartypeArrowDouble
:
WriteStringAttribute
(
"type"
,
"arrow-double"
);
break
;
}
WriteBoolAttribute
(
"top"
,
bTop
);
WriteNodeEnd
(
false
);
}
}
WriteBoolAttribute
(
"top"
,
bTop
);
WriteNodeEnd
(
false
);
}
virtual
void
EndBar
()
{
PopCommand
();
WriteNodeEnd
(
"bar"
);
}
virtual
void
BeginArrow
(
MARROWTYPE
eType
,
bool
bTop
)
{
PushCommand
(
commandArrow
);
WriteNodeBegin
(
"arrow"
,
true
);
switch
(
eType
)
{
virtual
void
BeginArrow
(
MARROWTYPE
eType
,
bool
bTop
)
{
PushCommand
(
commandArrow
);
WriteNodeBegin
(
"arrow"
,
true
);
switch
(
eType
)
{
case
arrowtypeLeft
:
WriteStringAttribute
(
"type"
,
"left"
);
break
;
case
arrowtypeRight
:
WriteStringAttribute
(
"type"
,
"right"
);
break
;
case
arrowtypeDouble
:
WriteStringAttribute
(
"type"
,
"double"
);
break
;
}
WriteBoolAttribute
(
"top"
,
bTop
);
WriteNodeEnd
(
false
);
}
case
arrowtypeDouble
:
WriteStringAttribute
(
"type"
,
"double"
);
break
;
}
WriteBoolAttribute
(
"top"
,
bTop
);
WriteNodeEnd
(
false
);
}
virtual
void
EndArrow
()
{
PopCommand
();
WriteNodeEnd
(
"arrow"
);
}
virtual
void
BeginIntegral
(
MINTEGRALTYPE
eType
)
{
PushCommand
(
commandIntegral
);
WriteNodeBegin
(
"integral"
,
true
);
virtual
void
BeginIntegral
(
MINTEGRALTYPE
eType
)
{
PushCommand
(
commandIntegral
);
WriteNodeBegin
(
"integral"
,
true
);
switch
(
eType
)
{
case
integraltypeSingle
:
WriteStringAttribute
(
"type"
,
"Single"
);
break
;
...
...
@@ -410,10 +410,10 @@ namespace MathEquation
case
integraltypeTripleOrientedCSub
:
WriteStringAttribute
(
"type"
,
"TripleOrientedCSub"
);
break
;
case
integraltypeTripleCSub
:
WriteStringAttribute
(
"type"
,
"TripleCSub"
);
break
;
}
WriteNodeEnd
(
false
);
}
}
WriteNodeEnd
(
false
);
}
virtual
void
EndIntegral
()
{
PopCommand
();
...
...
@@ -431,12 +431,12 @@ namespace MathEquation
PopCommand
();
WriteNodeEnd
(
"verticalbrace"
);
}
virtual
void
BeingNArray
(
MNARRAYTYPE
eType
)
{
CNArrayCommand
*
pCommand
=
(
CNArrayCommand
*
)
PushCommand
(
commandNArray
);
pCommand
->
SetType
(
eType
);
switch
(
eType
)
virtual
void
BeingNArray
(
MNARRAYTYPE
eType
)
{
CNArrayCommand
*
pCommand
=
(
CNArrayCommand
*
)
PushCommand
(
commandNArray
);
pCommand
->
SetType
(
eType
);
switch
(
eType
)
{
case
narySumCSub
:
WriteNodeBegin
(
"sum"
,
true
);
WriteStringAttribute
(
"type"
,
"CSub"
);
break
;
case
narySumCSubSup
:
WriteNodeBegin
(
"sum"
,
true
);
WriteStringAttribute
(
"type"
,
"CSubSup"
);
break
;
...
...
@@ -467,18 +467,18 @@ namespace MathEquation
case
naryIntersect
:
WriteNodeBegin
(
"intersect"
,
true
);
WriteStringAttribute
(
"type"
,
"regular"
);
break
;
case
naryIntersectRSub
:
WriteNodeBegin
(
"intersect"
,
true
);
WriteStringAttribute
(
"type"
,
"RSub"
);
break
;
case
naryIntersectRSubSup
:
WriteNodeBegin
(
"intersect"
,
true
);
WriteStringAttribute
(
"type"
,
"RSubSup"
);
break
;
}
WriteNodeEnd
(
false
);
}
}
WriteNodeEnd
(
false
);
}
virtual
void
EndNArray
()
{
CNArrayCommand
*
pCommand
=
(
CNArrayCommand
*
)
TopCommand
();
MNARRAYTYPE
eType
=
pCommand
->
GetType
();
PopCommand
();
switch
(
eType
)
CNArrayCommand
*
pCommand
=
(
CNArrayCommand
*
)
TopCommand
();
MNARRAYTYPE
eType
=
pCommand
->
GetType
();
PopCommand
();
switch
(
eType
)
{
case
narySumCSub
:
case
narySumCSubSup
:
...
...
@@ -515,25 +515,25 @@ namespace MathEquation
case
naryIntersectRSubSup
:
WriteNodeEnd
(
"intersect"
);
break
;
}
}
}
virtual
void
BeginLongDivision
(
MLONGDIVISION
eType
)
{
PushCommand
(
commandLongDivision
);
WriteNodeBegin
(
"longdivision"
);
}
virtual
void
BeginLongDivision
(
MLONGDIVISION
eType
)
{
PushCommand
(
commandLongDivision
);
WriteNodeBegin
(
"longdivision"
);
}
virtual
void
EndLongDivision
()
{
PopCommand
();
WriteNodeEnd
(
"longdivision"
);
WriteNodeEnd
(
"longdivision"
);
}
virtual
void
BeginAngleBracketsWithSeparator
(
MANGLEBRACKETSWITHSEPARATORTYPE
eType
)
{
CBracketsWithSeparatorCommand
*
pCommand
=
(
CBracketsWithSeparatorCommand
*
)
PushCommand
(
commandBracketsSep
);
pCommand
->
SetType
(
eType
);
WriteNodeBegin
(
"brackets-separator"
);
}
virtual
void
BeginAngleBracketsWithSeparator
(
MANGLEBRACKETSWITHSEPARATORTYPE
eType
)
{
CBracketsWithSeparatorCommand
*
pCommand
=
(
CBracketsWithSeparatorCommand
*
)
PushCommand
(
commandBracketsSep
);
pCommand
->
SetType
(
eType
);
WriteNodeBegin
(
"brackets-separator"
);
}
virtual
void
EndAngleBracketsWithSeparator
()
{
PopCommand
();
...
...
@@ -1099,7 +1099,7 @@ namespace MathEquation
rRet
+=
sValue
;
rRet
+=
"
\"
"
;
}
void
WriteStringAttribute
(
const
char
*
sName
,
Unicode_
t
uChar
)
void
WriteStringAttribute
(
const
char
*
sName
,
unsigned
shor
t
uChar
)
{
rRet
+=
" "
;
rRet
+=
sName
;
...
...
@@ -1112,7 +1112,7 @@ namespace MathEquation
rRet
+=
" "
;
rRet
+=
sName
;
rRet
+=
"=
\"
"
;
rRet
+=
String
::
CreateFromInt32
(
nValue
);
rRet
+=
String
::
CreateFromInt32
(
nValue
);
rRet
+=
"
\"
"
;
}
private:
...
...
@@ -1125,4 +1125,4 @@ namespace MathEquation
}
#endif
\ No newline at end of file
#endif
Common/DocxFormat/Source/MathEquation/Types.h
View file @
1ee1e2e2
...
...
@@ -38,9 +38,6 @@
namespace
MathEquation
{
typedef
unsigned
short
Unicode_t
;
typedef
signed
char
Char_t
;
struct
TMathFont
{
std
::
string
sName
;
...
...
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