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
cc86bdb0
Commit
cc86bdb0
authored
Oct 10, 2016
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RtfFormatWriter - fix tables, styles, math
parent
fade21b8
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
79 additions
and
22 deletions
+79
-22
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXColorReader.h
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXColorReader.h
+6
-2
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXMathReader.cpp
...fficeRtfFile/RtfFormatLib/source/Reader/OOXMathReader.cpp
+37
-0
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXParagraphElementReaders.cpp
...RtfFormatLib/source/Reader/OOXParagraphElementReaders.cpp
+20
-4
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXStyleReader.h
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXStyleReader.h
+2
-2
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXtcPrReader.h
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXtcPrReader.h
+2
-2
ASCOfficeRtfFile/RtfFormatLib/source/RtfProperty.cpp
ASCOfficeRtfFile/RtfFormatLib/source/RtfProperty.cpp
+3
-3
ASCOfficeRtfFile/RtfFormatLib/source/RtfWriter.cpp
ASCOfficeRtfFile/RtfFormatLib/source/RtfWriter.cpp
+9
-9
No files found.
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXColorReader.h
View file @
cc86bdb0
...
...
@@ -105,9 +105,13 @@ public:
oOutputColor
.
SetTint
(
ooxColor
.
m_oThemeTint
->
GetValue
()
);
res
=
true
;
}
if
(
(
ooxColor
.
m_oVal
.
IsInit
())
&&
(
ooxColor
.
m_oVal
->
GetValue
()
==
SimpleTypes
::
hexcolorRGB
))
if
(
ooxColor
.
m_oVal
.
IsInit
(
))
{
if
(
ooxColor
.
m_oVal
->
GetValue
()
==
SimpleTypes
::
hexcolorRGB
)
oOutputColor
.
SetRGB
(
ooxColor
.
m_oVal
->
Get_R
(),
ooxColor
.
m_oVal
->
Get_G
(),
ooxColor
.
m_oVal
->
Get_B
());
if
(
ooxColor
.
m_oVal
->
GetValue
()
==
SimpleTypes
::
hexcolorAuto
)
oOutputColor
.
m_bAuto
=
true
;
res
=
true
;
}
return
res
;
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXMathReader.cpp
View file @
cc86bdb0
...
...
@@ -165,6 +165,43 @@ bool OOXMathReader::ParseElement(ReaderParameter oParam , OOX::WritingElement *
rtfMath
->
AddItem
(
oSubMath
);
}
}
break
;
case
OOX
:
:
et_m_box
:
{
OOX
::
Logic
::
CBox
*
ooxSubMath
=
dynamic_cast
<
OOX
::
Logic
::
CBox
*>
(
ooxMath
);
if
(
ooxSubMath
)
{
RtfMathPtr
oSubMath
;
if
(
ParseElement
(
oParam
,
ooxSubMath
->
m_oBoxPr
.
GetPointer
(),
oSubMath
))
rtfMath
->
AddItem
(
oSubMath
);
oSubMath
.
reset
();
if
(
ParseElement
(
oParam
,
ooxSubMath
->
m_oElement
.
GetPointer
(),
oSubMath
))
rtfMath
->
AddItem
(
oSubMath
);
}
}
break
;
case
OOX
:
:
et_m_boxPr
:
{
OOX
::
Logic
::
CBoxPr
*
ooxSubMath
=
dynamic_cast
<
OOX
::
Logic
::
CBoxPr
*>
(
ooxMath
);
if
(
ooxSubMath
)
{
RtfMathPtr
oSubMath
;
if
(
ParseElement
(
oParam
,
ooxSubMath
->
m_oCtrlPr
.
GetPointer
(),
oSubMath
))
rtfMath
->
AddItem
(
oSubMath
);
oSubMath
.
reset
();
if
(
ParseElement
(
oParam
,
ooxSubMath
->
m_oAln
.
GetPointer
(),
oSubMath
))
rtfMath
->
AddItem
(
oSubMath
);
oSubMath
.
reset
();
if
(
ParseElement
(
oParam
,
ooxSubMath
->
m_oBrk
.
GetPointer
(),
oSubMath
))
rtfMath
->
AddItem
(
oSubMath
);
oSubMath
.
reset
();
if
(
ParseElement
(
oParam
,
ooxSubMath
->
m_oDiff
.
GetPointer
(),
oSubMath
))
rtfMath
->
AddItem
(
oSubMath
);
//m_oNoBreak; m_oOpEmu;
}
}
break
;
case
OOX
:
:
et_m_dPr
:
{
OOX
::
Logic
::
CDelimiterPr
*
ooxSubMath
=
dynamic_cast
<
OOX
::
Logic
::
CDelimiterPr
*>
(
ooxMath
);
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXParagraphElementReaders.cpp
View file @
cc86bdb0
...
...
@@ -864,6 +864,17 @@ bool OOXpPrReader::Parse( ReaderParameter oParam ,RtfParagraphProperty& oOutputP
}
}
}
// ------------ test
//if( m_ooxParaProps->m_oPStyle.IsInit() && m_ooxParaProps->m_oPStyle->m_sVal.IsInit())
//{
// CString sStyleName = m_ooxParaProps->m_oPStyle->m_sVal.get2();
// RtfStylePtr oCurStyle;
// if( true == oParam.oRtf->m_oStyleTable.GetStyle(sStyleName, oCurStyle) )
// {
// oOutputProperty.m_nStyle = oCurStyle->m_nID;
// }
//}
// ------------ test
if
(
m_ooxParaProps
->
m_oSuppressAutoHyphens
.
IsInit
()
)
{
if
(
m_ooxParaProps
->
m_oSuppressAutoHyphens
->
m_oVal
.
ToBool
())
...
...
@@ -965,6 +976,11 @@ bool OOXpPrReader::Parse( ReaderParameter oParam ,RtfParagraphProperty& oOutputP
oOutputProperty
.
m_nSpaceBetween
=
m_ooxParaProps
->
m_oSpacing
->
m_oLine
->
ToTwips
();
oOutputProperty
.
m_nSpaceMultiLine
=
0
;
}
else
//auto
{
oOutputProperty
.
m_nSpaceBetween
=
m_ooxParaProps
->
m_oSpacing
->
m_oLine
->
ToTwips
();
oOutputProperty
.
m_nSpaceMultiLine
=
1
;
}
}
}
else
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXStyleReader.h
View file @
cc86bdb0
...
...
@@ -122,8 +122,8 @@ public:
CcnfStyle
style
;
opPrReader
.
Parse
(
oParam
,
oNewParStyle
->
m_oParProp
,
style
);
oNewParStyle
->
m_oParProp
.
m_nListId
=
PROP_DEF
;
//экспериментально вроде нельзя иметь numbering в параграф стиле
oNewParStyle
->
m_oParProp
.
m_nListLevel
=
PROP_DEF
;
//
oNewParStyle->m_oParProp.m_nListId = PROP_DEF; //экспериментально вроде нельзя иметь numbering в параграф стиле
//
oNewParStyle->m_oParProp.m_nListLevel = PROP_DEF;
}
if
(
m_ooxStyle
->
m_oTblPr
.
IsInit
()
&&
RtfStyle
::
stTable
==
eStyleType
)
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXtcPrReader.h
View file @
cc86bdb0
...
...
@@ -74,9 +74,9 @@ public:
case
SimpleTypes
:
:
mergeRestart
:
oOutputProperty
.
m_bMergeFirst
=
1
;
break
;
}
}
if
(
m_ooxTableCellProps
->
m_oVMerge
.
IsInit
()
&&
m_ooxTableCellProps
->
m_oVMerge
->
m_oVal
.
IsInit
()
)
if
(
m_ooxTableCellProps
->
m_oVMerge
.
IsInit
())
{
if
(
m_ooxTableCellProps
->
m_oVMerge
->
m_oVal
->
GetValue
()
==
SimpleTypes
::
mergeRestart
)
if
((
m_ooxTableCellProps
->
m_oVMerge
->
m_oVal
.
IsInit
())
&&
(
m_ooxTableCellProps
->
m_oVMerge
->
m_oVal
->
GetValue
()
==
SimpleTypes
::
mergeRestart
)
)
oOutputProperty
.
m_bMergeFirstVertical
=
1
;
else
oOutputProperty
.
m_bMergeVertical
=
1
;
...
...
ASCOfficeRtfFile/RtfFormatLib/source/RtfProperty.cpp
View file @
cc86bdb0
...
...
@@ -1676,9 +1676,9 @@ CString RtfFrame::RenderToOOX(RenderParameter oRenderParameter)
CString
RtfParagraphProperty
::
RenderToRtf
(
RenderParameter
oRenderParameter
)
{
CString
sResult
;
//RENDER_RTF_INT( m_nStyle, sResult, _T("s") );
RENDER_RTF_BOOL
(
m_bAutoHyphenation
,
sResult
,
_T
(
"hyphpar"
)
);
RENDER_RTF_BOOL
(
m_bInTable
,
sResult
,
_T
(
"intbl"
)
);
RENDER_RTF_INT
(
m_nStyle
,
sResult
,
_T
(
"s"
)
);
//test
RENDER_RTF_BOOL
(
m_bAutoHyphenation
,
sResult
,
_T
(
"hyphpar"
)
);
RENDER_RTF_BOOL
(
m_bInTable
,
sResult
,
_T
(
"intbl"
)
);
if
(
PROP_DEF
!=
m_nItap
&&
1
!=
m_nItap
)
sResult
.
AppendFormat
(
_T
(
"
\\
itap%d"
),
m_nItap
);
...
...
ASCOfficeRtfFile/RtfFormatLib/source/RtfWriter.cpp
View file @
cc86bdb0
...
...
@@ -283,15 +283,15 @@ CString RtfWriter::CreateRtfStart()
sResult
+=
m_oDocument
.
m_oProperty
.
RenderToRtf
(
oRenderParameter
);
sResult
+=
m_oDocument
.
m_oFontTable
.
RenderToRtf
(
oRenderParameter
);
sResult
+=
m_oDocument
.
m_oColorTable
.
RenderToRtf
(
oRenderParameter
);
//
CString sDefCharProp = m_oDocument.m_oDefaultCharProp.RenderToRtf( oRenderParameter );
//
if( false == sDefCharProp.IsEmpty() )
//
sResult += _T("{\\*\\defchp ") + sDefCharProp + _T("}");
//
CString sDefParProp = m_oDocument.m_oDefaultParagraphProp.RenderToRtf( oRenderParameter );
//
if( false == sDefParProp.IsEmpty() )
//
sResult += _T("{\\*\\defpap ") + sDefParProp+ _T("}");
//sResult += m_oDocument.m_oStyleTable.RenderToRtf( oRenderParameter )
);
//---------- test
CString
sDefCharProp
=
m_oDocument
.
m_oDefaultCharProp
.
RenderToRtf
(
oRenderParameter
);
if
(
false
==
sDefCharProp
.
IsEmpty
()
)
sResult
+=
_T
(
"{
\\
*
\\
defchp "
)
+
sDefCharProp
+
_T
(
"}"
);
CString
sDefParProp
=
m_oDocument
.
m_oDefaultParagraphProp
.
RenderToRtf
(
oRenderParameter
);
if
(
false
==
sDefParProp
.
IsEmpty
()
)
sResult
+=
_T
(
"{
\\
*
\\
defpap "
)
+
sDefParProp
+
_T
(
"}"
);
sResult
+=
m_oDocument
.
m_oStyleTable
.
RenderToRtf
(
oRenderParameter
);
//---------- test
sResult
+=
m_oDocument
.
m_oListTabel
.
RenderToRtf
(
oRenderParameter
);
sResult
+=
m_oDocument
.
m_oListOverrideTabel
.
RenderToRtf
(
oRenderParameter
);
sResult
+=
m_oDocument
.
m_oInformation
.
RenderToRtf
(
oRenderParameter
);
...
...
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