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
721bb7bf
Commit
721bb7bf
authored
Aug 23, 2016
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RtfFormatWriter - jc in math
parent
b4f28733
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
14 deletions
+38
-14
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXMathReader.cpp
...fficeRtfFile/RtfFormatLib/source/Reader/OOXMathReader.cpp
+27
-7
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXParagraphElementReaders.cpp
...RtfFormatLib/source/Reader/OOXParagraphElementReaders.cpp
+11
-0
ASCOfficeRtfFile/RtfFormatLib/source/RtfMath.cpp
ASCOfficeRtfFile/RtfFormatLib/source/RtfMath.cpp
+0
-7
No files found.
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXMathReader.cpp
View file @
721bb7bf
...
@@ -750,6 +750,26 @@ bool OOXMathReader::ParseElement(ReaderParameter oParam , OOX::WritingElement *
...
@@ -750,6 +750,26 @@ bool OOXMathReader::ParseElement(ReaderParameter oParam , OOX::WritingElement *
}
}
}
}
}
break
;
}
break
;
case
OOX
:
:
et_m_jc
:
{
OOX
::
Logic
::
CMathBottomNodes
<
SimpleTypes
::
CMJc
<>>*
ooxElemMJc
=
dynamic_cast
<
OOX
::
Logic
::
CMathBottomNodes
<
SimpleTypes
::
CMJc
<>>*>
(
ooxMath
);
if
((
ooxElemMJc
)
&&
(
ooxElemMJc
->
m_val
.
IsInit
()))
{
RtfCharPtr
oChar
=
RtfCharPtr
(
new
RtfChar
);
switch
(
ooxElemMJc
->
m_val
->
GetValue
())
{
case
SimpleTypes
:
:
mjcCenter
:
oChar
->
setText
(
L"2"
);
break
;
case
SimpleTypes
:
:
mjcCenterGroup
:
oChar
->
setText
(
L"1"
);
break
;
case
SimpleTypes
:
:
mjcLeft
:
oChar
->
setText
(
L"3"
);
break
;
case
SimpleTypes
:
:
mjcRight
:
oChar
->
setText
(
L"4"
);
break
;
}
rtfMath
->
m_oVal
.
AddItem
(
oChar
);
rtfMath
->
m_bIsVal
=
true
;
}
}
break
;
default:
default:
{
{
OOX
::
Logic
::
CMathBottomNodes
<
SimpleTypes
::
COnOff
<>>*
ooxElemBool
=
OOX
::
Logic
::
CMathBottomNodes
<
SimpleTypes
::
COnOff
<>>*
ooxElemBool
=
...
@@ -791,9 +811,6 @@ bool OOXMathReader::ParseElement(ReaderParameter oParam , OOX::WritingElement *
...
@@ -791,9 +811,6 @@ bool OOXMathReader::ParseElement(ReaderParameter oParam , OOX::WritingElement *
OOX
::
Logic
::
CMathBottomNodes
<
SimpleTypes
::
CXAlign
<>>*
ooxElemXAlign
=
OOX
::
Logic
::
CMathBottomNodes
<
SimpleTypes
::
CXAlign
<>>*
ooxElemXAlign
=
dynamic_cast
<
OOX
::
Logic
::
CMathBottomNodes
<
SimpleTypes
::
CXAlign
<>>*>
(
ooxMath
);
dynamic_cast
<
OOX
::
Logic
::
CMathBottomNodes
<
SimpleTypes
::
CXAlign
<>>*>
(
ooxMath
);
OOX
::
Logic
::
CMathBottomNodes
<
SimpleTypes
::
CMJc
<>>*
ooxElemMJc
=
dynamic_cast
<
OOX
::
Logic
::
CMathBottomNodes
<
SimpleTypes
::
CMJc
<>>*>
(
ooxMath
);
OOX
::
Logic
::
CMathBottomNodes
<
SimpleTypes
::
CInteger2
<>>*
ooxElemInteger2
=
OOX
::
Logic
::
CMathBottomNodes
<
SimpleTypes
::
CInteger2
<>>*
ooxElemInteger2
=
dynamic_cast
<
OOX
::
Logic
::
CMathBottomNodes
<
SimpleTypes
::
CInteger2
<>>*>
(
ooxMath
);
dynamic_cast
<
OOX
::
Logic
::
CMathBottomNodes
<
SimpleTypes
::
CInteger2
<>>*>
(
ooxMath
);
...
@@ -810,6 +827,7 @@ bool OOXMathReader::ParseElement(ReaderParameter oParam , OOX::WritingElement *
...
@@ -810,6 +827,7 @@ bool OOXMathReader::ParseElement(ReaderParameter oParam , OOX::WritingElement *
dynamic_cast
<
OOX
::
WritingElementWithChilds
<
OOX
::
WritingElement
>*>
(
ooxMath
);
dynamic_cast
<
OOX
::
WritingElementWithChilds
<
OOX
::
WritingElement
>*>
(
ooxMath
);
//----------------------------------
//----------------------------------
nullable
<
CString
>
sVal
;
nullable
<
CString
>
sVal
;
if
((
ooxElemBool
)
&&
(
ooxElemBool
->
m_val
.
IsInit
()))
sVal
=
ooxElemBool
->
m_val
->
ToString2
(
SimpleTypes
::
onofftostringOn
);
if
((
ooxElemBool
)
&&
(
ooxElemBool
->
m_val
.
IsInit
()))
sVal
=
ooxElemBool
->
m_val
->
ToString2
(
SimpleTypes
::
onofftostringOn
);
else
if
((
ooxElemChar
)
&&
(
ooxElemChar
->
m_val
.
IsInit
()))
sVal
=
ooxElemChar
->
m_val
->
GetValue
();
else
if
((
ooxElemChar
)
&&
(
ooxElemChar
->
m_val
.
IsInit
()))
sVal
=
ooxElemChar
->
m_val
->
GetValue
();
else
if
((
ooxElemMeasure
)
&&
(
ooxElemMeasure
->
m_val
.
IsInit
()))
sVal
=
ooxElemMeasure
->
m_val
->
ToString
();
else
if
((
ooxElemMeasure
)
&&
(
ooxElemMeasure
->
m_val
.
IsInit
()))
sVal
=
ooxElemMeasure
->
m_val
->
ToString
();
...
@@ -823,7 +841,6 @@ bool OOXMathReader::ParseElement(ReaderParameter oParam , OOX::WritingElement *
...
@@ -823,7 +841,6 @@ bool OOXMathReader::ParseElement(ReaderParameter oParam , OOX::WritingElement *
else
if
((
ooxElemScript
)
&&
(
ooxElemScript
->
m_val
.
IsInit
()))
sVal
=
ooxElemScript
->
m_val
->
ToString
();
else
if
((
ooxElemScript
)
&&
(
ooxElemScript
->
m_val
.
IsInit
()))
sVal
=
ooxElemScript
->
m_val
->
ToString
();
else
if
((
ooxElemSpacingRule
)
&&
(
ooxElemSpacingRule
->
m_val
.
IsInit
()))
sVal
=
ooxElemSpacingRule
->
m_val
->
ToString
();
else
if
((
ooxElemSpacingRule
)
&&
(
ooxElemSpacingRule
->
m_val
.
IsInit
()))
sVal
=
ooxElemSpacingRule
->
m_val
->
ToString
();
else
if
((
ooxElemXAlign
)
&&
(
ooxElemXAlign
->
m_val
.
IsInit
()))
sVal
=
ooxElemXAlign
->
m_val
->
ToString
();
else
if
((
ooxElemXAlign
)
&&
(
ooxElemXAlign
->
m_val
.
IsInit
()))
sVal
=
ooxElemXAlign
->
m_val
->
ToString
();
else
if
((
ooxElemMJc
)
&&
(
ooxElemMJc
->
m_val
.
IsInit
()))
sVal
=
ooxElemMJc
->
m_val
->
ToString
();
else
if
((
ooxElemInteger2
)
&&
(
ooxElemInteger2
->
m_val
.
IsInit
()))
sVal
=
ooxElemInteger2
->
m_val
->
ToString
();
else
if
((
ooxElemInteger2
)
&&
(
ooxElemInteger2
->
m_val
.
IsInit
()))
sVal
=
ooxElemInteger2
->
m_val
->
ToString
();
else
if
((
ooxElemYAlign
)
&&
(
ooxElemYAlign
->
m_val
.
IsInit
()))
sVal
=
ooxElemYAlign
->
m_val
->
ToString
();
else
if
((
ooxElemYAlign
)
&&
(
ooxElemYAlign
->
m_val
.
IsInit
()))
sVal
=
ooxElemYAlign
->
m_val
->
ToString
();
else
if
((
ooxElemBreakBin
)
&&
(
ooxElemBreakBin
->
m_val
.
IsInit
()))
sVal
=
ooxElemBreakBin
->
m_val
->
ToString
();
else
if
((
ooxElemBreakBin
)
&&
(
ooxElemBreakBin
->
m_val
.
IsInit
()))
sVal
=
ooxElemBreakBin
->
m_val
->
ToString
();
...
@@ -838,8 +855,11 @@ bool OOXMathReader::ParseElement(ReaderParameter oParam , OOX::WritingElement *
...
@@ -838,8 +855,11 @@ bool OOXMathReader::ParseElement(ReaderParameter oParam , OOX::WritingElement *
else
if
(
sVal
.
IsInit
())
else
if
(
sVal
.
IsInit
())
{
{
rtfMath
->
m_bIsVal
=
true
;
rtfMath
->
m_bIsVal
=
true
;
RtfCharPtr
oChar
=
RtfCharPtr
(
new
RtfChar
);
RtfCharPtr
oChar
=
RtfCharPtr
(
new
RtfChar
);
oChar
->
setText
(
*
sVal
);
if
(
!
sVal
->
IsEmpty
())
oChar
->
setText
(
L" "
+
*
sVal
);
rtfMath
->
m_oVal
.
AddItem
(
oChar
);
rtfMath
->
m_oVal
.
AddItem
(
oChar
);
}
}
else
else
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXParagraphElementReaders.cpp
View file @
721bb7bf
...
@@ -315,6 +315,17 @@ bool OOXParagraphReader::Parse2( ReaderParameter oParam , RtfParagraph& oOutputP
...
@@ -315,6 +315,17 @@ bool OOXParagraphReader::Parse2( ReaderParameter oParam , RtfParagraph& oOutputP
m_oRunReader
.
Parse
(
oParam
,
oOutputParagraph
,
poExternalStyle
);
m_oRunReader
.
Parse
(
oParam
,
oOutputParagraph
,
poExternalStyle
);
}
}
}
break
;
}
break
;
case
OOX
:
:
et_m_oMath
:
{
OOX
::
Logic
::
COMath
*
pMath
=
dynamic_cast
<
OOX
::
Logic
::
COMath
*>
(
m_ooxElement
->
m_arrItems
[
i
]);
RtfMathPtr
oNewMath
(
new
RtfMath
()
);
oNewMath
->
SetOOXType
(
OOX
::
et_m_oMath
);
OOXMathReader
oMathRreader
(
pMath
);
if
(
true
==
oMathRreader
.
Parse
(
oParam
,
(
*
oNewMath
)
)
)
oOutputParagraph
.
AddItem
(
oNewMath
);
}
break
;
case
OOX
:
:
et_m_oMathPara
:
case
OOX
:
:
et_m_oMathPara
:
{
{
OOX
::
Logic
::
COMathPara
*
pMathPara
=
dynamic_cast
<
OOX
::
Logic
::
COMathPara
*>
(
m_ooxElement
->
m_arrItems
[
i
]);
OOX
::
Logic
::
COMathPara
*
pMathPara
=
dynamic_cast
<
OOX
::
Logic
::
COMathPara
*>
(
m_ooxElement
->
m_arrItems
[
i
]);
...
...
ASCOfficeRtfFile/RtfFormatLib/source/RtfMath.cpp
View file @
721bb7bf
...
@@ -95,19 +95,12 @@ CString RtfMath::RenderToRtf(RenderParameter oRenderParameter)
...
@@ -95,19 +95,12 @@ CString RtfMath::RenderToRtf(RenderParameter oRenderParameter)
sResult
.
AppendFormat
(
_T
(
"{
\\
%ls"
),
m_sRtfName
.
GetBuffer
());
sResult
.
AppendFormat
(
_T
(
"{
\\
%ls"
),
m_sRtfName
.
GetBuffer
());
RenderParameter
oNewParameter
=
oRenderParameter
;
RenderParameter
oNewParameter
=
oRenderParameter
;
if
(
m_sRtfName
==
L"mctrlPr"
)
{
m_bIsVal
=
m_bIsVal
;
}
CString
sVal
;
CString
sVal
;
if
(
m_bIsVal
)
if
(
m_bIsVal
)
{
{
oNewParameter
.
nType
=
RENDER_TO_RTF_PARAM_CHAR
;
oNewParameter
.
nType
=
RENDER_TO_RTF_PARAM_CHAR
;
sVal
=
m_oVal
.
RenderToRtf
(
oNewParameter
)
;
sVal
=
m_oVal
.
RenderToRtf
(
oNewParameter
)
;
if
(
!
sVal
.
IsEmpty
())
sVal
=
_T
(
" "
)
+
sVal
;
}
}
else
else
{
{
...
...
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