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
4e193650
Commit
4e193650
authored
Apr 24, 2016
by
ElenaSubbotina
Committed by
Alexander Trofimov
May 21, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RtfFormatWriter - поправлена конвертация стилей математических формул
parent
d9b5b56b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
42 deletions
+31
-42
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXMathReader.cpp
...fficeRtfFile/RtfFormatLib/source/Reader/OOXMathReader.cpp
+14
-20
ASCOfficeRtfFile/RtfFormatLib/source/RtfChar.h
ASCOfficeRtfFile/RtfFormatLib/source/RtfChar.h
+13
-5
ASCOfficeRtfFile/RtfFormatLib/source/RtfMath.cpp
ASCOfficeRtfFile/RtfFormatLib/source/RtfMath.cpp
+4
-17
No files found.
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXMathReader.cpp
View file @
4e193650
...
...
@@ -19,23 +19,6 @@ bool OOXMathReader::ParseElement(ReaderParameter oParam , OOX::WritingElement *
switch
(
ooxTypeElement
)
{
case
OOX
:
:
et_w_rPr
:
{
OOX
::
Logic
::
CRunProperty
*
ooxRPr
=
dynamic_cast
<
OOX
::
Logic
::
CRunProperty
*>
(
ooxMath
);
if
(
ooxRPr
)
{
RtfCharProperty
oCurrentProp
;
oCurrentProp
.
SetDefaultOOX
();
OOXrPrReader
orPrReader
(
ooxRPr
);
orPrReader
.
Parse
(
oParam
,
oCurrentProp
);
RtfCharPtr
oChar
=
RtfCharPtr
(
new
RtfChar
);
oChar
->
m_oProperty
=
oCurrentProp
;
rtfMath
->
m_oVal
.
AddItem
(
oChar
);
}
}
break
;
case
OOX
:
:
et_m_r
:
{
RtfCharProperty
oCurrentProp
;
...
...
@@ -720,9 +703,20 @@ bool OOXMathReader::ParseElement(ReaderParameter oParam , OOX::WritingElement *
OOX
::
Logic
::
CCtrlPr
*
ooxSubMath
=
dynamic_cast
<
OOX
::
Logic
::
CCtrlPr
*>
(
ooxMath
);
if
(
ooxSubMath
)
{
RtfMathPtr
oSubMath
;
if
(
ParseElement
(
oParam
,
ooxSubMath
->
m_oRPr
.
GetPointer
(),
oSubMath
))
rtfMath
->
AddItem
(
oSubMath
);
OOX
::
Logic
::
CRunProperty
*
ooxRPr
=
dynamic_cast
<
OOX
::
Logic
::
CRunProperty
*>
(
ooxSubMath
->
m_oRPr
.
GetPointer
());
if
(
ooxRPr
)
{
RtfCharProperty
oCurrentProp
;
oCurrentProp
.
SetDefaultOOX
();
OOXrPrReader
orPrReader
(
ooxRPr
);
orPrReader
.
Parse
(
oParam
,
oCurrentProp
);
RtfCharPtr
oChar
=
RtfCharPtr
(
new
RtfChar
);
oChar
->
m_oProperty
=
oCurrentProp
;
rtfMath
->
AddItem
(
oChar
);
}
}
}
break
;
default:
...
...
ASCOfficeRtfFile/RtfFormatLib/source/RtfChar.h
View file @
4e193650
...
...
@@ -328,12 +328,20 @@ public:
sText
=
renderRtfText
(
m_sChars
,
oRenderParameter
.
poDocument
,
&
m_oProperty
);
else
sText
=
m_sChars
;
if
(
_T
(
""
)
!=
sText
)
CString
sTextProp
=
m_oProperty
.
RenderToRtf
(
oRenderParameter
)
;
if
(
!
sText
.
IsEmpty
()
||
!
sTextProp
.
IsEmpty
())
{
result
.
Append
(
_T
(
"{"
));
result
.
Append
(
m_oProperty
.
RenderToRtf
(
oRenderParameter
)
);
result
.
Append
(
_T
(
" "
)
+
sText
);
result
.
Append
(
_T
(
"}"
));
if
(
oRenderParameter
.
nType
!=
RENDER_TO_RTF_PARAM_NESTED
)
result
.
Append
(
_T
(
"{"
));
result
.
Append
(
sTextProp
);
result
.
Append
(
_T
(
" "
));
result
.
Append
(
sText
);
if
(
oRenderParameter
.
nType
!=
RENDER_TO_RTF_PARAM_NESTED
)
result
.
Append
(
_T
(
"}"
));
}
}
return
result
;
...
...
ASCOfficeRtfFile/RtfFormatLib/source/RtfMath.cpp
View file @
4e193650
...
...
@@ -64,18 +64,11 @@ CString RtfMath::RenderToRtf(RenderParameter oRenderParameter)
sResult
.
AppendFormat
(
_T
(
"{
\\
%ls"
),
m_sRtfName
.
GetBuffer
());
RenderParameter
oNewParameter
=
oRenderParameter
;
//oNewParameter.nType = RENDER_TO_RTF_PARAM_UNKNOWN;
//sResult.Append( m_oProperty.RenderToRtf( oNewParameter ) );
if
(
m_sRtfName
==
L"mctrlPr"
)
{
m_bIsVal
=
m_bIsVal
;
}
//if( _T("mr") == m_sRtfName )
//{
// oNewParameter.nType = RENDER_TO_RTF_PARAM_UNKNOWN;
// sResult.Append( _T(" ") );
// for( int i = 0; i < m_oVal.size(); i++ )
// sResult.Append( _T(" ") + m_oVal[i]->RenderToRtf( oNewParameter ) );
//}
//else
//if (this->m_bIsVal)
CString
sVal
;
if
(
m_bIsVal
)
...
...
@@ -120,12 +113,6 @@ CString RtfMath::RenderToOOX(RenderParameter oRenderParameter)
RenderParameter
oNewParam
=
oRenderParameter
;
//oNewParam.nType = RENDER_TO_OOX_PARAM_TEXT;
//sProp = m_oProperty.RenderToOOX( oNewParam );
//oNewParam.nType = RENDER_TO_OOX_PARAM_PLAIN;
//sVal = m_oVal.RenderToOOX( oNewParam );
if
(
m_bIsVal
||
m_bIsBool
)
{
oNewParam
.
nType
=
RENDER_TO_OOX_PARAM_PLAIN
;
...
...
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