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
32d90264
Commit
32d90264
authored
Nov 17, 2016
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RtfFormat - review.
parent
b6781c03
Changes
23
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
409 additions
and
315 deletions
+409
-315
ASCOfficeRtfFile/RtfFormatLib/Win32/RtfFormatLib.vcproj
ASCOfficeRtfFile/RtfFormatLib/Win32/RtfFormatLib.vcproj
+1
-1
ASCOfficeRtfFile/RtfFormatLib/source/DestinationCommand.cpp
ASCOfficeRtfFile/RtfFormatLib/source/DestinationCommand.cpp
+76
-66
ASCOfficeRtfFile/RtfFormatLib/source/DestinationCommand.h
ASCOfficeRtfFile/RtfFormatLib/source/DestinationCommand.h
+58
-56
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXDrawingGraphicReader.cpp
...le/RtfFormatLib/source/Reader/OOXDrawingGraphicReader.cpp
+4
-4
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXFootnotesReader.h
...ceRtfFile/RtfFormatLib/source/Reader/OOXFootnotesReader.h
+3
-3
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXHeaderReader.cpp
...iceRtfFile/RtfFormatLib/source/Reader/OOXHeaderReader.cpp
+1
-1
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXMathReader.cpp
...fficeRtfFile/RtfFormatLib/source/Reader/OOXMathReader.cpp
+24
-24
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXMathReader.h
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXMathReader.h
+3
-3
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXNumberingReader.h
...ceRtfFile/RtfFormatLib/source/Reader/OOXNumberingReader.h
+1
-1
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXParagraphElementReaders.cpp
...RtfFormatLib/source/Reader/OOXParagraphElementReaders.cpp
+89
-62
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXPictureInlineReader.h
...fFile/RtfFormatLib/source/Reader/OOXPictureInlineReader.h
+2
-1
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXShapeReader.cpp
...ficeRtfFile/RtfFormatLib/source/Reader/OOXShapeReader.cpp
+8
-8
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXStyleReader.h
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXStyleReader.h
+1
-1
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXTableReader.cpp
...ficeRtfFile/RtfFormatLib/source/Reader/OOXTableReader.cpp
+2
-2
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXTextItemReader.h
...iceRtfFile/RtfFormatLib/source/Reader/OOXTextItemReader.h
+4
-4
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXcnfStyleReader.h
...iceRtfFile/RtfFormatLib/source/Reader/OOXcnfStyleReader.h
+3
-1
ASCOfficeRtfFile/RtfFormatLib/source/RtfChar.cpp
ASCOfficeRtfFile/RtfFormatLib/source/RtfChar.cpp
+18
-7
ASCOfficeRtfFile/RtfFormatLib/source/RtfChar.h
ASCOfficeRtfFile/RtfFormatLib/source/RtfChar.h
+3
-1
ASCOfficeRtfFile/RtfFormatLib/source/RtfMath.h
ASCOfficeRtfFile/RtfFormatLib/source/RtfMath.h
+1
-0
ASCOfficeRtfFile/RtfFormatLib/source/RtfProperty.cpp
ASCOfficeRtfFile/RtfFormatLib/source/RtfProperty.cpp
+1
-0
ASCOfficeRtfFile/RtfFormatLib/source/RtfSection.cpp
ASCOfficeRtfFile/RtfFormatLib/source/RtfSection.cpp
+4
-3
ASCOfficeRtfFile/RtfFormatLib/source/RtfShape.cpp
ASCOfficeRtfFile/RtfFormatLib/source/RtfShape.cpp
+101
-65
Common/DocxFormat/Source/DocxFormat/Math/oMathContent.cpp
Common/DocxFormat/Source/DocxFormat/Math/oMathContent.cpp
+1
-1
No files found.
ASCOfficeRtfFile/RtfFormatLib/Win32/RtfFormatLib.vcproj
View file @
32d90264
...
...
@@ -724,7 +724,7 @@
>
</File>
<File
RelativePath=
"..\source\RtfParagraph
.cpp"
RelativePath=
"..\source\RtfParagraph.cpp"
>
</File>
<File
...
...
ASCOfficeRtfFile/RtfFormatLib/source/DestinationCommand.cpp
View file @
32d90264
...
...
@@ -371,7 +371,7 @@ bool RtfNormalReader::ExecuteCommand( RtfDocument& oDocument, RtfReader& oReader
section
.
props
->
m_oProperty
=
oReader
.
m_oCurSectionProp
;
}
RtfSectionPtr
oNewSection
=
RtfSectionPtr
(
new
RtfSection
()
);
RtfSectionPtr
oNewSection
(
new
RtfSection
()
);
_section
new_section
(
oNewSection
);
oDocument
.
AddItem
(
new_section
);
...
...
@@ -1710,7 +1710,7 @@ bool RtfOleReader::ExecuteCommand(RtfDocument& oDocument, RtfReader& oReader,CSt
}
else
if
(
L"result"
==
sCommand
)
{
RtfShapePtr
oNewShape
=
RtfShapePtr
(
new
RtfShape
()
);
RtfShapePtr
oNewShape
(
new
RtfShape
()
);
RtfAllPictReader
oAllPictReader
(
*
oNewShape
);
StartSubReader
(
oAllPictReader
,
oDocument
,
oReader
);
...
...
@@ -2092,9 +2092,10 @@ bool RtfOldListReader::ExecuteCommand( RtfDocument& oDocument, RtfReader& oReade
CString
sNumberingText
;
TextReader
oTextReader
(
sNumberingText
,
false
);
StartSubReader
(
oTextReader
,
oDocument
,
oReader
);
RtfCharPtr
oNewChar
=
RtfCharPtr
(
new
RtfChar
()
);
oNewChar
->
setText
(
sNumberingText
);
m_oTarget
.
m_oLevelText
->
AddItem
(
oNewChar
);
RtfCharPtr
pNewChar
(
new
RtfChar
()
);
pNewChar
->
setText
(
sNumberingText
);
m_oTarget
.
m_oLevelText
->
AddItem
(
pNewChar
);
}
else
return
false
;
...
...
@@ -2110,7 +2111,7 @@ void RtfParagraphPropDestination::AddItem( RtfParagraphPtr oItem, RtfReader& oRe
{
if
(
nCurItap
>
0
)
//Если до этого были только параграфы в таблицах - завершаем таблицу
{
RtfTablePtr
oNewTable
(
new
RtfTable
()
);
RtfTablePtr
oNewTable
(
new
RtfTable
()
);
oNewTable
->
m_oProperty
=
oCurRowProperty
;
for
(
int
k
=
(
int
)
aRows
.
size
()
-
1
;
k
>=
0
;
k
--
)
...
...
@@ -2157,7 +2158,7 @@ void RtfParagraphPropDestination::AddItem( RtfParagraphPtr oItem, RtfReader& oRe
//если вложенность текущего параграфа меньше - завершаем внутреннюю таблицу
if
(
nCurItap
>
oItem
->
m_oProperty
.
m_nItap
)
{
RtfTablePtr
oNewTable
(
new
RtfTable
()
);
RtfTablePtr
oNewTable
(
new
RtfTable
()
);
oNewTable
->
m_oProperty
=
oCurRowProperty
;
for
(
int
k
=
(
int
)
aRows
.
size
()
-
1
;
k
>=
0
;
k
--
)
...
...
@@ -2182,7 +2183,7 @@ void RtfParagraphPropDestination::AddItem( RtfParagraphPtr oItem, RtfReader& oRe
//закончилась строка
if
(
bEndRow
)
{
RtfTableRowPtr
oNewTableRow
(
new
RtfTableRow
()
);
RtfTableRowPtr
oNewTableRow
(
new
RtfTableRow
()
);
oNewTableRow
->
m_oProperty
=
oReader
.
m_oState
->
m_oRowProperty
;
for
(
int
k
=
(
int
)
aCells
.
size
()
-
1
;
k
>=
0
;
k
--
)
...
...
@@ -2212,7 +2213,7 @@ void RtfParagraphPropDestination::AddItem( RtfParagraphPtr oItem, RtfReader& oRe
if
(
bEndCell
)
{
RtfTableCellPtr
oNewTableCell
(
new
RtfTableCell
()
);
RtfTableCellPtr
oNewTableCell
(
new
RtfTableCell
()
);
for
(
int
k
=
(
int
)
aCellRenderables
.
size
()
-
1
;
k
>=
0
;
k
--
)
{
if
(
aItaps
[
k
]
==
nCurItap
)
...
...
@@ -2237,11 +2238,11 @@ void RtfParagraphPropDestination::Finalize( RtfReader& oReader/*, RtfSectionPtr
{
if
(
false
==
m_bPar
)
// потому что это не reader и нужно как-то загонять последний параграф
{
m_oCurParagraph
->
m_oProperty
=
oReader
.
m_oState
->
m_oParagraphProp
;
m_oCurParagraph
->
m_oProperty
=
oReader
.
m_oState
->
m_oParagraphProp
;
//m_oCurParagraph->m_oProperty.m_pSection = pSection;
m_oCurParagraph
->
m_oOldList
=
RtfOldListPtr
(
new
RtfOldList
()
);
*
m_oCurParagraph
->
m_oOldList
=
oReader
.
m_oState
->
m_oCurOldList
;
m_oCurParagraph
->
m_oOldList
=
RtfOldListPtr
(
new
RtfOldList
()
);
*
m_oCurParagraph
->
m_oOldList
=
oReader
.
m_oState
->
m_oCurOldList
;
m_oCurParagraph
->
m_oProperty
.
m_oCharProperty
=
oReader
.
m_oState
->
m_oCharProp
;
...
...
@@ -2355,7 +2356,8 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead
if
(
false
==
bExist
)
{
oReader
.
m_oState
->
m_oCurOldList
.
m_nLs
=
oDocument
.
m_oIdGenerator
.
Generate_PnId
();
RtfOldListPtr
oNewOldList
=
RtfOldListPtr
(
new
RtfOldList
()
);
RtfOldListPtr
oNewOldList
(
new
RtfOldList
()
);
*
oNewOldList
=
oReader
.
m_oState
->
m_oCurOldList
;
oDocument
.
m_aOldLists
.
push_back
(
oNewOldList
);
}
...
...
@@ -2452,15 +2454,16 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead
//Math
else
if
(
L"mmath"
==
sCommand
)
{
RtfMathPtr
oNewMath
=
RtfMathPtr
(
new
RtfMath
()
);
RtfMathReader
oMathReader
(
*
oNewMath
);
RtfMathPtr
oNewMath
(
new
RtfMath
()
);
RtfMathReader
oMathReader
(
*
oNewMath
);
oAbstrReader
.
StartSubReader
(
oMathReader
,
oDocument
,
oReader
);
m_oCurParagraph
->
AddItem
(
oNewMath
);
}
//Drawing
else
if
(
L"shp"
==
sCommand
)
{
RtfShapePtr
oNewShape
(
new
RtfShape
()
);
RtfShapePtr
oNewShape
(
new
RtfShape
()
);
oNewShape
->
m_oCharProperty
=
oReader
.
m_oState
->
m_oCharProp
;
RtfShapeReader
oShapeReader
(
*
oNewShape
);
...
...
@@ -2471,7 +2474,7 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead
}
else
if
(
L"do"
==
sCommand
)
{
RtfShapePtr
oNewShape
(
new
RtfShape
()
);
RtfShapePtr
oNewShape
(
new
RtfShape
()
);
oNewShape
->
m_oCharProperty
=
oReader
.
m_oState
->
m_oCharProp
;
RtfOldShapeReader
oShapeReader
(
*
oNewShape
);
...
...
@@ -2482,7 +2485,7 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead
}
else
if
(
L"shppict"
==
sCommand
)
{
RtfShapePtr
oNewShape
(
new
RtfShape
()
);
RtfShapePtr
oNewShape
(
new
RtfShape
()
);
oNewShape
->
m_oCharProperty
=
oReader
.
m_oState
->
m_oCharProp
;
RtfShppictReader
oShppictReader
(
*
oNewShape
);
...
...
@@ -2493,7 +2496,7 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead
}
else
if
(
L"pict"
==
sCommand
)
{
RtfShapePtr
oNewShape
(
new
RtfShape
()
);
RtfShapePtr
oNewShape
(
new
RtfShape
()
);
oNewShape
->
m_oCharProperty
=
oReader
.
m_oState
->
m_oCharProp
;
oNewShape
->
m_nShapeType
=
NSOfficeDrawing
::
sptPictureFrame
;
oNewShape
->
m_nWrapType
=
3
;
// none
...
...
@@ -2511,7 +2514,7 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead
}
else
if
(
L"shpgrp"
==
sCommand
)
{
RtfShapeGroupPtr
oNewShape
(
new
RtfShapeGroup
()
);
RtfShapeGroupPtr
oNewShape
(
new
RtfShapeGroup
()
);
oNewShape
->
m_oCharProperty
=
oReader
.
m_oState
->
m_oCharProp
;
RtfShapeGroupReader
oShapeGroupReader
(
*
oNewShape
);
...
...
@@ -2526,8 +2529,9 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead
}
else
if
(
L"field"
==
sCommand
)
{
RtfFieldPtr
oNewField
=
RtfFieldPtr
(
new
RtfField
());
RtfFieldReader
oFieldReader
(
*
oNewField
);
RtfFieldPtr
oNewField
(
new
RtfField
());
RtfFieldReader
oFieldReader
(
*
oNewField
);
oAbstrReader
.
StartSubReader
(
oFieldReader
,
oDocument
,
oReader
);
if
(
oNewField
->
IsValid
()
)
...
...
@@ -2546,70 +2550,75 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead
}
else
if
(
L"bkmkstart"
==
sCommand
)
{
RtfBookmarkStartPtr
oNewBookmarkStart
=
RtfBookmarkStartPtr
(
new
RtfBookmarkStart
()
);
RtfBookmarkStartReader
oBookmarkStartReader
(
*
oNewBookmarkStart
);
RtfBookmarkStartPtr
pNewBookmarkStart
(
new
RtfBookmarkStart
()
);
RtfBookmarkStartReader
oBookmarkStartReader
(
*
pNewBookmarkStart
);
oAbstrReader
.
StartSubReader
(
oBookmarkStartReader
,
oDocument
,
oReader
);
if
(
o
NewBookmarkStart
->
IsValid
()
)
m_oCurParagraph
->
AddItem
(
o
NewBookmarkStart
);
if
(
p
NewBookmarkStart
->
IsValid
()
)
m_oCurParagraph
->
AddItem
(
p
NewBookmarkStart
);
}
else
if
(
L"bkmkend"
==
sCommand
)
{
RtfBookmarkEndPtr
oNewBookmarkEnd
=
RtfBookmarkEndPtr
(
new
RtfBookmarkEnd
()
);
RtfBookmarkEndReader
oBookmarkEndReader
(
*
oNewBookmarkEnd
);
RtfBookmarkEndPtr
pNewBookmarkEnd
(
new
RtfBookmarkEnd
()
);
RtfBookmarkEndReader
oBookmarkEndReader
(
*
pNewBookmarkEnd
);
oAbstrReader
.
StartSubReader
(
oBookmarkEndReader
,
oDocument
,
oReader
);
if
(
o
NewBookmarkEnd
->
IsValid
()
)
m_oCurParagraph
->
AddItem
(
o
NewBookmarkEnd
);
if
(
p
NewBookmarkEnd
->
IsValid
()
)
m_oCurParagraph
->
AddItem
(
p
NewBookmarkEnd
);
}
else
if
(
L"footnote"
==
sCommand
)
{
RtfFootnotePtr
oNewFootnote
=
RtfFootnotePtr
(
new
RtfFootnote
()
);
o
NewFootnote
->
m_oCharProp
=
oReader
.
m_oState
->
m_oCharProp
;
RtfFootnotePtr
pNewFootnote
(
new
RtfFootnote
()
);
p
NewFootnote
->
m_oCharProp
=
oReader
.
m_oState
->
m_oCharProp
;
RtfFootnoteReader
oFootnoteReader
(
*
o
NewFootnote
);
RtfFootnoteReader
oFootnoteReader
(
*
p
NewFootnote
);
oAbstrReader
.
StartSubReader
(
oFootnoteReader
,
oDocument
,
oReader
);
if
(
o
NewFootnote
->
IsValid
()
)
m_oCurParagraph
->
AddItem
(
o
NewFootnote
);
if
(
p
NewFootnote
->
IsValid
()
)
m_oCurParagraph
->
AddItem
(
p
NewFootnote
);
}
else
if
(
L"chftn"
==
sCommand
)
{
if
(
1
==
oReader
.
m_nFootnote
)
{
RtfCharSpecialPtr
oNewChar
(
new
RtfCharSpecial
()
);
oNewChar
->
m_oProperty
=
oReader
.
m_oState
->
m_oCharProp
;
oNewChar
->
m_eType
=
RtfCharSpecial
::
rsc_chftn
;
m_oCurParagraph
->
AddItem
(
oNewChar
);
RtfCharSpecialPtr
pNewChar
(
new
RtfCharSpecial
()
);
pNewChar
->
m_oProperty
=
oReader
.
m_oState
->
m_oCharProp
;
pNewChar
->
m_eType
=
RtfCharSpecial
::
rsc_chftn
;
m_oCurParagraph
->
AddItem
(
pNewChar
);
}
else
if
(
2
==
oReader
.
m_nFootnote
)
{
RtfCharSpecialPtr
oNewChar
(
new
RtfCharSpecial
()
);
oNewChar
->
m_oProperty
=
oReader
.
m_oState
->
m_oCharProp
;
oNewChar
->
m_eType
=
RtfCharSpecial
::
rsc_chftnEnd
;
m_oCurParagraph
->
AddItem
(
oNewChar
);
RtfCharSpecialPtr
pNewChar
(
new
RtfCharSpecial
()
);
pNewChar
->
m_oProperty
=
oReader
.
m_oState
->
m_oCharProp
;
pNewChar
->
m_eType
=
RtfCharSpecial
::
rsc_chftnEnd
;
m_oCurParagraph
->
AddItem
(
pNewChar
);
}
}
else
if
(
L"chftnsep"
==
sCommand
||
L"chftnsepc"
==
sCommand
)
{
RtfCharSpecialPtr
oNewChar
(
new
RtfCharSpecial
()
);
oNewChar
->
m_oProperty
=
oReader
.
m_oState
->
m_oCharProp
;
m_oCurParagraph
->
AddItem
(
oNewChar
);
RtfCharSpecialPtr
pNewChar
(
new
RtfCharSpecial
()
);
if
(
L"chftnsep"
==
sCommand
)
oNewChar
->
m_eType
=
RtfCharSpecial
::
rsc_chftnsep
;
else
if
(
L"chftnsepc"
==
sCommand
)
oNewChar
->
m_eType
=
RtfCharSpecial
::
rsc_chftnsepc
;
pNewChar
->
m_oProperty
=
oReader
.
m_oState
->
m_oCharProp
;
m_oCurParagraph
->
AddItem
(
pNewChar
);
if
(
L"chftnsep"
==
sCommand
)
pNewChar
->
m_eType
=
RtfCharSpecial
::
rsc_chftnsep
;
else
if
(
L"chftnsepc"
==
sCommand
)
pNewChar
->
m_eType
=
RtfCharSpecial
::
rsc_chftnsepc
;
}
//specialChars
else
if
(
L"page"
==
sCommand
)
{
RtfCharSpecialPtr
oNewChar
=
RtfCharSpecialPtr
(
new
RtfCharSpecial
()
);
oNewChar
->
m_eType
=
RtfCharSpecial
::
rsc_page
;
oNewChar
->
m_oProperty
=
oReader
.
m_oState
->
m_oCharProp
;
m_oCurParagraph
->
AddItem
(
oNewChar
);
RtfCharSpecialPtr
pNewChar
(
new
RtfCharSpecial
()
);
pNewChar
->
m_eType
=
RtfCharSpecial
::
rsc_page
;
pNewChar
->
m_oProperty
=
oReader
.
m_oState
->
m_oCharProp
;
m_oCurParagraph
->
AddItem
(
pNewChar
);
//Microsoft (Demo-Hayden-Management-v2).docx
//после разрыва могут быть и графические элементы .. их надо оставить в ЭТОМ же параграфе
//разрыв страницы со следующего параграфа ..
//m_oCurParagraph->m_oProperty = oReader.m_oState->m_oParagraphProp;
//m_oCurParagraph->m_oOldList
= RtfOldListPtr
( new RtfOldList() );
//m_oCurParagraph->m_oOldList ( new RtfOldList() );
//*m_oCurParagraph->m_oOldList = oReader.m_oState->m_oCurOldList;
//m_oCurParagraph->m_oProperty.m_oCharProperty = oReader.m_oState->m_oCharProp;
//AddItem( m_oCurParagraph, oReader, false, false );
...
...
@@ -2622,10 +2631,11 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead
{
if
(
hasParameter
)
{
RtfCharSpecialPtr
oNewChar
=
RtfCharSpecialPtr
(
new
RtfCharSpecial
()
);
oNewChar
->
m_nTextWrapBreak
=
parameter
;
oNewChar
->
m_oProperty
=
oReader
.
m_oState
->
m_oCharProp
;
m_oCurParagraph
->
AddItem
(
oNewChar
);
RtfCharSpecialPtr
pNewChar
(
new
RtfCharSpecial
()
);
pNewChar
->
m_nTextWrapBreak
=
parameter
;
pNewChar
->
m_oProperty
=
oReader
.
m_oState
->
m_oCharProp
;
m_oCurParagraph
->
AddItem
(
pNewChar
);
}
}
COMMAND_RTF_SPECIAL_CHAR
(
L"softpage"
,
m_oCurParagraph
,
sCommand
,
hasParameter
,
RtfCharSpecial
::
rsc_softpage
)
...
...
@@ -2636,10 +2646,10 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead
{
if
(
hasParameter
)
{
RtfCharSpecialPtr
o
NewChar
=
RtfCharSpecialPtr
(
new
RtfCharSpecial
()
);
o
NewChar
->
m_nSoftHeight
=
parameter
;
o
NewChar
->
m_oProperty
=
oReader
.
m_oState
->
m_oCharProp
;
m_oCurParagraph
->
AddItem
(
o
NewChar
);
RtfCharSpecialPtr
p
NewChar
=
RtfCharSpecialPtr
(
new
RtfCharSpecial
()
);
p
NewChar
->
m_nSoftHeight
=
parameter
;
p
NewChar
->
m_oProperty
=
oReader
.
m_oState
->
m_oCharProp
;
m_oCurParagraph
->
AddItem
(
p
NewChar
);
}
}
COMMAND_RTF_SPECIAL_CHAR
(
L"tab"
,
m_oCurParagraph
,
sCommand
,
hasParameter
,
RtfCharSpecial
::
rsc_tab
)
...
...
@@ -2676,7 +2686,7 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead
else
if
(
L"oldcprops"
==
sCommand
)
{
RtfCharPropertyPtr
props
=
RtfCharPropertyPtr
(
new
RtfCharProperty
()
);
RtfCharPropertyPtr
props
(
new
RtfCharProperty
()
);
RtfTrackerChangesReader
oOldPropReader
(
props
);
if
(
oAbstrReader
.
StartSubReader
(
oOldPropReader
,
oDocument
,
oReader
))
...
...
@@ -2686,7 +2696,7 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead
}
else
if
(
L"oldpprops"
==
sCommand
)
{
RtfParagraphPropertyPtr
props
=
RtfParagraphPropertyPtr
(
new
RtfParagraphProperty
()
);
RtfParagraphPropertyPtr
props
(
new
RtfParagraphProperty
()
);
RtfTrackerChangesReader
oOldPropReader
(
props
);
if
(
oAbstrReader
.
StartSubReader
(
oOldPropReader
,
oDocument
,
oReader
))
...
...
@@ -2696,7 +2706,7 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead
}
else
if
(
L"oldsprops"
==
sCommand
)
{
RtfSectionPropertyPtr
props
=
RtfSectionPropertyPtr
(
new
RtfSectionProperty
()
);
RtfSectionPropertyPtr
props
(
new
RtfSectionProperty
()
);
RtfTrackerChangesReader
oOldPropReader
(
props
);
if
(
oAbstrReader
.
StartSubReader
(
oOldPropReader
,
oDocument
,
oReader
))
...
...
@@ -2706,7 +2716,7 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead
}
else
if
(
L"oldtprops"
==
sCommand
)
{
RtfRowPropertyPtr
props
=
RtfRowPropertyPtr
(
new
RtfRowProperty
()
);
RtfRowPropertyPtr
props
(
new
RtfRowProperty
()
);
RtfTrackerChangesReader
oOldPropReader
(
props
);
if
(
oAbstrReader
.
StartSubReader
(
oOldPropReader
,
oDocument
,
oReader
))
...
...
ASCOfficeRtfFile/RtfFormatLib/source/DestinationCommand.h
View file @
32d90264
...
...
@@ -63,10 +63,10 @@
#define COMMAND_RTF_SPECIAL_CHAR( pattern, target, command, hasParameter, parameter )\
else
if
(
pattern
==
command
)
\
{
\
RtfCharSpecialPtr
oNewChar
=
RtfCharSpecialPtr
(
new
RtfCharSpecial
()
);
\
o
NewChar
->
m_eType
=
parameter
;
\
o
NewChar
->
m_oProperty
=
oReader
.
m_oState
->
m_oCharProp
;
\
target
->
AddItem
(
o
NewChar
);
\
RtfCharSpecialPtr
pNewChar
(
new
RtfCharSpecial
()
);
\
p
NewChar
->
m_eType
=
parameter
;
\
p
NewChar
->
m_oProperty
=
oReader
.
m_oState
->
m_oCharProp
;
\
target
->
AddItem
(
p
NewChar
);
\
}
//Command не имеет состояний
#include "math.h"
...
...
@@ -830,7 +830,7 @@ public:
return
true
;
else
if
(
L"pict"
==
sCommand
&&
(
L"pib"
==
m_sPropName
||
L"fillBlip"
==
m_sPropName
))
{
m_oShape
.
m_oPicture
=
RtfPicturePtr
(
new
RtfPicture
()
);
m_oShape
.
m_oPicture
=
RtfPicturePtr
(
new
RtfPicture
()
);
RtfPictureReader
oPictureReader
(
oReader
,
m_oShape
);
StartSubReader
(
oPictureReader
,
oDocument
,
oReader
);
}
...
...
@@ -965,18 +965,20 @@ public:
m_bHeader
=
false
;
else
{
RtfShapeGroupPtr
oNewShape
=
RtfShapeGroupPtr
(
new
RtfShapeGroup
()
);
RtfShapeGroupReader
oShapeGroupReader
(
*
oNewShape
);
RtfShapeGroupPtr
pNewShape
(
new
RtfShapeGroup
()
);
RtfShapeGroupReader
oShapeGroupReader
(
*
pNewShape
);
StartSubReader
(
oShapeGroupReader
,
oDocument
,
oReader
);
m_oShapeGroup
.
AddItem
(
o
NewShape
);
m_oShapeGroup
.
AddItem
(
p
NewShape
);
}
}
else
if
(
L"shp"
==
sCommand
)
{
RtfShapePtr
oNewShape
=
RtfShapePtr
(
new
RtfShape
()
);
RtfShapeReader
oShapeReader
(
*
oNewShape
);
RtfShapePtr
pNewShape
(
new
RtfShape
()
);
RtfShapeReader
oShapeReader
(
*
pNewShape
);
StartSubReader
(
oShapeReader
,
oDocument
,
oReader
);
m_oShapeGroup
.
AddItem
(
o
NewShape
);
m_oShapeGroup
.
AddItem
(
p
NewShape
);
}
else
return
RtfShapeReader
::
ExecuteCommand
(
oDocument
,
oReader
,
sCommand
,
hasParameter
,
parameter
);
...
...
@@ -1183,7 +1185,7 @@ public:
}
else
{
RtfMathPtr
oNewMath
(
new
RtfMath
()
);
RtfMathPtr
oNewMath
(
new
RtfMath
()
);
oNewMath
->
SetRtfName
(
sCommand
);
oNewMath
->
m_bIsVal
=
isValMath
;
...
...
@@ -1194,7 +1196,7 @@ public:
if
(
resParseSub
&&
L"mctrlPr"
==
sCommand
)
{
RtfCharPropertyPtr
oNewCharProp
(
new
RtfCharProperty
()
);
RtfCharPropertyPtr
oNewCharProp
(
new
RtfCharProperty
()
);
oNewCharProp
->
Merge
(
oSubMathReader
.
m_oCharProp
);
oNewMath
->
AddItem
(
oNewCharProp
);
}
...
...
@@ -1226,11 +1228,11 @@ public:
}
void
ExecuteText
(
RtfDocument
&
oDocument
,
RtfReader
&
oReader
,
CString
sText
)
{
RtfCharPtr
oNewChar
(
new
RtfChar
()
);
o
NewChar
->
m_oProperty
.
Merge
(
m_oCharProp
);
RtfCharPtr
pNewChar
(
new
RtfChar
()
);
p
NewChar
->
m_oProperty
.
Merge
(
m_oCharProp
);
o
NewChar
->
setText
(
sText
);
m_oMath
.
AddItem
(
o
NewChar
);
p
NewChar
->
setText
(
sText
);
m_oMath
.
AddItem
(
p
NewChar
);
}
CString
ExecuteMathProp
(
RtfDocument
&
oDocument
,
CString
sCommand
,
int
parameter
)
{
//rtf math properties (int) to oox math properties (string)
...
...
@@ -1416,16 +1418,16 @@ private:
CString
sResultSymbol
=
reader
.
ExecuteTextInternal
(
oDocument
,
oReader
,
sCharA
,
false
,
0
,
nSkipChar
);
m_oField
.
m_pResult
=
RtfFieldInstPtr
(
new
RtfFieldInst
()
);
m_oField
.
m_pResult
=
RtfFieldInstPtr
(
new
RtfFieldInst
()
);
RtfParagraphPtr
oNewPar
=
RtfParagraphPt
r
(
new
RtfParagraph
()
);
RtfCharPtr
oNewChar
=
RtfCharPtr
(
new
RtfChar
()
);
RtfParagraphPtr
pNewPa
r
(
new
RtfParagraph
()
);
RtfCharPtr
pNewChar
(
new
RtfChar
()
);
o
NewChar
->
setText
(
sResultSymbol
);
o
NewChar
->
m_oProperty
=
oReader
.
m_oState
->
m_oCharProp
;
p
NewChar
->
setText
(
sResultSymbol
);
p
NewChar
->
m_oProperty
=
oReader
.
m_oState
->
m_oCharProp
;
oNewPar
->
AddItem
(
o
NewChar
);
m_oField
.
m_pResult
->
m_pTextItems
->
AddItem
(
o
NewPar
);
pNewPar
->
AddItem
(
p
NewChar
);
m_oField
.
m_pResult
->
m_pTextItems
->
AddItem
(
p
NewPar
);
m_oField
.
m_bTextOnly
=
true
;
}
};
...
...
@@ -1511,19 +1513,19 @@ public:
{
nTargetItap
=
PROP_DEF
;
m_bPar
=
false
;
m_oTextItems
=
TextItemContainerPtr
(
new
TextItemContainer
()
);
nCurItap
=
0
;
//main document
m_eInternalState
=
is_normal
;
m_oCurParagraph
=
RtfParagraphPtr
(
new
RtfParagraph
());
m_oCurParagraph
=
RtfParagraphPtr
(
new
RtfParagraph
());
m_oTextItems
=
TextItemContainerPtr
(
new
TextItemContainer
()
);
}
bool
ExecuteCommand
(
RtfDocument
&
oDocument
,
RtfReader
&
oReader
,
RtfAbstractReader
&
oAbstrReader
,
CString
sCommand
,
bool
hasParameter
,
int
parameter
);
void
ExecuteText
(
RtfDocument
&
oDocument
,
RtfReader
&
oReader
,
CString
sText
)
{
m_bPar
=
false
;
RtfCharPtr
oNewChar
(
new
RtfChar
()
);
o
NewChar
->
m_oProperty
=
oReader
.
m_oState
->
m_oCharProp
;
o
NewChar
->
setText
(
sText
);
m_oCurParagraph
->
AddItem
(
o
NewChar
);
RtfCharPtr
pNewChar
(
new
RtfChar
()
);
p
NewChar
->
m_oProperty
=
oReader
.
m_oState
->
m_oCharProp
;
p
NewChar
->
setText
(
sText
);
m_oCurParagraph
->
AddItem
(
p
NewChar
);
}
void
AddItem
(
RtfParagraphPtr
oItem
,
RtfReader
&
oReader
,
bool
bEndCell
,
bool
bEndRow
);
...
...
@@ -1740,7 +1742,7 @@ class RtfStyleTableReader: public RtfAbstractReader
public:
RtfStyleReader
()
{
m_oCurStyle
=
RtfParagraphStylePtr
(
new
RtfParagraphStyle
()
);
m_oCurStyle
=
RtfParagraphStylePtr
(
new
RtfParagraphStyle
()
);
m_eInternalState
=
is_normal
;
}
bool
ExecuteCommand
(
RtfDocument
&
oDocument
,
RtfReader
&
oReader
,
CString
sCommand
,
bool
hasParameter
,
int
parameter
)
...
...
@@ -1749,7 +1751,7 @@ class RtfStyleTableReader: public RtfAbstractReader
{
if
(
true
==
hasParameter
)
{
m_oCurStyle
=
RtfParagraphStylePtr
(
new
RtfParagraphStyle
()
);
m_oCurStyle
=
RtfParagraphStylePtr
(
new
RtfParagraphStyle
()
);
m_oCurStyle
->
m_nID
=
parameter
;
}
}
...
...
@@ -1757,7 +1759,7 @@ class RtfStyleTableReader: public RtfAbstractReader
{
if
(
true
==
hasParameter
)
{
m_oCurStyle
=
RtfCharStylePtr
(
new
RtfCharStyle
()
);
m_oCurStyle
=
RtfCharStylePtr
(
new
RtfCharStyle
()
);
m_oCurStyle
->
m_nID
=
parameter
;
}
}
...
...
@@ -1765,7 +1767,7 @@ class RtfStyleTableReader: public RtfAbstractReader
{
if
(
true
==
hasParameter
)
{
m_oCurStyle
=
RtfTableStylePtr
(
new
RtfTableStyle
()
);
m_oCurStyle
=
RtfTableStylePtr
(
new
RtfTableStyle
()
);
m_oCurStyle
->
m_nID
=
parameter
;
}
}
...
...
@@ -2141,7 +2143,7 @@ public:
}
else
if
(
L"shppict"
==
sCommand
)
{
RtfShapePtr
oNewPicture
=
RtfShapePtr
(
new
RtfShape
()
);
RtfShapePtr
oNewPicture
=
RtfShapePtr
(
new
RtfShape
()
);
RtfShppictReader
oShppictReader
(
*
oNewPicture
);
StartSubReader
(
oShppictReader
,
oDocument
,
oReader
);
...
...
@@ -2362,46 +2364,46 @@ public:
if
(
NULL
==
oDocument
.
m_oFootnoteCon
)
{
oDocument
.
m_oFootnoteCon
=
TextItemContainerPtr
(
new
TextItemContainer
()
);
RtfParagraphPtr
oNewPar
=
RtfParagraphPtr
(
new
RtfParagraph
()
);
RtfCharSpecialPtr
oNewChar
=
RtfCharSpecialPt
r
(
new
RtfCharSpecial
()
);
o
NewChar
->
m_eType
=
RtfCharSpecial
::
rsc_chftnsepc
;
oDocument
.
m_oFootnoteCon
=
TextItemContainerPtr
(
new
TextItemContainer
()
);
RtfParagraphPtr
pNewPar
(
new
RtfParagraph
()
);
RtfCharSpecialPtr
pNewCha
r
(
new
RtfCharSpecial
()
);
p
NewChar
->
m_eType
=
RtfCharSpecial
::
rsc_chftnsepc
;
oNewPar
->
AddItem
(
o
NewChar
);
oDocument
.
m_oFootnoteCon
->
AddItem
(
o
NewPar
);
pNewPar
->
AddItem
(
p
NewChar
);
oDocument
.
m_oFootnoteCon
->
AddItem
(
p
NewPar
);
oDocument
.
m_oProperty
.
m_aSpecialFootnotes
.
push_back
(
1
);
}
if
(
NULL
==
oDocument
.
m_oFootnoteSep
)
{
oDocument
.
m_oFootnoteSep
=
TextItemContainerPtr
(
new
TextItemContainer
()
);
RtfParagraphPtr
oNewPar
=
RtfParagraphPtr
(
new
RtfParagraph
()
);
RtfCharSpecialPtr
oNewChar
=
RtfCharSpecialPt
r
(
new
RtfCharSpecial
()
);
o
NewChar
->
m_eType
=
RtfCharSpecial
::
rsc_chftnsep
;
RtfParagraphPtr
pNewPar
(
new
RtfParagraph
()
);
RtfCharSpecialPtr
pNewCha
r
(
new
RtfCharSpecial
()
);
p
NewChar
->
m_eType
=
RtfCharSpecial
::
rsc_chftnsep
;
oNewPar
->
AddItem
(
o
NewChar
);
oDocument
.
m_oFootnoteSep
->
AddItem
(
o
NewPar
);
pNewPar
->
AddItem
(
p
NewChar
);
oDocument
.
m_oFootnoteSep
->
AddItem
(
p
NewPar
);
oDocument
.
m_oProperty
.
m_aSpecialFootnotes
.
push_back
(
0
);
}
if
(
NULL
==
oDocument
.
m_oEndnoteCon
)
{
oDocument
.
m_oEndnoteCon
=
TextItemContainerPtr
(
new
TextItemContainer
()
);
RtfParagraphPtr
oNewPar
=
RtfParagraphPtr
(
new
RtfParagraph
()
);
RtfCharSpecialPtr
oNewChar
=
RtfCharSpecialPt
r
(
new
RtfCharSpecial
()
);
o
NewChar
->
m_eType
=
RtfCharSpecial
::
rsc_chftnsepc
;
RtfParagraphPtr
pNewPar
(
new
RtfParagraph
()
);
RtfCharSpecialPtr
pNewCha
r
(
new
RtfCharSpecial
()
);
p
NewChar
->
m_eType
=
RtfCharSpecial
::
rsc_chftnsepc
;
oNewPar
->
AddItem
(
o
NewChar
);
oDocument
.
m_oEndnoteCon
->
AddItem
(
o
NewPar
);
pNewPar
->
AddItem
(
p
NewChar
);
oDocument
.
m_oEndnoteCon
->
AddItem
(
p
NewPar
);
oDocument
.
m_oProperty
.
m_aSpecialEndnotes
.
push_back
(
1
);
}
if
(
NULL
==
oDocument
.
m_oEndnoteSep
)
{
oDocument
.
m_oEndnoteSep
=
TextItemContainerPtr
(
new
TextItemContainer
()
);
RtfParagraphPtr
oNewPar
=
RtfParagraphPtr
(
new
RtfParagraph
()
);
RtfCharSpecialPtr
oNewChar
=
RtfCharSpecialPt
r
(
new
RtfCharSpecial
()
);
o
NewChar
->
m_eType
=
RtfCharSpecial
::
rsc_chftnsep
;
RtfParagraphPtr
pNewPar
(
new
RtfParagraph
()
);
RtfCharSpecialPtr
pNewCha
r
(
new
RtfCharSpecial
()
);
p
NewChar
->
m_eType
=
RtfCharSpecial
::
rsc_chftnsep
;
oNewPar
->
AddItem
(
o
NewChar
);
oDocument
.
m_oEndnoteSep
->
AddItem
(
o
NewPar
);
pNewPar
->
AddItem
(
p
NewChar
);
oDocument
.
m_oEndnoteSep
->
AddItem
(
p
NewPar
);
oDocument
.
m_oProperty
.
m_aSpecialEndnotes
.
push_back
(
0
);
}
}
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXDrawingGraphicReader.cpp
View file @
32d90264
...
...
@@ -85,15 +85,15 @@ bool OOXPictureGraphicReader::Parse( ReaderParameter oParam , RtfShape& oOutput)
oOutput
.
m_nShapeType
=
1
;
oOutput
.
m_bFilled
=
0
;
oOutput
.
m_bLine
=
1
;
oOutput
.
m_aTextItems
=
TextItemContainerPtr
(
new
TextItemContainer
()
);
oOutput
.
m_aTextItems
=
TextItemContainerPtr
(
new
TextItemContainer
()
);
RtfParagraphPtr
oParagraph
(
new
RtfParagraph
()
);
RtfParagraphPtr
oParagraph
(
new
RtfParagraph
()
);
oParagraph
->
m_oProperty
=
oParam
.
oRtf
->
m_oDefaultParagraphProp
;
oParagraph
->
m_oProperty
.
m_oCharProperty
=
oParam
.
oRtf
->
m_oDefaultCharProp
;
oParagraph
->
m_oProperty
.
m_nItap
=
0
;
RtfCharPtr
oChar
(
new
RtfChar
()
);
RtfCharPtr
oChar
(
new
RtfChar
()
);
oChar
->
m_oProperty
=
oParam
.
oRtf
->
m_oDefaultCharProp
;
oChar
->
setText
(
L"The element is not supported in RTF format."
);
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXFootnotesReader.h
View file @
32d90264
...
...
@@ -139,7 +139,7 @@ public:
{
if
(
nSeparatorId
==
nId
)
{
TextItemContainerPtr
oNewTextItem
(
new
TextItemContainer
()
);
TextItemContainerPtr
oNewTextItem
(
new
TextItemContainer
()
);
oTextItemReader
.
m_oTextItems
=
oNewTextItem
;
if
(
true
==
oTextItemReader
.
Parse
(
ooxFtnEdn
->
m_arrItems
[
i
],
oParam
)
)
...
...
@@ -152,7 +152,7 @@ public:
}
else
if
(
nContinueId
==
nId
)
{
TextItemContainerPtr
oNewTextItem
(
new
TextItemContainer
()
);
TextItemContainerPtr
oNewTextItem
(
new
TextItemContainer
()
);
oTextItemReader
.
m_oTextItems
=
oNewTextItem
;
if
(
true
==
oTextItemReader
.
Parse
(
ooxFtnEdn
->
m_arrItems
[
i
],
oParam
)
)
...
...
@@ -165,7 +165,7 @@ public:
}
else
{
TextItemContainerPtr
oNewTextItem
(
new
TextItemContainer
()
);
TextItemContainerPtr
oNewTextItem
(
new
TextItemContainer
()
);
oTextItemReader
.
m_oTextItems
=
oNewTextItem
;
if
(
true
==
oTextItemReader
.
Parse
(
ooxFtnEdn
->
m_arrItems
[
i
],
oParam
)
)
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXHeaderReader.cpp
View file @
32d90264
...
...
@@ -44,7 +44,7 @@ bool OOXHeaderReader::Parse( ReaderParameter oParam, CString sRID, TextItemConta
oParam
.
oReader
->
m_currentContainer
=
dynamic_cast
<
OOX
::
IFileContainer
*>
(
pHdrFtr
);
OOXTextItemReader
oOOXTextItemReader
;
oOutput
=
TextItemContainerPtr
(
new
TextItemContainer
()
);
oOutput
=
TextItemContainerPtr
(
new
TextItemContainer
()
);
oOOXTextItemReader
.
m_oTextItems
=
oOutput
;
for
(
long
i
=
0
;
i
<
pHdrFtr
->
m_arrItems
.
size
();
i
++
)
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXMathReader.cpp
View file @
32d90264
...
...
@@ -41,7 +41,7 @@ bool OOXMathReader::ParseElement(ReaderParameter oParam , OOX::WritingElement *
{
if
(
!
ooxMath
)
return
false
;
rtfMath
=
RtfMathPtr
(
new
RtfMath
()
);
if
(
!
rtfMath
)
rtfMath
=
RtfMathPtr
(
new
RtfMath
()
);
if
(
!
rtfMath
)
return
false
;
OOX
::
EElementType
ooxTypeElement
=
ooxMath
->
getType
();
...
...
@@ -814,20 +814,18 @@ bool OOXMathReader::ParseElement(ReaderParameter oParam , OOX::WritingElement *
OOX
::
Logic
::
CCtrlPr
*
ooxSubMath
=
dynamic_cast
<
OOX
::
Logic
::
CCtrlPr
*>
(
ooxMath
);
if
(
ooxSubMath
)
{
RtfCharProperty
oCurrentProp
;
oCurrentProp
=
m_oCharProperty
;
RtfCharPtr
oChar
=
RtfCharPtr
(
new
RtfChar
);
oChar
->
m_oProperty
=
oCurrentProp
;
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
);
}
rtfMath
->
AddItem
(
oChar
);
}
}
break
;
case
OOX
:
:
et_m_jc
:
...
...
@@ -908,28 +906,30 @@ bool OOXMathReader::ParseElement(ReaderParameter oParam , OOX::WritingElement *
//----------------------------------
nullable
<
CString
>
sVal
;
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
((
ooxElemMeasure
)
&&
(
ooxElemMeasure
->
m_val
.
IsInit
()))
sVal
=
ooxElemMeasure
->
m_val
->
ToString
();
else
if
((
ooxElemInt255
)
&&
(
ooxElemInt255
->
m_val
.
IsInit
()))
sVal
=
ooxElemInt255
->
m_val
->
ToString
();
else
if
((
ooxElemLim
)
&&
(
ooxElemLim
->
m_val
.
IsInit
()))
sVal
=
ooxElemLim
->
m_val
->
ToString
();
else
if
((
ooxElemUnSignInt
)
&&
(
ooxElemUnSignInt
->
m_val
.
IsInit
()))
sVal
=
ooxElemUnSignInt
->
m_val
->
ToString
();
else
if
((
ooxElemTopBot
)
&&
(
ooxElemTopBot
->
m_val
.
IsInit
()))
sVal
=
ooxElemTopBot
->
m_val
->
ToString
();
else
if
((
ooxElemFType
)
&&
(
ooxElemFType
->
m_val
.
IsInit
()))
sVal
=
ooxElemFType
->
m_val
->
ToString
();
else
if
((
ooxElemStyle
)
&&
(
ooxElemStyle
->
m_val
.
IsInit
()))
sVal
=
ooxElemStyle
->
m_val
->
ToString
();
else
if
((
ooxElemShp
)
&&
(
ooxElemShp
->
m_val
.
IsInit
()))
sVal
=
ooxElemShp
->
m_val
->
ToString
();
else
if
((
ooxElemScript
)
&&
(
ooxElemScript
->
m_val
.
IsInit
()))
sVal
=
ooxElemScript
->
m_val
->
ToString
();
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
((
ooxElemMeasure
)
&&
(
ooxElemMeasure
->
m_val
.
IsInit
()))
sVal
=
ooxElemMeasure
->
m_val
->
ToString
();
else
if
((
ooxElemInt255
)
&&
(
ooxElemInt255
->
m_val
.
IsInit
()))
sVal
=
ooxElemInt255
->
m_val
->
ToString
();
else
if
((
ooxElemLim
)
&&
(
ooxElemLim
->
m_val
.
IsInit
()))
sVal
=
ooxElemLim
->
m_val
->
ToString
();
else
if
((
ooxElemUnSignInt
)
&&
(
ooxElemUnSignInt
->
m_val
.
IsInit
()))
sVal
=
ooxElemUnSignInt
->
m_val
->
ToString
();
else
if
((
ooxElemTopBot
)
&&
(
ooxElemTopBot
->
m_val
.
IsInit
()))
sVal
=
ooxElemTopBot
->
m_val
->
ToString
();
else
if
((
ooxElemFType
)
&&
(
ooxElemFType
->
m_val
.
IsInit
()))
sVal
=
ooxElemFType
->
m_val
->
ToString
();
else
if
((
ooxElemStyle
)
&&
(
ooxElemStyle
->
m_val
.
IsInit
()))
sVal
=
ooxElemStyle
->
m_val
->
ToString
();
else
if
((
ooxElemShp
)
&&
(
ooxElemShp
->
m_val
.
IsInit
()))
sVal
=
ooxElemShp
->
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
((
ooxElemXAlign
)
&&
(
ooxElemXAlign
->
m_val
.
IsInit
()))
sVal
=
ooxElemXAlign
->
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
((
ooxElemBreakBin
)
&&
(
ooxElemBreakBin
->
m_val
.
IsInit
()))
sVal
=
ooxElemBreakBin
->
m_val
->
ToString
();
else
if
((
ooxElemXAlign
)
&&
(
ooxElemXAlign
->
m_val
.
IsInit
()))
sVal
=
ooxElemXAlign
->
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
((
ooxElemBreakBin
)
&&
(
ooxElemBreakBin
->
m_val
.
IsInit
()))
sVal
=
ooxElemBreakBin
->
m_val
->
ToString
();
else
if
((
ooxElemBreakBinSub
)
&&
(
ooxElemBreakBinSub
->
m_val
.
IsInit
()))
sVal
=
ooxElemBreakBinSub
->
m_val
->
ToString
();
//----------------------------------------------
if
(
ooxElemArray
)
{
OOXMathReader
oMathReader
(
ooxElemArray
);
oMathReader
.
m_oCharProperty
=
m_oCharProperty
;
bool
res
=
oMathReader
.
Parse
(
oParam
,
(
*
rtfMath
)
);
}
else
if
(
sVal
.
IsInit
())
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXMathReader.h
View file @
32d90264
...
...
@@ -59,10 +59,10 @@ public:
for
(
int
i
=
0
;
i
<
m_ooxElem
->
m_arrItems
.
size
();
i
++
)
{
RtfMathPtr
o
NewMath
;
if
(
ParseElement
(
oParam
,
m_ooxElem
->
m_arrItems
[
i
],
o
NewMath
))
RtfMathPtr
p
NewMath
;
if
(
ParseElement
(
oParam
,
m_ooxElem
->
m_arrItems
[
i
],
p
NewMath
))
{
oOutput
.
AddItem
(
o
NewMath
);
oOutput
.
AddItem
(
p
NewMath
);
}
}
return
true
;
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXNumberingReader.h
View file @
32d90264
...
...
@@ -57,7 +57,7 @@ public:
{
OOXShapeReader
oShapeReader
(
m_ooxNumbering
->
m_arrNumPicBullet
[
i
]
->
m_oVmlDrawing
.
GetPointer
());
RtfShapePtr
oNewShape
(
new
RtfShape
()
);
RtfShapePtr
oNewShape
(
new
RtfShape
()
);
if
(
true
==
oShapeReader
.
Parse
(
oParam
,
oNewShape
)
)
{
oNewShape
->
m_eAnchorTypeShape
=
RtfShape
::
st_inline
;
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXParagraphElementReaders.cpp
View file @
32d90264
...
...
@@ -49,9 +49,12 @@ bool OOXParagraphReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputPa
RtfTableStylePtr
oResultTableStyle
;
//сначала применяем default стиль (если это нужно)
oOutputParagraph
.
m_oProperty
.
m_oCharProperty
=
m_oCharProperty
;
if
(
m_ooxParagraph
->
m_oParagraphProperty
)
{
OOXpPrReader
opPrReader
(
m_ooxParagraph
->
m_oParagraphProperty
);
opPrReader
.
Parse
(
oParam
,
oOutputParagraph
.
m_oProperty
,
oConditionalTableStyle
);
oResultTableStyle
=
oConditionalTableStyle
.
ApplyTableStyle
(
oParam
.
poTableStyle
);
}
...
...
@@ -69,8 +72,10 @@ bool OOXParagraphReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputPa
if
(
NULL
!=
oResultTableStyle
||
PROP_DEF
!=
oOutputParagraph
.
m_oProperty
.
m_nStyle
)
{
poExternalStyle
=
RtfCharStylePtr
(
new
RtfCharStyle
()
);
if
(
NULL
!=
oResultTableStyle
)
poExternalStyle
->
Merge
(
oResultTableStyle
);
if
(
PROP_DEF
!=
oOutputParagraph
.
m_oProperty
.
m_nStyle
)
{
RtfStylePtr
oTempStyle
;
...
...
@@ -82,6 +87,8 @@ bool OOXParagraphReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputPa
}
}
//m_oCharProperty = oOutputParagraph.m_oProperty.m_oCharProperty;
m_ooxElement
=
dynamic_cast
<
OOX
::
WritingElementWithChilds
<
OOX
::
WritingElement
>*>
(
m_ooxParagraph
);
bool
res
=
Parse2
(
oParam
,
oOutputParagraph
,
oConditionalTableStyle
,
poExternalStyle
);
...
...
@@ -106,11 +113,12 @@ bool OOXParagraphReader::Parse2( ReaderParameter oParam , RtfParagraph& oOutputP
case
OOX
:
:
et_w_tbl
:
{
oParam
.
oReader
->
m_nCurItap
++
;
RtfTablePtr
oNewTable
(
new
RtfTable
()
);
RtfTablePtr
oNewTable
(
new
RtfTable
()
);
OOX
::
Logic
::
CTbl
*
pTbl
=
dynamic_cast
<
OOX
::
Logic
::
CTbl
*>
(
m_ooxElement
->
m_arrItems
[
i
]);
OOXTableReader
oTableReader
(
pTbl
);
//oNewTable->m_oCharProperty = m_oCharProperty;
//oNewTable->m_oCharProperty = oOutputParagraph.m_oProperty.m_oCharProperty;
//Merge(oOutputParagraph.m_oProperty.m_oCharProperty)
oTableReader
.
Parse
(
oParam
,
*
oNewTable
);
oOutputParagraph
.
AddItem
(
oNewTable
);
...
...
@@ -120,7 +128,7 @@ bool OOXParagraphReader::Parse2( ReaderParameter oParam , RtfParagraph& oOutputP
{
OOX
::
Logic
::
CIns
*
pIns
=
dynamic_cast
<
OOX
::
Logic
::
CIns
*>
(
m_ooxElement
->
m_arrItems
[
i
]);
OOXParagraphReader
oSubParReader
(
pIns
);
OOXParagraphReader
oSubParReader
(
pIns
);
oSubParReader
.
m_oCharProperty
=
m_oCharProperty
;
oSubParReader
.
m_oCharProperty
.
m_nRevised
=
1
;
...
...
@@ -167,18 +175,18 @@ bool OOXParagraphReader::Parse2( ReaderParameter oParam , RtfParagraph& oOutputP
{
OOX
::
Logic
::
CFldSimple
*
pFldSimple
=
dynamic_cast
<
OOX
::
Logic
::
CFldSimple
*>
(
m_ooxElement
->
m_arrItems
[
i
]);
RtfFieldPtr
oCurField
(
new
RtfField
()
);
RtfFieldPtr
oCurField
(
new
RtfField
()
);
oCurField
->
m_pInsert
=
RtfFieldInstPtr
(
new
RtfFieldInst
()
);
oCurField
->
m_pResult
=
RtfFieldInstPtr
(
new
RtfFieldInst
()
);
//добавляем insert
RtfCharPtr
pNewChar
(
new
RtfChar
()
);
RtfCharPtr
pNewChar
(
new
RtfChar
()
);
pNewChar
->
m_bRtfEncode
=
false
;
if
(
pFldSimple
->
m_sInstr
.
IsInit
())
{
pNewChar
->
setText
(
pFldSimple
->
m_sInstr
.
get2
()
);
}
RtfParagraphPtr
oNewInsertParagraph
(
new
RtfParagraph
()
);
RtfParagraphPtr
oNewInsertParagraph
(
new
RtfParagraph
()
);
oNewInsertParagraph
->
AddItem
(
pNewChar
);
oCurField
->
m_pInsert
->
m_pTextItems
->
AddItem
(
oNewInsertParagraph
);
...
...
@@ -240,8 +248,8 @@ bool OOXParagraphReader::Parse2( ReaderParameter oParam , RtfParagraph& oOutputP
}
RtfFieldPtr
oCurField
(
new
RtfField
()
);
oCurField
->
m_pInsert
=
RtfFieldInstPtr
(
new
RtfFieldInst
()
);
oCurField
->
m_pResult
=
RtfFieldInstPtr
(
new
RtfFieldInst
()
);
oCurField
->
m_pInsert
=
RtfFieldInstPtr
(
new
RtfFieldInst
()
);
oCurField
->
m_pResult
=
RtfFieldInstPtr
(
new
RtfFieldInst
()
);
//добавляем insert
RtfCharPtr
pNewChar
(
new
RtfChar
()
);
pNewChar
->
m_bRtfEncode
=
true
;
// false;
...
...
@@ -284,14 +292,14 @@ bool OOXParagraphReader::Parse2( ReaderParameter oParam , RtfParagraph& oOutputP
{
RtfFieldPtr
oCurField
(
new
RtfField
()
);
oCurField
->
m_pInsert
=
RtfFieldInstPtr
(
new
RtfFieldInst
()
);
oCurField
->
m_pResult
=
RtfFieldInstPtr
(
new
RtfFieldInst
()
);
oCurField
->
m_pInsert
=
RtfFieldInstPtr
(
new
RtfFieldInst
()
);
oCurField
->
m_pResult
=
RtfFieldInstPtr
(
new
RtfFieldInst
()
);
//добавляем insert
RtfCharPtr
pNewCharHYPER
(
new
RtfChar
()
);
RtfCharPtr
pNewCharHYPER
(
new
RtfChar
()
);
pNewCharHYPER
->
m_bRtfEncode
=
false
;
pNewCharHYPER
->
setText
(
L"HYPERLINK
\\
l
\"
"
+
pHyperlink
->
m_sAnchor
.
get
()
+
L"
\"
"
);
RtfParagraphPtr
oNewInsertParagraph
(
new
RtfParagraph
()
);
RtfParagraphPtr
oNewInsertParagraph
(
new
RtfParagraph
()
);
oNewInsertParagraph
->
AddItem
(
pNewCharHYPER
);
oCurField
->
m_pInsert
->
m_pTextItems
->
AddItem
(
oNewInsertParagraph
);
...
...
@@ -303,7 +311,7 @@ bool OOXParagraphReader::Parse2( ReaderParameter oParam , RtfParagraph& oOutputP
//if( TRUE == bDirty )
// oCurField->m_eMode = RtfField::fm_flddirty;
RtfParagraphPtr
oNewResultParagraph
(
new
RtfParagraph
()
);
RtfParagraphPtr
oNewResultParagraph
(
new
RtfParagraph
()
);
//применяем к новому параграфу default property
oNewResultParagraph
->
m_oProperty
=
oParam
.
oRtf
->
m_oDefaultParagraphProp
;
oNewResultParagraph
->
m_oProperty
.
m_oCharProperty
=
oParam
.
oRtf
->
m_oDefaultCharProp
;
...
...
@@ -314,6 +322,7 @@ bool OOXParagraphReader::Parse2( ReaderParameter oParam , RtfParagraph& oOutputP
{
OOXParagraphReader
oSubParReader
(
pHyperlink
);
oSubParReader
.
m_oCharProperty
=
m_oCharProperty
;
oSubParReader
.
m_oCharProperty
.
Merge
(
oOutputParagraph
.
m_oProperty
.
m_oCharProperty
);
oSubParReader
.
Parse2
(
oParam
,
*
oNewResultParagraph
,
CcnfStyle
(),
poExternalStyle
);
oCurField
->
m_pResult
->
m_pTextItems
->
AddItem
(
oNewResultParagraph
);
...
...
@@ -324,7 +333,7 @@ bool OOXParagraphReader::Parse2( ReaderParameter oParam , RtfParagraph& oOutputP
case
OOX
:
:
et_w_bookmarkStart
:
{
OOX
::
Logic
::
CBookmarkStart
*
pBookmarkStart
=
dynamic_cast
<
OOX
::
Logic
::
CBookmarkStart
*>
(
m_ooxElement
->
m_arrItems
[
i
]);
RtfBookmarkStartPtr
oNewBookmark
(
new
RtfBookmarkStart
()
);
RtfBookmarkStartPtr
oNewBookmark
(
new
RtfBookmarkStart
()
);
oNewBookmark
->
m_sName
=
pBookmarkStart
->
m_sName
.
IsInit
()
?
pBookmarkStart
->
m_sName
.
get2
()
:
L""
;
...
...
@@ -344,7 +353,7 @@ bool OOXParagraphReader::Parse2( ReaderParameter oParam , RtfParagraph& oOutputP
{
OOX
::
Logic
::
CBookmarkEnd
*
pBookmarkEnd
=
dynamic_cast
<
OOX
::
Logic
::
CBookmarkEnd
*>
(
m_ooxElement
->
m_arrItems
[
i
]);
RtfBookmarkEndPtr
oNewBookmark
(
new
RtfBookmarkEnd
()
);
RtfBookmarkEndPtr
oNewBookmark
(
new
RtfBookmarkEnd
()
);
//oNewBookmark->m_sName = pBookmarkEnd->;
int
nId
=
pBookmarkEnd
->
m_oId
->
GetValue
();
...
...
@@ -374,21 +383,27 @@ bool OOXParagraphReader::Parse2( ReaderParameter oParam , RtfParagraph& oOutputP
{
OOX
::
Logic
::
COMath
*
pMath
=
dynamic_cast
<
OOX
::
Logic
::
COMath
*>
(
m_ooxElement
->
m_arrItems
[
i
]);
RtfMathPtr
oNewMath
(
new
RtfMath
()
);
RtfMathPtr
oNewMath
(
new
RtfMath
()
);
oNewMath
->
SetOOXType
(
OOX
::
et_m_oMath
);
OOXMathReader
oMathRreader
(
pMath
);
if
(
true
==
oMathRreader
.
Parse
(
oParam
,
(
*
oNewMath
)
)
)
OOXMathReader
oMathReader
(
pMath
);
oMathReader
.
m_oCharProperty
=
m_oCharProperty
;
oMathReader
.
m_oCharProperty
.
Merge
(
oOutputParagraph
.
m_oProperty
.
m_oCharProperty
);
if
(
true
==
oMathReader
.
Parse
(
oParam
,
(
*
oNewMath
)
)
)
oOutputParagraph
.
AddItem
(
oNewMath
);
}
break
;
case
OOX
:
:
et_m_oMathPara
:
{
OOX
::
Logic
::
COMathPara
*
pMathPara
=
dynamic_cast
<
OOX
::
Logic
::
COMathPara
*>
(
m_ooxElement
->
m_arrItems
[
i
]);
RtfMathPtr
oNewMath
(
new
RtfMath
()
);
RtfMathPtr
oNewMath
(
new
RtfMath
()
);
oNewMath
->
SetOOXType
(
OOX
::
et_m_oMathPara
);
OOXMathReader
oMathReader
(
pMathPara
);
oMathReader
.
m_oCharProperty
=
m_oCharProperty
;
oMathReader
.
m_oCharProperty
.
Merge
(
oOutputParagraph
.
m_oProperty
.
m_oCharProperty
);
if
(
true
==
oMathReader
.
Parse
(
oParam
,
(
*
oNewMath
)
)
)
oOutputParagraph
.
AddItem
(
oNewMath
);
}
break
;
...
...
@@ -434,7 +449,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
//else
sValue
=
ooxText
->
m_sText
;
RtfCharPtr
pNewChar
(
new
RtfChar
()
);
RtfCharPtr
pNewChar
(
new
RtfChar
()
);
pNewChar
->
m_oProperty
=
oNewProperty
;
pNewChar
->
setText
(
sValue
);
...
...
@@ -455,7 +470,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
//else
sValue
=
ooxText
->
m_sText
;
RtfCharPtr
pNewChar
(
new
RtfChar
()
);
RtfCharPtr
pNewChar
(
new
RtfChar
()
);
pNewChar
->
m_oProperty
=
oNewProperty
;
pNewChar
->
setText
(
sValue
);
...
...
@@ -472,7 +487,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
{
case
SimpleTypes
:
:
fldchartypeBegin
:
{
OOXFieldBeginPtr
oNewField
(
new
OOXFieldBegin
()
);
OOXFieldBeginPtr
oNewField
(
new
OOXFieldBegin
()
);
if
(
ooxFldChar
->
m_oFldLock
.
IsInit
())
oNewField
->
m_bLock
=
ooxFldChar
->
m_oFldLock
->
ToBool
();
if
(
ooxFldChar
->
m_oDirty
.
IsInit
())
...
...
@@ -483,12 +498,12 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
}
break
;
case
SimpleTypes
:
:
fldchartypeEnd
:
{
OOXFieldEndPtr
oNewField
(
new
OOXFieldEnd
()
);
OOXFieldEndPtr
oNewField
(
new
OOXFieldEnd
()
);
oOutputParagraph
.
AddItem
(
oNewField
);
}
break
;
case
SimpleTypes
:
:
fldchartypeSeparate
:
{
OOXFieldSeparatePtr
oNewField
(
new
OOXFieldSeparate
()
);
OOXFieldSeparatePtr
oNewField
(
new
OOXFieldSeparate
()
);
oOutputParagraph
.
AddItem
(
oNewField
);
}
break
;
}
...
...
@@ -497,9 +512,9 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
case
OOX
:
:
et_w_instrText
:
{
OOX
::
Logic
::
CInstrText
*
ooxInstrText
=
dynamic_cast
<
OOX
::
Logic
::
CInstrText
*>
(
ooxItem
);
OOXFieldInsertTextPtr
oNewField
(
new
OOXFieldInsertText
()
);
OOXFieldInsertTextPtr
oNewField
(
new
OOXFieldInsertText
()
);
RtfCharPtr
pNewChar
(
new
RtfChar
()
);
RtfCharPtr
pNewChar
(
new
RtfChar
()
);
pNewChar
->
m_oProperty
=
oNewProperty
;
if
(
ooxInstrText
)
...
...
@@ -518,7 +533,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
if
(
oParam
.
oReader
->
m_mapFootnotes
.
end
()
!=
oPair
)
{
RtfFootnotePtr
oNewFootnote
(
new
RtfFootnote
()
);
RtfFootnotePtr
oNewFootnote
(
new
RtfFootnote
()
);
oNewFootnote
->
m_oCharProp
=
oNewProperty
;
oNewFootnote
->
m_oContent
=
oPair
->
second
;
...
...
@@ -536,7 +551,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
if
(
oParam
.
oReader
->
m_mapEndnotes
.
end
()
!=
oPair
)
{
RtfFootnotePtr
oNewEndnote
(
new
RtfFootnote
()
);
RtfFootnotePtr
oNewEndnote
(
new
RtfFootnote
()
);
oNewEndnote
->
m_oCharProp
=
oNewProperty
;
oNewEndnote
->
m_oContent
=
oPair
->
second
;
oNewEndnote
->
m_bEndNote
=
true
;
...
...
@@ -558,7 +573,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
if
(
ooxObject
->
m_oShape
.
IsInit
())
{
RtfShapePtr
oNewShape
(
new
RtfShape
()
);
RtfShapePtr
oNewShape
(
new
RtfShape
()
);
oNewShape
->
m_eAnchorTypeShape
=
RtfShape
::
st_inline
;
oNewShape
->
m_oCharProperty
=
oNewProperty
;
...
...
@@ -570,14 +585,15 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
if
(
ooxObject
->
m_oOleObject
.
IsInit
())
{
RtfOlePtr
oNewOle
(
new
RtfOle
()
);
RtfOlePtr
oNewOle
(
new
RtfOle
()
);
oNewOle
->
m_nWidth
=
nOleWidth
;
//?? todooo
oNewOle
->
m_nHeight
=
nOleHeight
;
oNewOle
->
m_nWidth
=
nOleWidth
;
//?? todooo
oNewOle
->
m_nHeight
=
nOleHeight
;
int
nShapeId
=
PROP_DEF
;
if
(
ooxObject
->
m_oOleObject
->
m_sShapeId
.
IsInit
())
nShapeId
=
oParam
.
oReader
->
m_oOOXIdGenerator
.
GetId
(
ooxObject
->
m_oOleObject
->
m_sShapeId
.
get2
());
if
(
PROP_DEF
!=
nShapeId
)
{
oNewOle
->
m_nShapeId
=
nShapeId
;
...
...
@@ -665,11 +681,11 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
}
}
TextItemContainerPtr
oNewTextItemContainer
(
new
TextItemContainer
()
);
RtfParagraphPtr
oNewPar
(
new
RtfParagraph
()
);
TextItemContainerPtr
oNewTextItemContainer
(
new
TextItemContainer
()
);
RtfParagraphPtr
pNewPar
(
new
RtfParagraph
()
);
o
NewPar
->
AddItem
(
oCurOle
);
oNewTextItemContainer
->
AddItem
(
o
NewPar
);
p
NewPar
->
AddItem
(
oCurOle
);
oNewTextItemContainer
->
AddItem
(
p
NewPar
);
aPictShape
->
m_aTextItems
=
oNewTextItemContainer
;
oCurOle
->
m_oResultPic
=
aPictShape
;
...
...
@@ -680,7 +696,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
case
OOX
:
:
et_w_drawing
:
{
OOX
::
Logic
::
CDrawing
*
ooxDrawing
=
dynamic_cast
<
OOX
::
Logic
::
CDrawing
*>
(
ooxItem
);
RtfShapePtr
pNewPicture
(
new
RtfShape
()
);
RtfShapePtr
pNewPicture
(
new
RtfShape
()
);
pNewPicture
->
m_oCharProperty
=
oNewProperty
;
OOXPictureReader
oPictureReader
(
ooxDrawing
);
...
...
@@ -696,7 +712,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
{
if
(
ooxPicture
->
m_oShapeGroup
.
IsInit
())
{
RtfShapeGroupPtr
pNewShape
(
new
RtfShapeGroup
()
);
RtfShapeGroupPtr
pNewShape
(
new
RtfShapeGroup
()
);
pNewShape
->
m_oCharProperty
=
oNewProperty
;
OOXShapeGroupReader
oShapeGroupReader
(
ooxPicture
->
m_oShapeGroup
.
GetPointer
());
...
...
@@ -705,7 +721,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
}
else
{
RtfShapePtr
pNewShape
(
new
RtfShape
()
);
RtfShapePtr
pNewShape
(
new
RtfShape
()
);
pNewShape
->
m_oCharProperty
=
oNewProperty
;
OOXShapeReader
*
pShapeReader
=
NULL
;
...
...
@@ -731,7 +747,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
}
break
;
case
OOX
:
:
et_w_nonBreakHyphen
:
{
RtfCharSpecialPtr
pNewChar
(
new
RtfCharSpecial
()
);
RtfCharSpecialPtr
pNewChar
(
new
RtfCharSpecial
()
);
pNewChar
->
m_oProperty
=
oNewProperty
;
pNewChar
->
m_eType
=
RtfCharSpecial
::
rsc_NonBrHyphen
;
...
...
@@ -739,7 +755,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
}
break
;
case
OOX
:
:
et_w_softHyphen
:
{
RtfCharSpecialPtr
pNewChar
(
new
RtfCharSpecial
()
);
RtfCharSpecialPtr
pNewChar
(
new
RtfCharSpecial
()
);
pNewChar
->
m_oProperty
=
oNewProperty
;
pNewChar
->
m_eType
=
RtfCharSpecial
::
rsc_OptHyphen
;
...
...
@@ -747,7 +763,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
}
break
;
case
OOX
:
:
et_w_pgNum
:
{
RtfCharSpecialPtr
pNewChar
(
new
RtfCharSpecial
()
);
RtfCharSpecialPtr
pNewChar
(
new
RtfCharSpecial
()
);
pNewChar
->
m_oProperty
=
oNewProperty
;
pNewChar
->
m_eType
=
RtfCharSpecial
::
rsc_chpgn
;
...
...
@@ -755,7 +771,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
}
break
;
case
OOX
:
:
et_w_footnoteRef
:
{
RtfCharSpecialPtr
pNewChar
(
new
RtfCharSpecial
()
);
RtfCharSpecialPtr
pNewChar
(
new
RtfCharSpecial
()
);
pNewChar
->
m_oProperty
=
oNewProperty
;
pNewChar
->
m_eType
=
RtfCharSpecial
::
rsc_chftn
;
...
...
@@ -763,7 +779,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
}
break
;
case
OOX
:
:
et_w_endnoteRef
:
{
RtfCharSpecialPtr
pNewChar
(
new
RtfCharSpecial
()
);
RtfCharSpecialPtr
pNewChar
(
new
RtfCharSpecial
()
);
pNewChar
->
m_oProperty
=
oNewProperty
;
pNewChar
->
m_eType
=
RtfCharSpecial
::
rsc_chftnEnd
;
...
...
@@ -771,7 +787,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
}
break
;
case
OOX
:
:
et_w_separator
:
{
RtfCharSpecialPtr
pNewChar
=
RtfCharSpecialPtr
(
new
RtfCharSpecial
()
);
RtfCharSpecialPtr
pNewChar
(
new
RtfCharSpecial
()
);
pNewChar
->
m_oProperty
=
oNewProperty
;
pNewChar
->
m_eType
=
RtfCharSpecial
::
rsc_chftnsep
;
...
...
@@ -779,7 +795,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
}
break
;
case
OOX
:
:
et_w_continuationSeparator
:
{
RtfCharSpecialPtr
pNewChar
(
new
RtfCharSpecial
()
);
RtfCharSpecialPtr
pNewChar
(
new
RtfCharSpecial
()
);
pNewChar
->
m_oProperty
=
oNewProperty
;
pNewChar
->
m_eType
=
RtfCharSpecial
::
rsc_chftnsepc
;
...
...
@@ -787,7 +803,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
}
break
;
case
OOX
:
:
et_w_tab
:
{
RtfCharSpecialPtr
pNewChar
(
new
RtfCharSpecial
()
);
RtfCharSpecialPtr
pNewChar
(
new
RtfCharSpecial
()
);
pNewChar
->
m_oProperty
=
oNewProperty
;
pNewChar
->
m_eType
=
RtfCharSpecial
::
rsc_tab
;
...
...
@@ -797,7 +813,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
{
OOX
::
Logic
::
CBr
*
ooxBr
=
dynamic_cast
<
OOX
::
Logic
::
CBr
*>
(
ooxItem
);
RtfCharSpecialPtr
pNewChar
(
new
RtfCharSpecial
()
);
RtfCharSpecialPtr
pNewChar
(
new
RtfCharSpecial
()
);
pNewChar
->
m_oProperty
=
oNewProperty
;
if
(
ooxBr
)
...
...
@@ -824,7 +840,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
case
OOX
:
:
et_mc_alternateContent
:
{
//выбираем всегда более старую версию
OOX
::
Logic
::
CAlternateContent
*
ooxAlt
=
dynamic_cast
<
OOX
::
Logic
::
CAlternateContent
*
>
(
ooxItem
);
if
(
ooxAlt
->
m_arrChoiceItems
.
size
()
>
0
)
if
(
!
ooxAlt
->
m_arrChoiceItems
.
empty
()
)
{
for
(
int
i
=
0
;
i
<
ooxAlt
->
m_arrFallbackItems
.
size
();
i
++
)
{
...
...
@@ -865,12 +881,12 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
oCurFont
.
m_sName
=
sFont
;
oParam
.
oRtf
->
m_oFontTable
.
DirectAddItem
(
oCurFont
);
}
RtfFieldPtr
oNewField
=
RtfFieldPtr
(
new
RtfField
()
);
RtfFieldPtr
oNewField
(
new
RtfField
()
);
oNewField
->
m_pInsert
=
RtfFieldInstPtr
(
new
RtfFieldInst
()
);
oNewField
->
m_pResult
=
RtfFieldInstPtr
(
new
RtfFieldInst
()
);
oNewField
->
m_pInsert
=
RtfFieldInstPtr
(
new
RtfFieldInst
()
);
oNewField
->
m_pResult
=
RtfFieldInstPtr
(
new
RtfFieldInst
()
);
RtfCharPtr
pNewChar
(
new
RtfChar
()
);
RtfCharPtr
pNewChar
(
new
RtfChar
()
);
pNewChar
->
m_bRtfEncode
=
false
;
CString
sFieldText
;
int
nFontSize
=
10
;
...
...
@@ -884,7 +900,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
pNewChar
->
setText
(
sFieldText
);
RtfParagraphPtr
oNewInsertParagraph
(
new
RtfParagraph
()
);
RtfParagraphPtr
oNewInsertParagraph
(
new
RtfParagraph
()
);
oNewInsertParagraph
->
AddItem
(
pNewChar
);
oNewField
->
m_pInsert
->
m_pTextItems
->
AddItem
(
oNewInsertParagraph
);
...
...
@@ -904,7 +920,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
oNewProperty
=
oParam
.
oRtf
->
m_oDefaultCharProp
;
//применяем внешний стиль
oNewProperty
.
Merge
(
oOutputParagraph
.
m_oProperty
.
m_oCharProperty
);
//
oNewProperty.Merge( oOutputParagraph.m_oProperty.m_oCharProperty );
oNewProperty
.
Merge
(
m_oCharProperty
);
if
(
NULL
!=
poStyle
&&
TYPE_RTF_PROPERTY_STYLE_CHAR
==
poStyle
->
GetType
()
)
...
...
@@ -1257,7 +1273,7 @@ bool OOXpPrReader::Parse( ReaderParameter oParam ,RtfParagraphProperty& oOutputP
oOutputProperty
.
m_nPrDate
=
RtfUtility
::
convertDateTime
(
sVal
);
}
RtfParagraphPropertyPtr
props
(
new
RtfParagraphProperty
()
);
RtfParagraphPropertyPtr
props
(
new
RtfParagraphProperty
()
);
OOXpPrReader
opPrReader
(
m_ooxParaProps
->
m_oPPrChange
->
m_pParPr
.
GetPointer
());
CcnfStyle
style
;
...
...
@@ -1457,9 +1473,20 @@ bool OOXrPrReader::Parse( ReaderParameter oParam ,RtfCharProperty& oOutputProper
}
if
(
m_ooxRunProps
->
m_oShadow
.
IsInit
())
{
oOutputProperty
.
m_poShading
.
m_nValue
=
m_ooxRunProps
->
m_oShadow
->
m_oVal
.
ToBool
()
?
1
:
0
;
//OOXShadingReader oShadingReader(m_ooxRunProps->m_oShadow.GetPointer());
//oShadingReader.Parse( oParam, oOutputProperty.m_poShading );
}
if
(
m_ooxRunProps
->
m_oShd
.
IsInit
())
{
if
((
m_ooxRunProps
->
m_oShd
->
m_oFill
.
IsInit
())
&&
(
m_ooxRunProps
->
m_oShd
->
m_oFill
->
GetValue
()
==
SimpleTypes
::
hexcolorRGB
))
{
RtfColor
oColor
(
m_ooxRunProps
->
m_oShd
->
m_oFill
->
Get_R
(),
m_ooxRunProps
->
m_oShd
->
m_oFill
->
Get_G
(),
m_ooxRunProps
->
m_oShd
->
m_oFill
->
Get_B
());
oOutputProperty
.
m_poShading
.
m_nBackColor
=
oParam
.
oRtf
->
m_oColorTable
.
AddItem
(
oColor
);
}
if
(
m_ooxRunProps
->
m_oShd
->
m_oColor
.
IsInit
())
{
}
{}
//....
}
//--------------------------------------------------------------
if
(
m_ooxRunProps
->
m_oIns
.
IsInit
())
...
...
@@ -1501,7 +1528,7 @@ bool OOXrPrReader::Parse( ReaderParameter oParam ,RtfCharProperty& oOutputProper
}
OOXrPrReader
orPrReader
(
m_ooxRunProps
->
m_oRPrChange
->
m_pRunPr
.
GetPointer
());
RtfCharPropertyPtr
props
(
new
RtfCharProperty
()
);
RtfCharPropertyPtr
props
(
new
RtfCharProperty
()
);
if
(
orPrReader
.
Parse
(
oParam
,
*
props
.
get
()
))
{
...
...
@@ -1951,7 +1978,7 @@ bool OOXSectionPropertyReader::Parse( ReaderParameter oParam , RtfSectionPropert
oOutput
.
m_nSrDate
=
RtfUtility
::
convertDateTime
(
sVal
);
}
RtfSectionPropertyPtr
props
=
RtfSectionPropertyPtr
(
new
RtfSectionProperty
()
);
RtfSectionPropertyPtr
props
(
new
RtfSectionProperty
()
);
OOXSectionPropertyReader
opPrReader
(
m_ooxSectionProperty
->
m_oSectPrChange
->
m_pSecPr
.
GetPointer
());
if
(
opPrReader
.
Parse
(
oParam
,
*
props
.
get
()
))
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXPictureInlineReader.h
View file @
32d90264
...
...
@@ -45,7 +45,8 @@ public:
{
if
(
m_ooxInline
==
NULL
)
return
false
;
oOutput
.
m_oPicture
=
RtfPicturePtr
(
new
RtfPicture
()
);
oOutput
.
m_oPicture
=
RtfPicturePtr
(
new
RtfPicture
()
);
oOutput
.
m_eAnchorTypeShape
=
RtfShape
::
st_inline
;
oOutput
.
m_nShapeType
=
75
;
//NSOfficeDrawing::sptPictureFrame;
oOutput
.
m_nLeft
=
0
;
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXShapeReader.cpp
View file @
32d90264
...
...
@@ -769,13 +769,13 @@ bool OOXShapeGroupReader::Parse( ReaderParameter oParam , RtfShapeGroupPtr& oOut
if
(
m_vmlGroup
->
m_arrItems
[
i
]
->
getType
()
==
OOX
::
et_v_group
)
{
RtfShapeGroupPtr
o
NewShape
(
new
RtfShapeGroup
()
);
RtfShapeGroupPtr
p
NewShape
(
new
RtfShapeGroup
()
);
OOXShapeGroupReader
oShapeReader
(
dynamic_cast
<
OOX
::
Vml
::
CGroup
*>
(
m_vmlGroup
->
m_arrItems
[
i
]));
o
NewShape
->
m_bInGroup
=
true
;
if
(
true
==
oShapeReader
.
Parse
(
oParam
,
o
NewShape
)
)
oOutput
->
AddItem
(
o
NewShape
);
p
NewShape
->
m_bInGroup
=
true
;
if
(
true
==
oShapeReader
.
Parse
(
oParam
,
p
NewShape
)
)
oOutput
->
AddItem
(
p
NewShape
);
}
else
if
(
m_vmlGroup
->
m_arrItems
[
i
]
->
getType
()
==
OOX
::
et_v_arc
||
m_vmlGroup
->
m_arrItems
[
i
]
->
getType
()
==
OOX
::
et_v_line
||
...
...
@@ -786,13 +786,13 @@ bool OOXShapeGroupReader::Parse( ReaderParameter oParam , RtfShapeGroupPtr& oOut
m_vmlGroup
->
m_arrItems
[
i
]
->
getType
()
==
OOX
::
et_v_polyline
||
m_vmlGroup
->
m_arrItems
[
i
]
->
getType
()
==
OOX
::
et_v_shapetype
)
{
RtfShapePtr
oNewShape
(
new
RtfShape
()
);
//set type .. .todooo
RtfShapePtr
pNewShape
(
new
RtfShape
()
);
//set type .. .todooo
OOXShapeReader
oShapeReader
(
dynamic_cast
<
OOX
::
Vml
::
CVmlCommonElements
*>
(
m_vmlGroup
->
m_arrItems
[
i
]));
o
NewShape
->
m_bInGroup
=
true
;
if
(
true
==
oShapeReader
.
Parse
(
oParam
,
o
NewShape
)
)
oOutput
->
AddItem
(
o
NewShape
);
p
NewShape
->
m_bInGroup
=
true
;
if
(
true
==
oShapeReader
.
Parse
(
oParam
,
p
NewShape
)
)
oOutput
->
AddItem
(
p
NewShape
);
}
else
{
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXStyleReader.h
View file @
32d90264
...
...
@@ -265,7 +265,7 @@ public:
if
(
oOutputStyle
==
NULL
)
{
oOutputStyle
=
RtfStylePtr
(
new
RtfTableStyle
()
);
oOutputStyle
=
RtfStylePtr
(
new
RtfTableStyle
()
);
oOutputStyle
->
m_nID
=
oParam
.
oRtf
->
m_oStyleTable
.
GetCount
()
+
1
;
}
RtfStyle
::
_StyleType
eStyleType
=
oOutputStyle
->
m_eType
;
//todooo проверить
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXTableReader.cpp
View file @
32d90264
...
...
@@ -155,7 +155,7 @@ bool OOXTableReader::Parse( ReaderParameter oParam, RtfTable& oOutputTable )
}
else
if
(
true
==
bExistTablPr
)
{
RtfTableStylePtr
poTableStyle
=
RtfTableStylePtr
(
new
RtfTableStyle
()
);
RtfTableStylePtr
poTableStyle
(
new
RtfTableStyle
()
);
poTableStyle
->
m_oTableProp
.
Merge
(
oOutputTable
.
m_oProperty
);
// будут использованы ниже
}
...
...
@@ -178,7 +178,7 @@ bool OOXTableReader::Parse( ReaderParameter oParam, RtfTable& oOutputTable )
ReaderParameter
newParam
=
oParam
;
newParam
.
poTableStyle
=
poTableStyle
;
RtfTableRowPtr
oNewRow
(
new
RtfTableRow
()
);
RtfTableRowPtr
oNewRow
(
new
RtfTableRow
()
);
//применяем свойства таблицы к каждому row
//т.к. в RTF нет свойств таблиц и все свойства записываются в свойства row
(
*
((
RtfTableProperty
*
)
&
oNewRow
->
m_oProperty
)).
Merge
(
oOutputTable
.
m_oProperty
);
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXTextItemReader.h
View file @
32d90264
...
...
@@ -47,7 +47,7 @@ public:
OOXTextItemReader
(
)
{
m_oTextItems
=
TextItemContainerPtr
(
new
TextItemContainer
()
);
m_oTextItems
=
TextItemContainerPtr
(
new
TextItemContainer
()
);
}
bool
Parse
(
OOX
::
WritingElement
*
ooxElement
,
ReaderParameter
oParam
)
{
...
...
@@ -58,7 +58,7 @@ public:
OOX
::
Logic
::
CParagraph
*
pParagraph
=
dynamic_cast
<
OOX
::
Logic
::
CParagraph
*>
(
ooxElement
);
OOXParagraphReader
m_oParagraphReader
(
pParagraph
);
RtfParagraphPtr
oNewParagraph
(
new
RtfParagraph
()
);
RtfParagraphPtr
oNewParagraph
(
new
RtfParagraph
()
);
//применяем к новому параграфу default property
oNewParagraph
->
m_oProperty
=
oParam
.
oRtf
->
m_oDefaultParagraphProp
;
oNewParagraph
->
m_oProperty
.
m_oCharProperty
=
oParam
.
oRtf
->
m_oDefaultCharProp
;
...
...
@@ -81,9 +81,9 @@ public:
case
OOX
:
:
et_w_tbl
:
{
OOX
::
Logic
::
CTbl
*
pTbl
=
dynamic_cast
<
OOX
::
Logic
::
CTbl
*>
(
ooxElement
);
RtfTablePtr
oNewTable
(
new
RtfTable
()
);
RtfTablePtr
oNewTable
(
new
RtfTable
()
);
OOXTableReader
oTableReader
(
pTbl
);
OOXTableReader
oTableReader
(
pTbl
);
oParam
.
oReader
->
m_nCurItap
=
1
;
if
(
true
==
oTableReader
.
Parse
(
oParam
,
(
*
oNewTable
))
)
{
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXcnfStyleReader.h
View file @
32d90264
...
...
@@ -153,7 +153,9 @@ public:
{
if
(
NULL
==
oInputStyle
)
return
oInputStyle
;
RtfTableStylePtr
oOutputStyle
=
RtfTableStylePtr
(
new
RtfTableStyle
()
);
RtfTableStylePtr
oOutputStyle
(
new
RtfTableStyle
()
);
oOutputStyle
->
Merge
(
oInputStyle
);
if
(
true
==
bOddVBand
&&
NULL
!=
oInputStyle
->
m_oBandVerOdd
)
oOutputStyle
->
Merge
(
oInputStyle
->
m_oBandVerOdd
);
...
...
ASCOfficeRtfFile/RtfFormatLib/source/RtfChar.cpp
View file @
32d90264
...
...
@@ -146,14 +146,16 @@ CString RtfChar::renderTextToXML( CString sParam, bool bDelete )
CString
RtfChar
::
renderRtfText
(
CString
&
sText
,
void
*
poDocument
,
RtfCharProperty
*
oCharProperty
)
{
RtfDocument
*
oDocument
=
static_cast
<
RtfDocument
*>
(
poDocument
);
CString
sResult
;
RtfDocument
*
pDocument
=
static_cast
<
RtfDocument
*>
(
poDocument
);
int
iFont
=
0
;
if
(
oCharProperty
)
iFont
=
oCharProperty
->
m_nFont
;
int
nCodePage
=
-
1
;
//применяем параметры codepage от текущего шрифта todo associated fonts.
//todooo разобраться со шрифтами и их подбором
RtfFont
oFont
;
if
(
NULL
!=
oCharProperty
&&
true
==
o
Document
->
m_oFontTable
.
GetFont
(
oCharProperty
->
m_nFont
,
oFont
)
)
if
(
NULL
!=
oCharProperty
&&
true
==
p
Document
->
m_oFontTable
.
GetFont
(
oCharProperty
->
m_nFont
,
oFont
)
)
{
if
(
PROP_DEF
!=
oFont
.
m_nCharset
)
nCodePage
=
RtfUtility
::
CharsetToCodepage
(
oFont
.
m_nCharset
);
...
...
@@ -161,15 +163,24 @@ CString RtfChar::renderRtfText( CString& sText, void* poDocument, RtfCharPropert
nCodePage
=
oFont
.
m_nCodePage
;
}
return
renderRtfText
(
sText
,
pDocument
,
nCodePage
);
}
CString
RtfChar
::
renderRtfText
(
CString
&
sText
,
void
*
poDocument
,
int
nCodePage
)
{
RtfDocument
*
pDocument
=
static_cast
<
RtfDocument
*>
(
poDocument
);
CString
sResult
;
//от настроек документа
if
(
-
1
==
nCodePage
&&
RtfDocumentProperty
::
cp_none
!=
o
Document
->
m_oProperty
.
m_eCodePage
)
if
(
-
1
==
nCodePage
&&
RtfDocumentProperty
::
cp_none
!=
p
Document
->
m_oProperty
.
m_eCodePage
)
{
switch
(
o
Document
->
m_oProperty
.
m_eCodePage
)
switch
(
p
Document
->
m_oProperty
.
m_eCodePage
)
{
case
RtfDocumentProperty
:
:
cp_ansi
:
{
if
(
PROP_DEF
!=
o
Document
->
m_oProperty
.
m_nAnsiCodePage
)
nCodePage
=
o
Document
->
m_oProperty
.
m_nAnsiCodePage
;
if
(
PROP_DEF
!=
p
Document
->
m_oProperty
.
m_nAnsiCodePage
)
nCodePage
=
p
Document
->
m_oProperty
.
m_nAnsiCodePage
;
else
nCodePage
=
CP_ACP
;
break
;
...
...
ASCOfficeRtfFile/RtfFormatLib/source/RtfChar.h
View file @
32d90264
...
...
@@ -209,7 +209,9 @@ public:
return
m_sChars
;
}
CString
RenderToOOX
(
RenderParameter
oRenderParameter
);
static
CString
renderRtfText
(
CString
&
sText
,
void
*
poDocument
,
RtfCharProperty
*
oCharProperty
=
NULL
);
static
CString
renderRtfText
(
CString
&
sText
,
void
*
poDocument
,
RtfCharProperty
*
oCharProperty
=
NULL
);
static
CString
renderRtfText
(
CString
&
sText
,
void
*
poDocument
,
int
nCodePage
);
CString
RenderToRtf
(
RenderParameter
oRenderParameter
);
private:
...
...
ASCOfficeRtfFile/RtfFormatLib/source/RtfMath.h
View file @
32d90264
...
...
@@ -94,6 +94,7 @@ public:
}
void
SetOOXType
(
int
type
);
CString
RenderToRtf
(
RenderParameter
oRenderParameter
);
CString
RenderToOOX
(
RenderParameter
oRenderParameter
);
};
...
...
ASCOfficeRtfFile/RtfFormatLib/source/RtfProperty.cpp
View file @
32d90264
...
...
@@ -725,6 +725,7 @@ CString RtfCharProperty::RenderToRtf(RenderParameter oRenderParameter)
RENDER_RTF_INT
(
m_nCrDate
,
sResult
,
L"crdate"
)
sResult
+=
"{
\\
*
\\
oldcprops"
;
sResult
+=
L"
\\
plain"
;
sResult
+=
m_pOldCharProp
->
RenderToRtf
(
oRenderParameter
);
sResult
+=
L"}"
;
}
...
...
ASCOfficeRtfFile/RtfFormatLib/source/RtfSection.cpp
View file @
32d90264
...
...
@@ -858,10 +858,11 @@ CString RtfSectionProperty::SaveFile( TextItemContainerPtr oTarget, RenderParame
sContent
+=
sRootName
;
sContent
+=
L" xmlns:ve=
\"
http://schemas.openxmlformats.org/markup-compatibility/2006
\"
xmlns:o=
\"
urn:schemas-microsoft-com:office:office
\"
xmlns:r=
\"
http://schemas.openxmlformats.org/officeDocument/2006/relationships
\"
xmlns:m=
\"
http://schemas.openxmlformats.org/officeDocument/2006/math
\"
xmlns:v=
\"
urn:schemas-microsoft-com:vml
\"
xmlns:wp=
\"
http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing
\"
xmlns:w10=
\"
urn:schemas-microsoft-com:office:word
\"
xmlns:w=
\"
http://schemas.openxmlformats.org/wordprocessingml/2006/main
\"
xmlns:wne=
\"
http://schemas.microsoft.com/office/word/2006/wordml
\"
>"
;
RenderParameter
oNewParameter
=
oRenderParameter
;
OOXRelsWriterPtr
oNewRelsWr
=
OOXRelsWriterPtr
(
new
OOXRelsWriter
(
sFilename
,
*
poRtfDocument
)
);
RenderParameter
oNewParameter
=
oRenderParameter
;
OOXRelsWriterPtr
oNewRelsWr
(
new
OOXRelsWriter
(
sFilename
,
*
poRtfDocument
)
);
poOOXWriter
->
m_oCustomRelsWriter
.
push_back
(
oNewRelsWr
);
oNewParameter
.
poRels
=
oNewRelsWr
.
get
();
oNewParameter
.
poRels
=
oNewRelsWr
.
get
();
sContent
+=
oTarget
->
RenderToOOX
(
oNewParameter
);
sContent
+=
L"</"
+
sRootName
+
L">"
;
...
...
ASCOfficeRtfFile/RtfFormatLib/source/RtfShape.cpp
View file @
32d90264
...
...
@@ -33,6 +33,8 @@
#include "Writer/OOXWriter.h"
#include "RtfOle.h"
#include "../../../UnicodeConverter/UnicodeConverter.h"
#include "../../../ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTShape/PPTShape.h"
void
RtfShape
::
SetDefault
()
...
...
@@ -201,7 +203,7 @@ CString RtfShape::RenderToRtf(RenderParameter oRenderParameter)
sResult
+=
m_oCharProperty
.
RenderToRtf
(
oRenderParameter
);
if
(
st_inline
==
m_eAnchorTypeShape
)
if
(
st_inline
==
m_eAnchorTypeShape
||
st_none
==
m_eAnchorTypeShape
)
{
if
(
NULL
!=
m_oPicture
&&
m_nShapeType
==
NSOfficeDrawing
::
sptPictureFrame
)
{
...
...
@@ -234,28 +236,50 @@ CString RtfShape::RenderToRtf(RenderParameter oRenderParameter)
{
sResult
+=
L"{
\\
shp"
;
sResult
+=
L"{
\\
*
\\
shpinst"
;
RENDER_RTF_INT
(
m_nID
,
sResult
,
L"shplid"
);
RENDER_RTF_INT
(
m_nID
,
sResult
,
L"shplid"
);
if
(
!
m_bInGroup
)
{
RENDER_RTF_INT
(
m_nLeft
,
sResult
,
L"shpleft"
);
RENDER_RTF_INT
(
m_nTop
,
sResult
,
L"shptop"
);
RENDER_RTF_INT
(
m_nBottom
,
sResult
,
L"shpbottom"
);
RENDER_RTF_INT
(
m_nRight
,
sResult
,
L"shpright"
);
RENDER_RTF_INT
(
m_nHeader
,
sResult
,
L"shpfhdr"
);
RENDER_RTF_INT
(
m_nWrapType
,
sResult
,
L"shpwr"
);
RENDER_RTF_INT
(
m_nWrapSideType
,
sResult
,
L"shpwrk"
);
RENDER_RTF_BOOL
(
m_bLockAnchor
,
sResult
,
L"shplockanchor"
);
m_bAllowOverlap
=
1
;
m_bLayoutInCell
=
1
;
m_nWrapType
=
3
;
m_nWrapSideType
=
0
;
m_bLockAnchor
=
0
;
m_nZOrder
=
PROP_DEF
;
m_nZOrderRelative
=
PROP_DEF
;
m_nLeft
=
m_nTop
=
0
;
m_nRelBottom
=
m_nRelRight
=
PROP_DEF
;
m_nPositionV
=
m_nPositionH
=
PROP_DEF
;
RENDER_RTF_INT
(
m_nLeft
,
sResult
,
L"shpleft"
);
RENDER_RTF_INT
(
m_nTop
,
sResult
,
L"shptop"
);
RENDER_RTF_INT
(
m_nRight
,
sResult
,
L"shpright"
);
RENDER_RTF_INT
(
m_nBottom
,
sResult
,
L"shpbottom"
);
RENDER_RTF_INT
(
m_nHeader
,
sResult
,
L"shpfhdr"
);
//sResult += L"\\shpbxcolumn";
sResult
+=
L"
\\
shpbxignore"
;
//sResult += L"\\shpbypara";
sResult
+=
L"
\\
shpbyignore"
;
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn fUseShapeAnchor}{
\\
sv %d}}"
,
false
);
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn fPseudoInline}{
\\
sv %d}}"
,
true
);
RENDER_RTF_INT
(
m_nWrapType
,
sResult
,
L"shpwr"
);
RENDER_RTF_INT
(
m_nWrapSideType
,
sResult
,
L"shpwrk"
);
//sResult += L"\\shpfblwtxt0";
sResult
+=
L"
\\
shplockanchor"
;
RENDER_RTF_INT
(
m_nZOrder
,
sResult
,
L"shpz"
);
sResult
+=
L"{
\\
sp{
\\
sn fUseShapeAnchor}{
\\
sv 0}}"
;
sResult
+=
L"{
\\
sp{
\\
sn fPseudoInline}{
\\
sv 1}}"
;
}
sResult
+=
RenderToRtfShapeProperty
(
oRenderParameter
);
sResult
+=
L"{
\\
sp{
\\
sn fLockPosition}{
\\
sv 1}}"
;
sResult
+=
L"{
\\
sp{
\\
sn fLockRotation}{
\\
sv 1}}"
;
//picture
if
(
0
!=
m_oPicture
&&
m_nFillType
==
1
||
m_nFillType
==
2
||
m_nFillType
==
9
)
{
...
...
@@ -271,33 +295,27 @@ CString RtfShape::RenderToRtf(RenderParameter oRenderParameter)
sResult
+=
L"}"
;
}
sResult
+=
L"}"
;
//if( 0 != m_oPicture )
//{
// sResult += L"{\\shprslt\\par\\plain";
// sResult += m_oPicture->GenerateWMF( oRenderParameter ) );
// sResult += L"\\par}";
//}
sResult
+=
L"}"
;
}
}
else
else
// anchor
{
sResult
+=
L"{
\\
shp"
;
sResult
+=
L"{
\\
*
\\
shpinst"
;
RENDER_RTF_INT
(
m_nID
,
sResult
,
L"shplid"
);
RENDER_RTF_INT
(
m_nID
,
sResult
,
L"shplid"
);
if
(
!
m_bInGroup
)
{
RENDER_RTF_INT
(
m_nLeft
,
sResult
,
L"shpleft"
);
RENDER_RTF_INT
(
m_nTop
,
sResult
,
L"shptop"
);
RENDER_RTF_INT
(
m_nBottom
,
sResult
,
L"shpbottom"
);
RENDER_RTF_INT
(
m_nRight
,
sResult
,
L"shpright"
);
RENDER_RTF_INT
(
m_nZOrder
,
sResult
,
L"shpz"
);
RENDER_RTF_INT
(
m_nHeader
,
sResult
,
L"shpfhdr"
);
RENDER_RTF_INT
(
m_nWrapType
,
sResult
,
L"shpwr"
);
RENDER_RTF_INT
(
m_nWrapSideType
,
sResult
,
L"shpwrk"
);
RENDER_RTF_BOOL
(
m_bLockAnchor
,
sResult
,
L"shplockanchor"
);
RENDER_RTF_INT
(
m_nLeft
,
sResult
,
L"shpleft"
);
RENDER_RTF_INT
(
m_nTop
,
sResult
,
L"shptop"
);
RENDER_RTF_INT
(
m_nBottom
,
sResult
,
L"shpbottom"
);
RENDER_RTF_INT
(
m_nRight
,
sResult
,
L"shpright"
);
RENDER_RTF_INT
(
m_nZOrder
,
sResult
,
L"shpz"
);
RENDER_RTF_INT
(
m_nHeader
,
sResult
,
L"shpfhdr"
);
RENDER_RTF_INT
(
m_nWrapType
,
sResult
,
L"shpwr"
);
RENDER_RTF_INT
(
m_nWrapSideType
,
sResult
,
L"shpwrk"
);
RENDER_RTF_BOOL
(
m_bLockAnchor
,
sResult
,
L"shplockanchor"
);
switch
(
m_eXAnchor
)
{
...
...
@@ -368,15 +386,17 @@ CString RtfShape::RenderToRtf(RenderParameter oRenderParameter)
}
CString
RtfShape
::
RenderToRtfShapeProperty
(
RenderParameter
oRenderParameter
)
{
RtfDocument
*
pDocument
=
static_cast
<
RtfDocument
*>
(
oRenderParameter
.
poDocument
);
CString
sResult
;
//Position absolute
if
(
PROP_DEF
!=
m_nPositionH
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn posh}{
\\
sv %d}}"
,
m_nPositionH
);
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn posh}{
\\
sv %d}}"
,
m_nPositionH
);
if
(
PROP_DEF
!=
m_nPositionHRelative
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn posrelh}{
\\
sv %d}}"
,
m_nPositionHRelative
);
if
(
PROP_DEF
!=
m_nPositionV
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn posv}{
\\
sv %d}}"
,
m_nPositionV
);
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn posv}{
\\
sv %d}}"
,
m_nPositionV
);
if
(
PROP_DEF
!=
m_nPositionVRelative
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn posrelv}{
\\
sv %d}}"
,
m_nPositionVRelative
);
...
...
@@ -391,15 +411,15 @@ CString RtfShape::RenderToRtfShapeProperty(RenderParameter oRenderParameter)
if
(
PROP_DEF
!=
m_nPositionVPct
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn pctVertPos}{
\\
sv %d}}"
,
m_nPositionVPct
);
if
(
PROP_DEF
!=
m_nPctWidth
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn pctHoriz}{
\\
sv %d}}"
,
m_nPctWidth
);
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn pctHoriz}{
\\
sv %d}}"
,
m_nPctWidth
);
if
(
PROP_DEF
!=
m_nPctHeight
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn pctVert}{
\\
sv %d}}"
,
m_nPctHeight
);
if
(
PROP_DEF
!=
m_nPctWidthRelative
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn sizerelh}{
\\
sv %d}}"
,
m_nPctWidthRelative
);
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn sizerelh}{
\\
sv %d}}"
,
m_nPctWidthRelative
);
if
(
PROP_DEF
!=
m_nPctHeightRelative
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn sizerelv}{
\\
sv %d}}"
,
m_nPctHeightRelative
);
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn sizerelv}{
\\
sv %d}}"
,
m_nPctHeightRelative
);
if
(
PROP_DEF
!=
m_nColStart
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn colStart}{
\\
sv %d}}"
,
m_nColStart
);
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn colStart}{
\\
sv %d}}"
,
m_nColStart
);
if
(
PROP_DEF
!=
m_nColSpan
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn colSpan}{
\\
sv %d}}"
,
m_nColSpan
);
//Rehydration
...
...
@@ -410,7 +430,7 @@ CString RtfShape::RenderToRtfShapeProperty(RenderParameter oRenderParameter)
if
(
PROP_DEF
!=
m_bIsBullet
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn fIsBullet}{
\\
sv %d}}"
,
m_bIsBullet
);
if
(
PROP_DEF
!=
m_nRotation
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn rotation}{
\\
sv %d}}"
,
m_nRotation
);
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn rotation}{
\\
sv %d}}"
,
m_nRotation
);
if
(
PROP_DEF
!=
m_bFlipV
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn fFlipV}{
\\
sv %d}}"
,
m_bFlipV
);
if
(
PROP_DEF
!=
m_bFlipH
)
...
...
@@ -431,7 +451,7 @@ CString RtfShape::RenderToRtfShapeProperty(RenderParameter oRenderParameter)
if
(
PROP_DEF
!=
m_nTexpRight
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn dxTextRight}{
\\
sv %d}}"
,
m_nTexpRight
);
if
(
PROP_DEF
!=
m_nTexpBottom
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn dyTextBottom}{
\\
sv %d}}"
,
m_nTexpBottom
);
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn dyTextBottom}{
\\
sv %d}}"
,
m_nTexpBottom
);
if
(
PROP_DEF
!=
m_nAnchorText
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn anchorText}{
\\
sv %d}}"
,
m_nAnchorText
);
...
...
@@ -451,14 +471,14 @@ CString RtfShape::RenderToRtfShapeProperty(RenderParameter oRenderParameter)
if
(
PROP_DEF
!=
m_bFitTextToShape
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn fFitTextToShape}{
\\
sv %d}}"
,
m_bFitTextToShape
);
if
(
PROP_DEF
!=
m_nCcol
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn ccol}{
\\
sv %d}}"
,
m_nCcol
);
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn ccol}{
\\
sv %d}}"
,
m_nCcol
);
if
(
PROP_DEF
!=
m_nTxdir
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn txdir}{
\\
sv %d}}"
,
m_nTxdir
);
if
(
PROP_DEF
!=
m_nWrapText
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn WrapText}{
\\
sv %d}}"
,
m_nWrapText
);
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn WrapText}{
\\
sv %d}}"
,
m_nWrapText
);
//Geometry
if
(
PROP_DEF
!=
m_nAdjustValue
[
0
]
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn adjustValue}{
\\
sv %d}}"
,
m_nAdjustValue
[
0
]
);
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn adjustValue}{
\\
sv %d}}"
,
m_nAdjustValue
[
0
]
);
if
(
PROP_DEF
!=
m_nAdjustValue
[
1
]
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn adjust2Value}{
\\
sv %d}}"
,
m_nAdjustValue
[
1
]
);
if
(
PROP_DEF
!=
m_nAdjustValue
[
2
]
)
...
...
@@ -476,14 +496,14 @@ CString RtfShape::RenderToRtfShapeProperty(RenderParameter oRenderParameter)
if
(
PROP_DEF
!=
m_nAdjustValue
[
8
]
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn adjust9Value}{
\\
sv %d}}"
,
m_nAdjustValue
[
8
]
);
if
(
PROP_DEF
!=
m_nAdjustValue
[
9
]
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn adjust10Value}{
\\
sv %d}}"
,
m_nAdjustValue
[
9
]
);
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn adjust10Value}{
\\
sv %d}}"
,
m_nAdjustValue
[
9
]
);
//custom
if
(
PROP_DEF
!=
m_nGeoLeft
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn geoLeft}{
\\
sv %d}}"
,
m_nGeoLeft
);
if
(
PROP_DEF
!=
m_nGeoTop
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn geoTop}{
\\
sv %d}}"
,
m_nGeoTop
);
if
(
PROP_DEF
!=
m_nGeoRight
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn geoRight}{
\\
sv %d}}"
,
m_nGeoRight
);
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn geoRight}{
\\
sv %d}}"
,
m_nGeoRight
);
if
(
PROP_DEF
!=
m_nGeoBottom
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn geoBottom}{
\\
sv %d}}"
,
m_nGeoBottom
);
if
(
PROP_DEF
!=
m_nShapePath
)
...
...
@@ -514,7 +534,7 @@ CString RtfShape::RenderToRtfShapeProperty(RenderParameter oRenderParameter)
if
(
PROP_DEF
!=
m_nCropFromBottom
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn cropFromBottom}{
\\
sv %d}}"
,
m_nCropFromBottom
);
if
(
PROP_DEF
!=
m_nCropFromLeft
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn cropFromLeft}{
\\
sv %d}}"
,
m_nCropFromLeft
);
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn cropFromLeft}{
\\
sv %d}}"
,
m_nCropFromLeft
);
if
(
PROP_DEF
!=
m_nCropFromRight
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn cropFromRight}{
\\
sv %d}}"
,
m_nCropFromRight
);
//Grouped Shapes
...
...
@@ -525,24 +545,24 @@ CString RtfShape::RenderToRtfShapeProperty(RenderParameter oRenderParameter)
if
(
PROP_DEF
!=
m_nGroupRight
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn groupRight}{
\\
sv %d}}"
,
m_nGroupRight
);
if
(
PROP_DEF
!=
m_nGroupTop
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn groupTop}{
\\
sv %d}}"
,
m_nGroupTop
);
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn groupTop}{
\\
sv %d}}"
,
m_nGroupTop
);
if
(
PROP_DEF
!=
m_nRelBottom
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn relBottom}{
\\
sv %d}}"
,
m_nRelBottom
);
if
(
PROP_DEF
!=
m_nRelLeft
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn relLeft}{
\\
sv %d}}"
,
m_nRelLeft
);
if
(
PROP_DEF
!=
m_nRelRight
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn relRight}{
\\
sv %d}}"
,
m_nRelRight
);
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn relRight}{
\\
sv %d}}"
,
m_nRelRight
);
if
(
PROP_DEF
!=
m_nRelTop
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn relTop}{
\\
sv %d}}"
,
m_nRelTop
);
if
(
PROP_DEF
!=
m_nRelRotation
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn relRotation}{
\\
sv %d}}"
,
m_nRelRotation
);
if
(
PROP_DEF
!=
m_nRelZOrder
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn dhgt}{
\\
sv %d}}"
,
m_nRelZOrder
);
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn dhgt}{
\\
sv %d}}"
,
m_nRelZOrder
);
//Fill
if
(
0
==
m_bFilled
)
sResult
+=
L"{
\\
sp{
\\
sn fFilled}{
\\
sv 0}}"
;
if
(
PROP_DEF
!=
m_nFillType
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn fillType}{
\\
sv %d}}"
,
m_nFillType
);
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn fillType}{
\\
sv %d}}"
,
m_nFillType
);
if
(
PROP_DEF
!=
m_nFillColor
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn fillColor}{
\\
sv %d}}"
,
m_nFillColor
);
if
(
PROP_DEF
!=
m_nFillColor2
)
...
...
@@ -550,7 +570,7 @@ CString RtfShape::RenderToRtfShapeProperty(RenderParameter oRenderParameter)
if
(
PROP_DEF
!=
m_nFillOpacity
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn fillOpacity}{
\\
sv %d}}"
,
(
m_nFillOpacity
*
65536
/
100
)
);
if
(
PROP_DEF
!=
m_nFillFocus
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn fillFocus}{
\\
sv %d}}"
,
m_nFillFocus
);
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn fillFocus}{
\\
sv %d}}"
,
m_nFillFocus
);
if
(
PROP_DEF
!=
m_nFillAngle
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn fillAngle}{
\\
sv %d}}"
,
m_nFillAngle
*
65536
);
//Line
...
...
@@ -561,11 +581,11 @@ CString RtfShape::RenderToRtfShapeProperty(RenderParameter oRenderParameter)
if
(
PROP_DEF
!=
m_nLineStartArrow
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn lineStartArrowhead}{
\\
sv %d}}"
,
m_nLineStartArrow
);
if
(
PROP_DEF
!=
m_nLineEndArrow
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn lineEndArrowhead}{
\\
sv %d}}"
,
m_nLineEndArrow
);
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn lineEndArrowhead}{
\\
sv %d}}"
,
m_nLineEndArrow
);
if
(
PROP_DEF
!=
m_nLineStartArrowWidth
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn lineStartArrowWidth}{
\\
sv %d}}"
,
m_nLineStartArrowWidth
);
if
(
PROP_DEF
!=
m_nLineStartArrowLength
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn lineStartArrowLength}{
\\
sv %d}}"
,
m_nLineStartArrowLength
);
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn lineStartArrowLength}{
\\
sv %d}}"
,
m_nLineStartArrowLength
);
if
(
PROP_DEF
!=
m_nLineEndArrowWidth
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn lineEndArrowWidth}{
\\
sv %d}}"
,
m_nLineEndArrowWidth
);
if
(
PROP_DEF
!=
m_nLineEndArrowLength
)
...
...
@@ -588,16 +608,31 @@ CString RtfShape::RenderToRtfShapeProperty(RenderParameter oRenderParameter)
{
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn fGtext}{
\\
sv %d}}"
,
m_bGtext
);
if
(
!
m_sGtextUNICODE
.
IsEmpty
()
)
{
sResult
+=
L"{
\\
sp{
\\
sn gtextUNICODE}{
\\
sv "
;
sResult
+=
m_sGtextUNICODE
+
L"}}"
;
}
int
nCodePage
=
-
1
;
if
(
!
m_sGtextFont
.
IsEmpty
()
)
{
sResult
+=
L"{
\\
sp{
\\
sn gtextFont}{
\\
sv "
;
sResult
+=
m_sGtextFont
+
L"}}"
;
//---------------------------------
RtfFont
oFont
;
if
(
true
==
pDocument
->
m_oFontTable
.
GetFont
(
m_sGtextFont
,
oFont
)
)
{
if
(
PROP_DEF
!=
oFont
.
m_nCharset
)
nCodePage
=
RtfUtility
::
CharsetToCodepage
(
oFont
.
m_nCharset
);
else
if
(
PROP_DEF
!=
oFont
.
m_nCodePage
)
nCodePage
=
oFont
.
m_nCodePage
;
}
}
if
(
!
m_sGtextUNICODE
.
IsEmpty
()
)
{
sResult
+=
L"{
\\
sp{
\\
sn gtextUNICODE}{
\\
sv "
;
sResult
+=
RtfChar
::
renderRtfText
(
m_sGtextUNICODE
,
oRenderParameter
.
poDocument
,
nCodePage
);
sResult
+=
L"}}"
;
}
if
(
PROP_DEF
!=
m_nGtextSize
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn gtextSize}{
\\
sv %d}}"
,
m_nGtextSize
);
if
(
PROP_DEF
!=
m_bGtextFVertical
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn gtextFVertical}{
\\
sv %d}}"
,
m_bGtextFVertical
);
if
(
PROP_DEF
!=
m_bGtextFKern
)
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn gtextFKern}{
\\
sv %d}}"
,
m_bGtextFKern
);
...
...
@@ -1371,7 +1406,7 @@ CString RtfShapeGroup::RenderToRtf(RenderParameter oRenderParameter)
sResult
+=
L"{
\\
shpgrp"
;
sResult
+=
L"{
\\
*
\\
shpinst"
;
RENDER_RTF_INT
(
m_nID
,
sResult
,
L"shplid"
);
RENDER_RTF_INT
(
m_nID
,
sResult
,
L"shplid"
);
if
(
!
m_bInGroup
)
{
...
...
@@ -1380,15 +1415,16 @@ CString RtfShapeGroup::RenderToRtf(RenderParameter oRenderParameter)
RENDER_RTF_INT
(
m_nBottom
,
sResult
,
L"shpbottom"
);
RENDER_RTF_INT
(
m_nRight
,
sResult
,
L"shpright"
);
RENDER_RTF_INT
(
m_nHeader
,
sResult
,
L"shpfhdr"
);
RENDER_RTF_INT
(
m_nWrapType
,
sResult
,
L"shpwr"
);
RENDER_RTF_INT
(
m_nWrapSideType
,
sResult
,
L"shpwrk"
);
RENDER_RTF_BOOL
(
m_bLockAnchor
,
sResult
,
L"shplockanchor"
);
sResult
+=
L"
\\
shpbxignore"
;
sResult
+=
L"
\\
shpbyignore"
;
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn fUseShapeAnchor}{
\\
sv %d}}"
,
false
);
sResult
.
AppendFormat
(
L"{
\\
sp{
\\
sn fPseudoInline}{
\\
sv %d}}"
,
true
);
RENDER_RTF_INT
(
m_nWrapType
,
sResult
,
L"shpwr"
);
RENDER_RTF_INT
(
m_nWrapSideType
,
sResult
,
L"shpwrk"
);
RENDER_RTF_BOOL
(
m_bLockAnchor
,
sResult
,
L"shplockanchor"
);
//sResult += L"{\\sp{\\sn fUseShapeAnchor}{\\sv 0}}";
//sResult += L"{\\sp{\\sn fPseudoInline}{\\sv 1}}";
}
...
...
@@ -1406,7 +1442,7 @@ CString RtfShapeGroup::RenderToRtf(RenderParameter oRenderParameter)
sResult
+=
L"{
\\
shpgrp"
;
sResult
+=
L"{
\\
*
\\
shpinst"
;
RENDER_RTF_INT
(
m_nID
,
sResult
,
L"shplid"
);
RENDER_RTF_INT
(
m_nID
,
sResult
,
L"shplid"
);
if
(
!
m_bInGroup
)
{
...
...
Common/DocxFormat/Source/DocxFormat/Math/oMathContent.cpp
View file @
32d90264
...
...
@@ -302,7 +302,7 @@ namespace OOX
if
(
m_oSup
.
IsInit
()
)
sResult
+=
m_oSup
->
toXML
();
sResult
+=
_T
(
"</m:
oMathPara
>"
);
sResult
+=
_T
(
"</m:
nary
>"
);
return
sResult
;
}
...
...
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