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
6361ee6f
Commit
6361ee6f
authored
Nov 13, 2016
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RtfFormatWriter - review
parent
bf0b5a4b
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
193 additions
and
49 deletions
+193
-49
ASCOfficeRtfFile/RtfFormatLib/source/Basic.h
ASCOfficeRtfFile/RtfFormatLib/source/Basic.h
+2
-0
ASCOfficeRtfFile/RtfFormatLib/source/DestinationCommand.cpp
ASCOfficeRtfFile/RtfFormatLib/source/DestinationCommand.cpp
+2
-2
ASCOfficeRtfFile/RtfFormatLib/source/DestinationCommand.h
ASCOfficeRtfFile/RtfFormatLib/source/DestinationCommand.h
+3
-3
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXAbstractNumReader.h
...RtfFile/RtfFormatLib/source/Reader/OOXAbstractNumReader.h
+1
-1
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXDocumentReader.h
...iceRtfFile/RtfFormatLib/source/Reader/OOXDocumentReader.h
+1
-1
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXNumberingMapReader.h
...tfFile/RtfFormatLib/source/Reader/OOXNumberingMapReader.h
+1
-1
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXNumberingReader.h
...ceRtfFile/RtfFormatLib/source/Reader/OOXNumberingReader.h
+2
-2
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXParagraphElementReaders.cpp
...RtfFormatLib/source/Reader/OOXParagraphElementReaders.cpp
+76
-2
ASCOfficeRtfFile/RtfFormatLib/source/RtfDocument.h
ASCOfficeRtfFile/RtfFormatLib/source/RtfDocument.h
+2
-2
ASCOfficeRtfFile/RtfFormatLib/source/RtfGlobalTables.h
ASCOfficeRtfFile/RtfFormatLib/source/RtfGlobalTables.h
+21
-14
ASCOfficeRtfFile/RtfFormatLib/source/RtfProperty.cpp
ASCOfficeRtfFile/RtfFormatLib/source/RtfProperty.cpp
+42
-14
ASCOfficeRtfFile/RtfFormatLib/source/RtfWriter.cpp
ASCOfficeRtfFile/RtfFormatLib/source/RtfWriter.cpp
+4
-3
ASCOfficeRtfFile/RtfFormatLib/source/Utils.h
ASCOfficeRtfFile/RtfFormatLib/source/Utils.h
+34
-2
ASCOfficeRtfFile/RtfFormatLib/source/Writer/OOXDocumentWriter.cpp
...eRtfFile/RtfFormatLib/source/Writer/OOXDocumentWriter.cpp
+2
-2
No files found.
ASCOfficeRtfFile/RtfFormatLib/source/Basic.h
View file @
6361ee6f
...
...
@@ -120,6 +120,8 @@ public:
}
int
Find
(
T
piRend
)
{
//todooo - add map for seach
for
(
int
i
=
0
;
i
<
(
int
)
m_aArray
.
size
();
i
++
)
if
(
m_aArray
[
i
]
==
piRend
)
return
i
;
...
...
ASCOfficeRtfFile/RtfFormatLib/source/DestinationCommand.cpp
View file @
6361ee6f
...
...
@@ -2317,7 +2317,7 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead
else
if
(
L"pntext"
==
sCommand
)
{
//пропускаем списки office 95, если есть списки office 2007
if
(
oDocument
.
m_oListTab
el
.
GetCount
()
>
0
)
if
(
oDocument
.
m_oListTab
le
.
GetCount
()
>
0
)
oAbstrReader
.
Skip
(
oDocument
,
oReader
);
else
{
...
...
@@ -2334,7 +2334,7 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead
}
else
if
(
L"pn"
==
sCommand
)
{
if
(
oDocument
.
m_oListTab
el
.
GetCount
()
>
0
)
if
(
oDocument
.
m_oListTab
le
.
GetCount
()
>
0
)
oAbstrReader
.
Skip
(
oDocument
,
oReader
);
else
{
...
...
ASCOfficeRtfFile/RtfFormatLib/source/DestinationCommand.h
View file @
6361ee6f
...
...
@@ -2146,7 +2146,7 @@ public:
RtfShppictReader
oShppictReader
(
*
oNewPicture
);
StartSubReader
(
oShppictReader
,
oDocument
,
oReader
);
oDocument
.
m_oListTab
el
.
m_aPictureList
.
AddItem
(
oNewPicture
);
oDocument
.
m_oListTab
le
.
m_aPictureList
.
AddItem
(
oNewPicture
);
}
else
return
false
;
...
...
@@ -2168,7 +2168,7 @@ public:
bool
bResult
=
StartSubReader
(
oListReader
,
oDocument
,
oReader
);
if
(
true
==
bResult
)
{
oDocument
.
m_oListTab
el
.
AddItem
(
oListProp
);
oDocument
.
m_oListTab
le
.
AddItem
(
oListProp
);
return
true
;
}
else
...
...
@@ -2263,7 +2263,7 @@ public:
bool
bResult
=
StartSubReader
(
oListOverrideReader
,
oDocument
,
oReader
);
if
(
true
==
bResult
)
{
oDocument
.
m_oListOverrideTab
el
.
AddItem
(
oProperty
);
oDocument
.
m_oListOverrideTab
le
.
AddItem
(
oProperty
);
return
true
;
}
else
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXAbstractNumReader.h
View file @
6361ee6f
...
...
@@ -76,7 +76,7 @@ public:
if
(
true
==
oLevelReader
.
Parse
(
oParam
,
oNewLevel
)
)
oNewList
.
AddItem
(
oNewLevel
);
}
oParam
.
oRtf
->
m_oListTab
el
.
AddItem
(
oNewList
);
oParam
.
oRtf
->
m_oListTab
le
.
AddItem
(
oNewList
);
return
true
;
}
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXDocumentReader.h
View file @
6361ee6f
...
...
@@ -90,7 +90,7 @@ public:
}
}
}
//----------------------------------------------------------------------------------------------------------
_section
last_section
;
m_poDocument
->
GetItem
(
last_section
);
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXNumberingMapReader.h
View file @
6361ee6f
...
...
@@ -78,7 +78,7 @@ public:
oNewOverride
.
m_oOverrideLevels
.
m_aOverrideLevels
.
push_back
(
oOverrideLevel
);
}
oParam
.
oRtf
->
m_oListOverrideTab
el
.
AddItem
(
oNewOverride
);
oParam
.
oRtf
->
m_oListOverrideTab
le
.
AddItem
(
oNewOverride
);
return
true
;
}
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXNumberingReader.h
View file @
6361ee6f
...
...
@@ -64,9 +64,9 @@ public:
oNewShape
->
m_nPositionHRelative
=
3
;
oNewShape
->
m_nPositionVRelative
=
3
;
int
nIndex
=
oParam
.
oRtf
->
m_oListTab
el
.
m_aPictureList
.
GetCount
();
int
nIndex
=
oParam
.
oRtf
->
m_oListTab
le
.
m_aPictureList
.
GetCount
();
oParam
.
oReader
->
m_mapPictureBullet
[
nID
]
=
nIndex
;
oParam
.
oRtf
->
m_oListTab
el
.
m_aPictureList
.
AddItem
(
oNewShape
);
oParam
.
oRtf
->
m_oListTab
le
.
m_aPictureList
.
AddItem
(
oNewShape
);
}
}
if
(
m_ooxNumbering
->
m_arrNumPicBullet
[
i
]
->
m_oDrawing
.
IsInit
())
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXParagraphElementReaders.cpp
View file @
6361ee6f
...
...
@@ -1041,11 +1041,11 @@ bool OOXpPrReader::Parse( ReaderParameter oParam ,RtfParagraphProperty& oOutputP
//применяем direct свойства списка к параграфу
RtfListOverrideProperty
oListOverrideProperty
;
//ищем по override table
if
(
true
==
oParam
.
oRtf
->
m_oListOverrideTab
el
.
GetList
(
oOutputProperty
.
m_nListId
,
oListOverrideProperty
)
)
if
(
true
==
oParam
.
oRtf
->
m_oListOverrideTab
le
.
GetList
(
oOutputProperty
.
m_nListId
,
oListOverrideProperty
)
)
{
RtfListProperty
oListProperty
;
//Ищем по List Table
if
(
true
==
oParam
.
oRtf
->
m_oListTab
el
.
GetList
(
oListOverrideProperty
.
m_nListID
,
oListProperty
)
)
if
(
true
==
oParam
.
oRtf
->
m_oListTab
le
.
GetList
(
oListOverrideProperty
.
m_nListID
,
oListProperty
)
)
{
//дописываем свойства параграфа firstIndent Indent
RtfListLevelProperty
poLevelProp
;
...
...
@@ -1144,6 +1144,25 @@ bool OOXpPrReader::Parse( ReaderParameter oParam ,RtfParagraphProperty& oOutputP
OOXrPrReader
orPrReader
(
m_ooxParaProps
->
m_oRPr
.
GetPointer
());
orPrReader
.
Parse
(
oParam
,
oOutputProperty
.
m_oCharProperty
);
}
if
(
m_ooxParaProps
->
m_oPPrChange
.
IsInit
())
{
if
(
m_ooxParaProps
->
m_oPPrChange
->
m_sAuthor
.
IsInit
())
oOutputProperty
.
m_nPrAuth
=
oParam
.
oRtf
->
m_oRevisionTable
.
AddAuthor
(
m_ooxParaProps
->
m_oPPrChange
->
m_sAuthor
.
get2
()
);
if
(
m_ooxParaProps
->
m_oPPrChange
->
m_oDate
.
IsInit
())
oOutputProperty
.
m_nPrDate
=
RtfUtility
::
convertDateTime
(
string2std_string
(
m_ooxParaProps
->
m_oPPrChange
->
m_oDate
->
GetValue
()));
RtfParagraphPropertyPtr
props
=
RtfParagraphPropertyPtr
(
new
RtfParagraphProperty
()
);
OOXpPrReader
opPrReader
(
m_ooxParaProps
->
m_oPPrChange
->
m_pParPr
.
GetPointer
());
CcnfStyle
style
;
if
(
opPrReader
.
Parse
(
oParam
,
*
props
.
get
(),
style
))
{
oOutputProperty
.
m_pOldParagraphProp
=
props
;
}
}
return
true
;
}
bool
OOXrPrReader
::
Parse
(
ReaderParameter
oParam
,
RtfCharProperty
&
oOutputProperty
)
...
...
@@ -1338,6 +1357,44 @@ bool OOXrPrReader::Parse( ReaderParameter oParam ,RtfCharProperty& oOutputProper
//OOXShadingReader oShadingReader(m_ooxRunProps->m_oShadow.GetPointer());
//oShadingReader.Parse( oParam, oOutputProperty.m_poShading );
}
//--------------------------------------------------------------
if
(
m_ooxRunProps
->
m_oIns
.
IsInit
())
{
oOutputProperty
.
m_nRevised
=
1
;
if
(
m_ooxRunProps
->
m_oIns
->
m_sAuthor
.
IsInit
())
oOutputProperty
.
m_nRevauth
=
oParam
.
oRtf
->
m_oRevisionTable
.
AddAuthor
(
m_ooxRunProps
->
m_oIns
->
m_sAuthor
.
get2
()
);
if
(
m_ooxRunProps
->
m_oIns
->
m_oDate
.
IsInit
())
oOutputProperty
.
m_nRevdttm
=
RtfUtility
::
convertDateTime
(
string2std_string
(
m_ooxRunProps
->
m_oIns
->
m_oDate
->
GetValue
())
);
}
if
(
m_ooxRunProps
->
m_oDel
.
IsInit
())
{
oOutputProperty
.
m_nDeleted
=
1
;
if
(
m_ooxRunProps
->
m_oDel
->
m_sAuthor
.
IsInit
())
oOutputProperty
.
m_nRevauthDel
=
oParam
.
oRtf
->
m_oRevisionTable
.
AddAuthor
(
m_ooxRunProps
->
m_oDel
->
m_sAuthor
.
get2
()
);
if
(
m_ooxRunProps
->
m_oDel
->
m_oDate
.
IsInit
())
oOutputProperty
.
m_nRevdttmDel
=
RtfUtility
::
convertDateTime
(
string2std_string
(
m_ooxRunProps
->
m_oDel
->
m_oDate
->
GetValue
())
);
}
if
(
m_ooxRunProps
->
m_oRPrChange
.
IsInit
())
{
if
(
m_ooxRunProps
->
m_oRPrChange
->
m_sAuthor
.
IsInit
())
oOutputProperty
.
m_nCrAuth
=
oParam
.
oRtf
->
m_oRevisionTable
.
AddAuthor
(
m_ooxRunProps
->
m_oRPrChange
->
m_sAuthor
.
get2
()
);
if
(
m_ooxRunProps
->
m_oRPrChange
->
m_oDate
.
IsInit
())
oOutputProperty
.
m_nCrDate
=
RtfUtility
::
convertDateTime
(
string2std_string
(
m_ooxRunProps
->
m_oRPrChange
->
m_oDate
->
GetValue
())
);
OOXrPrReader
orPrReader
(
m_ooxRunProps
->
m_oRPrChange
->
m_pRunPr
.
GetPointer
());
RtfCharPropertyPtr
props
=
RtfCharPropertyPtr
(
new
RtfCharProperty
()
);
if
(
orPrReader
.
Parse
(
oParam
,
*
props
.
get
()
))
{
oOutputProperty
.
m_pOldCharProp
=
props
;
}
}
return
true
;
}
bool
OOXpPrFrameReader
::
Parse
(
ReaderParameter
oParam
,
RtfFrame
&
oOutputProperty
)
...
...
@@ -1770,6 +1827,23 @@ bool OOXSectionPropertyReader::Parse( ReaderParameter oParam , RtfSectionPropert
}
}
if
(
m_ooxSectionProperty
->
m_oSectPrChange
.
IsInit
())
{
if
(
m_ooxSectionProperty
->
m_oSectPrChange
->
m_sAuthor
.
IsInit
())
oOutput
.
m_nSrAuth
=
oParam
.
oRtf
->
m_oRevisionTable
.
AddAuthor
(
m_ooxSectionProperty
->
m_oSectPrChange
->
m_sAuthor
.
get2
()
);
if
(
m_ooxSectionProperty
->
m_oSectPrChange
->
m_oDate
.
IsInit
())
oOutput
.
m_nSrDate
=
RtfUtility
::
convertDateTime
(
string2std_string
(
m_ooxSectionProperty
->
m_oSectPrChange
->
m_oDate
->
GetValue
()));
RtfSectionPropertyPtr
props
=
RtfSectionPropertyPtr
(
new
RtfSectionProperty
()
);
OOXSectionPropertyReader
opPrReader
(
m_ooxSectionProperty
->
m_oSectPrChange
->
m_pSecPr
.
GetPointer
());
if
(
opPrReader
.
Parse
(
oParam
,
*
props
.
get
()
))
{
oOutput
.
m_pOldSectionProp
=
props
;
}
}
return
true
;
}
ASCOfficeRtfFile/RtfFormatLib/source/RtfDocument.h
View file @
6361ee6f
...
...
@@ -57,8 +57,8 @@ public:
RtfRevisionTable
m_oRevisionTable
;
RtfInformation
m_oInformation
;
RtfListTable
m_oListTab
el
;
RtfListOverrideTable
m_oListOverrideTab
el
;
RtfListTable
m_oListTab
le
;
RtfListOverrideTable
m_oListOverrideTab
le
;
RtfParagraphProperty
m_oDefaultParagraphProp
;
RtfCharProperty
m_oDefaultCharProp
;
...
...
ASCOfficeRtfFile/RtfFormatLib/source/RtfGlobalTables.h
View file @
6361ee6f
...
...
@@ -435,35 +435,42 @@ public:
class
RtfRevisionTable
:
public
IDocumentElement
,
public
ItemContainer
<
CString
>
{
public:
ItemContainer
<
CString
>
m_aAuthorsList
;
CString
RenderToRtf
(
RenderParameter
oRenderParameter
)
{
if
(
m_aArray
.
empty
())
return
L""
;
CString
sResult
;
if
(
m_aArray
.
size
()
>
0
)
{
sResult
+=
_T
(
"{
\\
*
\\
revtbl "
);
for
(
int
i
=
0
;
i
<
(
int
)
m_aArray
.
size
();
i
++
)
{
sResult
+=
_T
(
"{"
);
sResult
+=
m_aAuthorsList
[
i
];
sResult
+=
_T
(
"}"
);
}
sResult
+=
_T
(
"{
\\
*
\\
revtbl "
);
sResult
+=
L"{Unknown;}"
;
for
(
int
i
=
0
;
i
<
(
int
)
m_aArray
.
size
();
i
++
)
{
sResult
+=
_T
(
"{"
);
sResult
+=
m_aArray
[
i
]
+
L";"
;
sResult
+=
_T
(
"}"
);
}
}
sResult
+=
_T
(
"}"
);
return
sResult
;
}
CString
RenderToOOX
(
RenderParameter
oRenderParameter
)
{
return
L""
;
}
int
AddAuthor
(
CString
author
)
{
int
i
=
Find
(
author
);
if
(
i
<
0
)
i
=
AddItem
(
author
);
return
i
;
}
};
//class RtfRSIDTable : public IDocumentElement, public ItemContainer<rsidString>
//{
//public:
// ItemContainer<CString> m_aAuthorsList;
//
// CString RenderToRtf(RenderParameter oRenderParameter)
// {
...
...
@@ -475,7 +482,7 @@ public:
// for( int i = 0; i < (int)m_aArray.size(); i++)
// {
// sResult += _T("{");
// sResult += m_aA
uthorsList
[i];
// sResult += m_aA
rray
[i];
// sResult += _T("}");
// }
// sResult += _T("}");
...
...
ASCOfficeRtfFile/RtfFormatLib/source/RtfProperty.cpp
View file @
6361ee6f
...
...
@@ -630,13 +630,13 @@ CString RtfBorder::RenderToOOX(RenderParameter oRenderParameter)
CString
RtfCharProperty
::
RenderToRtf
(
RenderParameter
oRenderParameter
)
{
CString
sResult
;
RENDER_RTF_INT
(
m_nAnimated
,
sResult
,
L"animtext"
)
RENDER_RTF_BOOL
(
m_bBold
,
sResult
,
L"b"
)
RENDER_RTF_BOOL
(
m_bCaps
,
sResult
,
L"caps"
)
RENDER_RTF_INT
(
m_nScalex
,
sResult
,
L"charscalex"
)
RENDER_RTF_INT
(
m_nAnimated
,
sResult
,
L"animtext"
)
RENDER_RTF_BOOL
(
m_bBold
,
sResult
,
L"b"
)
RENDER_RTF_BOOL
(
m_bCaps
,
sResult
,
L"caps"
)
RENDER_RTF_INT
(
m_nScalex
,
sResult
,
L"charscalex"
)
//RENDER_RTF_INT( m_nCharStyle, sResult, L"cs" )
RENDER_RTF_INT
(
m_nDown
,
sResult
,
L"dn"
)
RENDER_RTF_BOOL
(
m_bEmbo
,
sResult
,
L"embo"
)
RENDER_RTF_INT
(
m_nDown
,
sResult
,
L"dn"
)
RENDER_RTF_BOOL
(
m_bEmbo
,
sResult
,
L"embo"
)
RENDER_RTF_INT
(
m_nCharacterSpacing
,
sResult
,
L"expndtw"
)
if
(
PROP_DEF
!=
m_nCharacterSpacing
)
sResult
.
AppendFormat
(
L"
\\
expnd%d"
,
m_nCharacterSpacing
/
5
);
...
...
@@ -645,10 +645,10 @@ CString RtfCharProperty::RenderToRtf(RenderParameter oRenderParameter)
RENDER_RTF_INT
(
m_nFont
,
sResult
,
L"f"
)
//RENDER_RTF_INT( m_nFont2, sResult, L"fittext" )
//RENDER_RTF_INT( m_nFont3, sResult, L"fittext" )
RENDER_RTF_INT
(
m_nFontSize
,
sResult
,
L"fs"
)
RENDER_RTF_BOOL
(
m_bItalic
,
sResult
,
L"i"
)
RENDER_RTF_BOOL
(
m_bImprint
,
sResult
,
L"impr"
)
RENDER_RTF_INT
(
m_nKerning
,
sResult
,
L"kerning"
)
RENDER_RTF_INT
(
m_nFontSize
,
sResult
,
L"fs"
)
RENDER_RTF_BOOL
(
m_bItalic
,
sResult
,
L"i"
)
RENDER_RTF_BOOL
(
m_bImprint
,
sResult
,
L"impr"
)
RENDER_RTF_INT
(
m_nKerning
,
sResult
,
L"kerning"
)
if
(
m_bRightToLeft
!=
PROP_DEF
)
{
...
...
@@ -702,6 +702,24 @@ CString RtfCharProperty::RenderToRtf(RenderParameter oRenderParameter)
if
(
m_poShading
.
IsValid
()
==
true
)
sResult
+=
m_poShading
.
RenderToRtf
(
oRenderParameter
);
RENDER_RTF_INT
(
m_nCrAuth
,
sResult
,
L"crauth"
)
RENDER_RTF_INT
(
m_nCrDate
,
sResult
,
L"crdate"
)
if
(
m_nRevised
!=
PROP_DEF
)
sResult
+=
L"
\\
revised"
;
RENDER_RTF_INT
(
m_nRevauth
,
sResult
,
L"revauth"
)
RENDER_RTF_INT
(
m_nRevdttm
,
sResult
,
L"revdttm"
)
if
(
m_nDeleted
!=
PROP_DEF
)
sResult
+=
L"
\\
deleted"
;
RENDER_RTF_INT
(
m_nRevauthDel
,
sResult
,
L"revauthdel"
)
RENDER_RTF_INT
(
m_nRevdttmDel
,
sResult
,
L"revdttmdel"
)
if
(
m_pOldCharProp
)
{
sResult
+=
"{
\\
*
\\
oldcprops"
;
sResult
+=
m_pOldCharProp
->
RenderToRtf
(
oRenderParameter
);
sResult
+=
L"}"
;
}
return
sResult
;
}
...
...
@@ -1891,10 +1909,10 @@ CString RtfParagraphProperty::RenderToRtf(RenderParameter oRenderParameter)
RtfDocument
*
poRtfDocument
=
static_cast
<
RtfDocument
*>
(
oRenderParameter
.
poDocument
);
RtfListOverrideProperty
oListOverrideProperty
;
//ищем по override table
if
(
true
==
poRtfDocument
->
m_oListOverrideTab
el
.
GetList
(
m_nListId
,
oListOverrideProperty
)
)
if
(
true
==
poRtfDocument
->
m_oListOverrideTab
le
.
GetList
(
m_nListId
,
oListOverrideProperty
)
)
{
//Ищем по List Table
if
(
true
==
poRtfDocument
->
m_oListTab
el
.
GetList
(
oListOverrideProperty
.
m_nListID
,
oListProperty
)
)
if
(
true
==
poRtfDocument
->
m_oListTab
le
.
GetList
(
oListOverrideProperty
.
m_nListID
,
oListProperty
)
)
{
//дописываем свойства параграфа firstIndent Indent
RtfListLevelProperty
poLevelProp
;
...
...
@@ -1911,8 +1929,8 @@ CString RtfParagraphProperty::RenderToRtf(RenderParameter oRenderParameter)
{
int
nIndex
=
poLevelProp
.
m_nPictureIndex
;
if
(
0
<
nIndex
&&
nIndex
<
poRtfDocument
->
m_oListTab
el
.
m_aPictureList
.
GetCount
()
)
sResult
+=
poRtfDocument
->
m_oListTab
el
.
m_aPictureList
[
nIndex
]
->
RenderToRtf
(
oRenderParameter
);
if
(
0
<
nIndex
&&
nIndex
<
poRtfDocument
->
m_oListTab
le
.
m_aPictureList
.
GetCount
()
)
sResult
+=
poRtfDocument
->
m_oListTab
le
.
m_aPictureList
[
nIndex
]
->
RenderToRtf
(
oRenderParameter
);
}
//ставим tab
if
(
PROP_DEF
!=
poLevelProp
.
m_nFollow
)
...
...
@@ -1930,6 +1948,16 @@ CString RtfParagraphProperty::RenderToRtf(RenderParameter oRenderParameter)
}
}
}
RENDER_RTF_INT
(
m_nPrAuth
,
sResult
,
L"prauth"
)
RENDER_RTF_INT
(
m_nPrDate
,
sResult
,
L"prdate"
)
if
(
m_pOldParagraphProp
)
{
sResult
+=
"{
\\
*
\\
oldpprops
\\
pard"
;
sResult
+=
m_pOldParagraphProp
->
RenderToRtf
(
oRenderParameter
);
sResult
+=
L"}"
;
}
return
sResult
;
}
CString
RtfParagraphProperty
::
RenderToOOX
(
RenderParameter
oRenderParameter
)
...
...
ASCOfficeRtfFile/RtfFormatLib/source/RtfWriter.cpp
View file @
6361ee6f
...
...
@@ -292,9 +292,10 @@ CString RtfWriter::CreateRtfStart()
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
);
sResult
+=
m_oDocument
.
m_oListTable
.
RenderToRtf
(
oRenderParameter
);
sResult
+=
m_oDocument
.
m_oListOverrideTable
.
RenderToRtf
(
oRenderParameter
);
sResult
+=
m_oDocument
.
m_oRevisionTable
.
RenderToRtf
(
oRenderParameter
);
sResult
+=
m_oDocument
.
m_oInformation
.
RenderToRtf
(
oRenderParameter
);
sResult
+=
_T
(
"
\\
fet2"
);
//0 Footnotes only or nothing at all (the default). 1 Endnotes only. 2 Both footnotes and endnotes
CString
sFootnote
;
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Utils.h
View file @
6361ee6f
...
...
@@ -45,6 +45,8 @@
#include "iconv.h"
#endif
#include <boost/date_time.hpp>
#define BUF_SIZE 2048
#define ONE_INCH 2.54
...
...
@@ -60,7 +62,8 @@
#define CP_SYMBOL 42
#endif
#define GETBITS(from, numL, numH) ((from & (((1 << (numH - numL + 1)) - 1) << numL)) >> numL)
#define GETBITS(from, numL, numH) ((from & (((1 << (numH - numL + 1)) - 1) << numL)) >> numL)
#define SETBITS(to , numL, numH, val) {to &= ~(((1 << (numH - numL + 1)) - 1) << numL); to |= ((val & ((1 << (numH - numL + 1)) - 1)) << numL);}
namespace
Strings
{
...
...
@@ -387,7 +390,7 @@ public:
short
Month
=
GETBITS
(
dt
,
16
,
19
);
int
Year
=
GETBITS
(
dt
,
20
,
28
)
+
1900
;
//to 1899-12-31T05:37:46.66569
//to 1899-12-31T05:37:46.66569
- iso_extended_string
std
::
wstring
date_str
=
std
::
to_wstring
(
Year
)
+
L"-"
+
(
Month
<
10
?
L"0"
:
L""
)
+
std
::
to_wstring
(
Month
)
...
...
@@ -401,6 +404,35 @@ public:
return
date_str
;
}
static
int
convertDateTime
(
std
::
wstring
&
dt_
)
{
if
(
dt_
.
empty
()
)
return
PROP_DEF
;
std
::
string
dt
(
dt_
.
begin
(),
dt_
.
end
());
boost
::
posix_time
::
ptime
date_time_
;
boost
::
posix_time
::
time_input_facet
*
tif
=
new
boost
::
posix_time
::
time_input_facet
;
tif
->
set_iso_extended_format
();
std
::
istringstream
strm
(
dt
);
strm
.
imbue
(
std
::
locale
(
std
::
locale
::
classic
(),
tif
));
strm
>>
date_time_
;
short
Min
=
date_time_
.
time_of_day
().
minutes
();
short
Hour
=
date_time_
.
time_of_day
().
hours
();
short
Day
=
date_time_
.
date
().
day
();
short
Month
=
date_time_
.
date
().
month
().
as_number
();
int
Year
=
date_time_
.
date
().
year
()
-
1900
;
int
result
=
0
;
SETBITS
(
result
,
0
,
5
,
Min
);
SETBITS
(
result
,
6
,
10
,
Hour
);
SETBITS
(
result
,
11
,
15
,
Day
);
SETBITS
(
result
,
16
,
19
,
Month
);
SETBITS
(
result
,
20
,
28
,
Year
);
return
result
;
}
//------------------------------------------------------------------------------------------------------
class
RtfInternalEncoder
{
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Writer/OOXDocumentWriter.cpp
View file @
6361ee6f
...
...
@@ -128,8 +128,8 @@ CString OOXDocumentWriter::CreateXmlEnd( )
oNewParam
.
poRels
=
poNumberingWriter
->
m_oRelsWriter
.
get
();
oNewParam
.
nType
=
RENDER_TO_OOX_PARAM_NUMBERING
;
poNumberingWriter
->
AddNumbering
(
m_oDocument
.
m_oListTab
el
.
RenderToOOX
(
oNewParam
)
);
poNumberingWriter
->
AddNumbering
(
m_oDocument
.
m_oListOverrideTab
el
.
RenderToOOX
(
oNewParam
)
);
poNumberingWriter
->
AddNumbering
(
m_oDocument
.
m_oListTab
le
.
RenderToOOX
(
oNewParam
)
);
poNumberingWriter
->
AddNumbering
(
m_oDocument
.
m_oListOverrideTab
le
.
RenderToOOX
(
oNewParam
)
);
//style.xml
OOXStylesWriter
*
poStylesWriter
=
static_cast
<
OOXStylesWriter
*>
(
m_oWriter
.
m_poStylesWriter
);
...
...
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