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
ab2461a5
Commit
ab2461a5
authored
Jun 29, 2016
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DocFormatReader - format before 1996 - fix formating text
parent
6f9ce15f
Changes
22
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
1470 additions
and
1102 deletions
+1470
-1102
ASCOfficeDocFile/Common/SPRMCodes.h
ASCOfficeDocFile/Common/SPRMCodes.h
+587
-425
ASCOfficeDocFile/Common/TextMark.h
ASCOfficeDocFile/Common/TextMark.h
+10
-10
ASCOfficeDocFile/DocDocxConverter/CharacterPropertiesMapping.cpp
...ceDocFile/DocDocxConverter/CharacterPropertiesMapping.cpp
+148
-91
ASCOfficeDocFile/DocDocxConverter/DocumentMapping.cpp
ASCOfficeDocFile/DocDocxConverter/DocumentMapping.cpp
+9
-7
ASCOfficeDocFile/DocDocxConverter/FormattedDiskPagePAPX.cpp
ASCOfficeDocFile/DocDocxConverter/FormattedDiskPagePAPX.cpp
+59
-45
ASCOfficeDocFile/DocDocxConverter/FormattedDiskPagePAPX.h
ASCOfficeDocFile/DocDocxConverter/FormattedDiskPagePAPX.h
+1
-1
ASCOfficeDocFile/DocDocxConverter/LineSpacingDescriptor.h
ASCOfficeDocFile/DocDocxConverter/LineSpacingDescriptor.h
+57
-60
ASCOfficeDocFile/DocDocxConverter/MainDocumentMapping.cpp
ASCOfficeDocFile/DocDocxConverter/MainDocumentMapping.cpp
+1
-1
ASCOfficeDocFile/DocDocxConverter/NumberingMapping.cpp
ASCOfficeDocFile/DocDocxConverter/NumberingMapping.cpp
+9
-6
ASCOfficeDocFile/DocDocxConverter/ParagraphHeight.cpp
ASCOfficeDocFile/DocDocxConverter/ParagraphHeight.cpp
+48
-40
ASCOfficeDocFile/DocDocxConverter/ParagraphPropertiesMapping.cpp
...ceDocFile/DocDocxConverter/ParagraphPropertiesMapping.cpp
+33
-3
ASCOfficeDocFile/DocDocxConverter/ParagraphPropertyExceptions.cpp
...eDocFile/DocDocxConverter/ParagraphPropertyExceptions.cpp
+5
-5
ASCOfficeDocFile/DocDocxConverter/PictureDescriptor.cpp
ASCOfficeDocFile/DocDocxConverter/PictureDescriptor.cpp
+44
-17
ASCOfficeDocFile/DocDocxConverter/PropertyExceptions.cpp
ASCOfficeDocFile/DocDocxConverter/PropertyExceptions.cpp
+90
-80
ASCOfficeDocFile/DocDocxConverter/SectionPropertiesMapping.cpp
...ficeDocFile/DocDocxConverter/SectionPropertiesMapping.cpp
+25
-0
ASCOfficeDocFile/DocDocxConverter/SinglePropertyModifier.cpp
ASCOfficeDocFile/DocDocxConverter/SinglePropertyModifier.cpp
+71
-44
ASCOfficeDocFile/DocDocxConverter/SinglePropertyModifier.h
ASCOfficeDocFile/DocDocxConverter/SinglePropertyModifier.h
+6
-3
ASCOfficeDocFile/DocDocxConverter/TableCellPropertiesMapping.cpp
...ceDocFile/DocDocxConverter/TableCellPropertiesMapping.cpp
+72
-77
ASCOfficeDocFile/DocDocxConverter/TableMapping.cpp
ASCOfficeDocFile/DocDocxConverter/TableMapping.cpp
+84
-84
ASCOfficeDocFile/DocDocxConverter/TablePropertiesMapping.cpp
ASCOfficeDocFile/DocDocxConverter/TablePropertiesMapping.cpp
+78
-73
ASCOfficeDocFile/DocDocxConverter/TableRowPropertiesMapping.cpp
...iceDocFile/DocDocxConverter/TableRowPropertiesMapping.cpp
+31
-29
ASCOfficeDocFile/DocDocxConverter/WordDocument.cpp
ASCOfficeDocFile/DocDocxConverter/WordDocument.cpp
+2
-1
No files found.
ASCOfficeDocFile/Common/SPRMCodes.h
View file @
ab2461a5
...
...
@@ -35,434 +35,596 @@ namespace DocFileFormat
{
typedef
enum
OperationCode
{
//Paragraph SPRMs
sprmPIstd
=
0x4600
,
sprmPIstdPermute
=
0xC601
,
sprmPIncLvl
=
0x2602
,
sprmPJc
=
0x2461
,
sprmPJc80
=
0x2403
,
sprmPFSideBySide
=
0x2404
,
sprmPFKeep
=
0x2405
,
sprmPFKeepFollow
=
0x2406
,
sprmPFPageBreakBefore
=
0x2407
,
sprmPBrcl
=
0x2408
,
sprmPBrcp
=
0x2409
,
sprmPIlvl
=
0x260A
,
sprmPIlfo
=
0x460B
,
sprmPFNoLineNumb
=
0x240C
,
sprmPChgTabsPapx
=
0xC60D
,
sprmPDxaLeft
=
0x845e
,
sprmPDxaLeft80
=
0x840f
,
sprmPDxaLeft1
=
0x8460
,
sprmPDxaLeft180
=
0x8411
,
sprmPDxaRight
=
0x845d
,
sprmPDxaRight80
=
0x840e
,
sprmPDxcLeft
=
0x4456
,
sprmPDxcLeft1
=
0x4457
,
sprmPDxcRight
=
0x4455
,
sprmPNest
=
0x465f
,
sprmPNest80
=
0x4610
,
sprmPDyaLine
=
0x6412
,
sprmPDyaBefore
=
0xA413
,
sprmPDyaAfter
=
0xA414
,
sprmPFDyaAfterAuto
=
0x245c
,
sprmPFDyaBeforeAuto
=
0x245b
,
sprmPDylAfter
=
0x4459
,
sprmPDylBefore
=
0x4458
,
sprmPChgTabs
=
0xC615
,
sprmPFInTable
=
0x2416
,
sprmPFTtp
=
0x2417
,
sprmPDxaAbs
=
0x8418
,
sprmPDyaAbs
=
0x8419
,
sprmPDxaWidth
=
0x841A
,
sprmPPc
=
0x261B
,
sprmPBrcTop10
=
0x461C
,
sprmPBrcLeft10
=
0x461D
,
sprmPBrcBottom10
=
0x461E
,
sprmPBrcRight10
=
0x461F
,
sprmPBrcBetween10
=
0x4620
,
sprmPBrcBar10
=
0x4621
,
sprmPDxaFromText10
=
0x4622
,
sprmPWr
=
0x2423
,
sprmPBrcBar
=
0xc653
,
sprmPBrcBar70
=
0x4629
,
sprmPBrcBar80
=
0x6629
,
sprmPBrcBetween
=
0xc652
,
sprmPBrcBetween70
=
0x4428
,
sprmPBrcBetween80
=
0x6428
,
sprmPBrcBottom
=
0xc650
,
sprmPBrcBottom70
=
0x4426
,
sprmPBrcBottom80
=
0x6426
,
sprmPBrcLeft
=
0xc64f
,
sprmPBrcLeft70
=
0x4425
,
sprmPBrcLeft80
=
0x6425
,
sprmPBrcRight
=
0xc651
,
sprmPBrcRight70
=
0x4427
,
sprmPBrcRight80
=
0x6427
,
sprmPBrcTop
=
0xc64e
,
sprmPBrcTop70
=
0x4424
,
sprmPBrcTop80
=
0x6424
,
sprmPFNoAutoHyph
=
0x242A
,
sprmPWHeightAbs
=
0x442B
,
sprmPDcs
=
0x442C
,
sprmPShd80
=
0x442D
,
sprmPShd
=
0xc64d
,
sprmPDyaFromText
=
0x842E
,
sprmPDxaFromText
=
0x842F
,
sprmPFLocked
=
0x2430
,
sprmPFWidowControl
=
0x2431
,
sprmPRuler
=
0xC632
,
sprmPFKinsoku
=
0x2433
,
sprmPFWordWrap
=
0x2434
,
sprmPFOverflowPunct
=
0x2435
,
sprmPFTopLinePunct
=
0x2436
,
sprmPFAutoSpaceDE
=
0x2437
,
sprmPFAutoSpaceDN
=
0x2438
,
sprmPWAlignFont
=
0x4439
,
sprmPFrameTextFlow
=
0x443A
,
sprmPISnapBaseLine
=
0x243B
,
sprmPAnld80
=
0xC63E
,
sprmPAnldCv
=
0x6654
,
sprmPPropRMark
=
0xC63F
,
sprmPOutLvl
=
0x2640
,
sprmPFBiDi
=
0x2441
,
sprmPFNumRMIns
=
0x2443
,
sprmPNumRM
=
0xC645
,
sprmPHugePapx
=
0x6645
,
sprmPFUsePgsuSettings
=
0x2447
,
sprmPFAdjustRight
=
0x2448
,
sprmPDtap
=
0x664a
,
sprmPFInnerTableCell
=
0x244b
,
sprmPFInnerTtp
=
0x244c
,
sprmPFNoAllowOverlap
=
0x2462
,
sprmPItap
=
0x6649
,
sprmPWall
=
0x2664
,
sprmPIpgp
=
0x6465
,
sprmPCnf
=
0xc666
,
sprmPRsid
=
0x6467
,
sprmPIstdList
=
0x4468
,
sprmPIstdListPermute
=
0xc669
,
sprmPDyaBeforeNotCp0
=
0xa46a
,
sprmPTableProps
=
0x646b
,
sprmPTIstdInfo
=
0xc66c
,
sprmPFContextualSpacing
=
0x246d
,
sprmPRpf
=
0x246e
,
sprmPPropRMark90
=
0xc66f
,
//verison 1995 and earler
sprmOldPIstd
=
2
,
sprmOldPIstdPermute
=
3
,
sprmOldPIncLv1
=
4
,
sprmOldPJc
=
5
,
sprmOldPFSideBySide
=
6
,
sprmOldPFKeep
=
7
,
sprmOldPFKeepFollow
=
8
,
sprmOldPPageBreakBefore
=
9
,
sprmOldPBrcl
=
10
,
sprmOldPBrcp
=
11
,
sprmOldPAnld
=
12
,
sprmOldPNLvlAnm
=
13
,
sprmOldPFNoLineNumb
=
14
,
sprmOldPChgTabsPapx
=
15
,
sprmOldPDxaRight
=
16
,
sprmOldPDxaLeft
=
17
,
sprmOldPNest
=
18
,
sprmOldPDxaLeft1
=
19
,
sprmOldPDyaLine
=
20
,
sprmOldPDyaBefore
=
21
,
sprmOldPDyaAfter
=
22
,
sprmOldPChgTabs
=
23
,
sprmOldPFInTable
=
24
,
sprmOldPTtp
=
25
,
sprmOldPDxaAbs
=
26
,
sprmOldPDyaAbs
=
27
,
sprmOldPDxaWidth
=
28
,
sprmOldPPc
=
29
,
sprmOldPBrcTop10
=
30
,
sprmOldPBrcLeft10
=
31
,
sprmOldPBrcBottom10
=
32
,
sprmOldPBrcRight10
=
33
,
sprmOldPBrcBetween10
=
34
,
sprmOldPBrcBar10
=
35
,
sprmOldPFromText10
=
36
,
sprmOldPWr
=
37
,
sprmOldPBrcTop
=
38
,
sprmOldPBrcLeft
=
39
,
sprmOldPBrcBottom
=
40
,
sprmOldPBrcRight
=
41
,
sprmOldPBrcBetween
=
42
,
sprmOldPBrcBar
=
43
,
sprmOldPFNoAutoHyph
=
44
,
sprmOldPWHeightAbs
=
45
,
sprmOldPDcs
=
46
,
sprmOldPShd
=
47
,
sprmOldPDyaFromText
=
48
,
sprmOldPDxaFromText
=
49
,
sprmOldPFLocked
=
50
,
sprmOldPFWidowControl
=
51
,
sprmOldPRuler
=
52
,
sprmOldCFStrikeRM
=
65
,
sprmOldCFRMark
=
66
,
sprmOldCFFldVanish
=
67
,
sprmOldCPicLocation
=
68
,
sprmOldCIbstRMark
=
69
,
sprmOldCDttmRMark
=
70
,
sprmOldCFData
=
71
,
sprmOldCRMReason
=
72
,
sprmOldCChse
=
73
,
sprmOldCSymbol
=
74
,
sprmOldCFOle2
=
75
,
sprmOldCIstd
=
80
,
sprmOldCIstdPermute
=
81
,
sprmOldCDefault
=
82
,
sprmOldCPlain
=
83
,
sprmOldCFBold
=
85
,
sprmOldCFItalic
=
86
,
sprmOldCFStrike
=
87
,
sprmOldCFOutline
=
88
,
sprmOldCFShadow
=
89
,
sprmOldCFSmallCaps
=
90
,
sprmOldCFCaps
=
91
,
sprmOldCFVanish
=
92
,
sprmOldCFtc
=
93
,
sprmOldCKul
=
94
,
sprmOldCSizePos
=
95
,
sprmOldCDxaSpace
=
96
,
sprmOldCLid
=
97
,
sprmOldCIco
=
98
,
sprmOldCHps
=
99
,
sprmOldCHpsInc
=
100
,
sprmOldCHpsPos
=
101
,
sprmOldCHpsPosAdj
=
102
,
sprmOldCMajority
=
103
,
sprmOldCIss
=
104
,
sprmOldCHpsNew50
=
105
,
sprmOldCHpsInc1
=
106
,
sprmOldCHpsKern
=
107
,
sprmOldCMajority50
=
108
,
sprmOldCHpsMul
=
109
,
sprmOldCCondHyhen
=
110
,
sprmOldCFSpec
=
117
,
sprmOldCFObj
=
118
,
sprmOldPicBrcl
=
119
,
sprmOldPicScale
=
120
,
sprmOldPicBrcTop
=
121
,
sprmOldPicBrcLeft
=
122
,
sprmOldPicBrcBottom
=
123
,
sprmOldPicBrcRight
=
124
,
sprmOldSScnsPgn
=
131
,
sprmOldSiHeadingPgn
=
132
,
sprmOldSOlstAnm
=
133
,
sprmOldSDxaColWidth
=
136
,
sprmOldSDxaColSpacing
=
137
,
sprmOldSFEvenlySpaced
=
138
,
sprmOldSFProtected
=
139
,
sprmOldSDmBinFirst
=
140
,
sprmOldSDmBinOther
=
141
,
sprmOldSBkc
=
142
,
sprmOldSFTitlePage
=
143
,
sprmOldSCcolumns
=
144
,
sprmOldSDxaColumns
=
145
,
sprmOldSFAutoPgn
=
146
,
sprmOldSNfcPgn
=
147
,
sprmOldSDyaPgn
=
148
,
sprmOldSDxaPgn
=
149
,
sprmOldSFPgnRestart
=
150
,
sprmOldSFEndnote
=
151
,
sprmOldSLnc
=
152
,
sprmOldSGprfIhdt
=
153
,
sprmOldSNLnnMod
=
154
,
sprmOldSDxaLnn
=
155
,
sprmOldSDyaHdrTop
=
156
,
sprmOldSDyaHdrBottom
=
157
,
sprmOldSLBetween
=
158
,
sprmOldSVjc
=
159
,
sprmOldSLnnMin
=
160
,
sprmOldSPgnStart
=
161
,
sprmOldSBOrientation
=
162
,
sprmOldSBCustomize
=
163
,
sprmOldSXaPage
=
164
,
sprmOldSYaPage
=
165
,
sprmOldSDxaLeft
=
166
,
sprmOldSDxaRight
=
167
,
sprmOldSDyaTop
=
168
,
sprmOldSDyaBottom
=
169
,
sprmOldSDzaGutter
=
170
,
sprmOldSDMPaperReq
=
171
,
sprmOldTJc
=
182
,
sprmOldTDxaLeft
=
183
,
sprmOldTDxaGapHalf
=
184
,
sprmOldTFCantSplit
=
185
,
sprmOldTTableHeader
=
186
,
sprmOldTTableBorders
=
187
,
sprmOldTDefTable10
=
188
,
sprmOldTDyaRowHeight
=
189
,
sprmOldTDefTable
=
190
,
sprmOldTDefTableShd
=
191
,
sprmOldTTlp
=
192
,
sprmOldTSetBrc
=
193
,
sprmOldTInsert
=
194
,
sprmOldTDelete
=
195
,
sprmOldTDxaCol
=
196
,
sprmOldTMerge
=
197
,
sprmOldTSplit
=
198
,
sprmOldTSetBrc10
=
199
,
sprmOldTSetShd
=
200
,
sprmOldMax
=
208
,
//Character SPRMs
sprmCFRMarkDel
=
0x0800
,
sprmCFRMark
=
0x0801
,
sprmCFFldVanish
=
0x0802
,
sprmCFSdtVanish
=
0x2A90
,
sprmCPicLocation
=
0x6A03
,
sprmCIbstRMark
=
0x4804
,
sprmCDttmRMark
=
0x6805
,
sprmCFData
=
0x0806
,
sprmCIdslRMark
=
0x4807
,
sprmCChs
=
0xEA08
,
sprmCSymbol
=
0x6A09
,
sprmCFOle2
=
0x080A
,
sprmCIdCharType
=
0x480B
,
sprmCHighlight
=
0x2A0C
,
sprmCObjLocation
=
0x680E
,
sprmCObjpLocation
=
0x680e
,
sprmCFFtcAsciSymb
=
0x2A10
,
sprmCIstd
=
0x4A30
,
sprmCIstdPermute
=
0xCA31
,
sprmCDefault
=
0x2A32
,
sprmCPlain
=
0x2A33
,
sprmCKcd
=
0x2A34
,
sprmCFBold
=
0x0835
,
sprmCFItalic
=
0x0836
,
sprmCFStrike
=
0x0837
,
sprmCFOutline
=
0x0838
,
sprmCFShadow
=
0x0839
,
sprmCFSmallCaps
=
0x083A
,
sprmCFCaps
=
0x083B
,
sprmCFVanish
=
0x083C
,
sprmCFtcDefault
=
0x4A3D
,
sprmCKul
=
0x2A3E
,
sprmCSizePos
=
0xEA3F
,
sprmCDxaSpace
=
0x8840
,
sprmCLid
=
0x4A41
,
sprmCIco
=
0x2A42
,
sprmCHps
=
0x4A43
,
sprmCHpsInc
=
0x2A44
,
sprmCHpsPos
=
0x4845
,
sprmCHpsPosAdj
=
0x2A46
,
sprmCMajority
=
0xCA47
,
sprmCIss
=
0x2A48
,
sprmCHpsNew50
=
0xCA49
,
sprmCHpsInc1
=
0xCA4A
,
sprmCHpsKern
=
0x484B
,
sprmCMajority50
=
0xCA4C
,
sprmCHpsMul
=
0x4A4D
,
sprmCHresi
=
0x484e
,
sprmCRgFtc0
=
0x4A4F
,
sprmCRgFtc1
=
0x4A50
,
sprmCRgFtc2
=
0x4A51
,
sprmCCharScale
=
0x4852
,
sprmCFDStrike
=
0x2A53
,
sprmCFImprint
=
0x0854
,
sprmCFSpec
=
0x0855
,
sprmCFObj
=
0x0856
,
sprmCPropRMark1
=
0xCA57
,
sprmCFEmboss
=
0x0858
,
sprmCSfxText
=
0x2859
,
sprmCFBiDi
=
0x085A
,
sprmCFDiacColor
=
0x085B
,
sprmCFBoldBi
=
0x085C
,
sprmCFItalicBi
=
0x085D
,
sprmCFtcBi
=
0x4A5E
,
sprmCLidBi
=
0x485F
,
sprmCIcoBi
=
0x4A60
,
sprmCHpsBi
=
0x4A61
,
sprmCDispFldRMark
=
0xCA62
,
sprmCIbstRMarkDel
=
0x4863
,
sprmCDttmRMarkDel
=
0x6864
,
sprmCBrc80
=
0x6865
,
sprmCBrc
=
0xca72
,
sprmCShd80
=
0x4866
,
sprmCShd
=
0xca71
,
sprmCIdslRMarkDel
=
0x4867
,
sprmCFUsePgsuSettings
=
0x0868
,
sprmCCpg
=
0x486B
,
sprmCRgLid0_80
=
0x486D
,
sprmCRgLid0
=
0x4873
,
sprmCRgLid1_80
=
0x486E
,
sprmCRgLid1
=
0x4874
,
sprmCIdctHint
=
0x286F
,
sprmCCv
=
0x6870
,
sprmCCvPermute
=
0xca7c
,
sprmCCvUl
=
0x6877
,
sprmCFBoldPresent
=
0x287d
,
sprmCFELayout
=
0xca78
,
sprmCFItalicPresent
=
0x287e
,
sprmCFitText
=
0xca76
,
sprmCFLangApplied
=
0x2a7a
,
sprmCFNoProof
=
0x875
,
sprmCFWebHidden
=
0x811
,
sprmCHsp
=
0x6a12
,
sprmCLbcCRJ
=
0x2879
,
sprmCNewIbstRM
=
0xca13
,
sprmCTransNoProof0
=
0x287f
,
sprmCTransNoProof1
=
0x2880
,
sprmCFRMMove
=
0x2814
,
sprmCRsidProp
=
0x6815
,
sprmCRsidText
=
0x6816
,
sprmCRsidRMDel
=
0x6817
,
sprmCFSpecVanish
=
0x0818
,
sprmCFComplexScripts
=
0x0882
,
sprmCWall
=
0x2a83
,
sprmCPbi
=
0xca84
,
sprmCCnf
=
0xca85
,
sprmCNeedFontFixup
=
0x2a86
,
sprmCPbiIBullet
=
0x6887
,
sprmCPbiGrf
=
0x4888
,
sprmCPropRMark2
=
0xca89
,
//version 1996 and later
//Paragraph sprmOlds
sprmPIstd
=
0x4600
,
sprmPIstdPermute
=
0xC601
,
sprmPIncLvl
=
0x2602
,
sprmPJc
=
0x2461
,
sprmPJc80
=
0x2403
,
sprmPFSideBySide
=
0x2404
,
sprmPFKeep
=
0x2405
,
sprmPFKeepFollow
=
0x2406
,
sprmPFPageBreakBefore
=
0x2407
,
sprmPBrcl
=
0x2408
,
sprmPBrcp
=
0x2409
,
sprmPIlvl
=
0x260A
,
sprmPIlfo
=
0x460B
,
sprmPFNoLineNumb
=
0x240C
,
sprmPChgTabsPapx
=
0xC60D
,
sprmPDxaLeft
=
0x845e
,
sprmPDxaLeft80
=
0x840f
,
sprmPDxaLeft1
=
0x8460
,
sprmPDxaLeft180
=
0x8411
,
sprmPDxaRight
=
0x845d
,
sprmPDxaRight80
=
0x840e
,
sprmPDxcLeft
=
0x4456
,
sprmPDxcLeft1
=
0x4457
,
sprmPDxcRight
=
0x4455
,
sprmPNest
=
0x465f
,
sprmPNest80
=
0x4610
,
sprmPDyaLine
=
0x6412
,
sprmPDyaBefore
=
0xA413
,
sprmPDyaAfter
=
0xA414
,
sprmPFDyaAfterAuto
=
0x245c
,
sprmPFDyaBeforeAuto
=
0x245b
,
sprmPDylAfter
=
0x4459
,
sprmPDylBefore
=
0x4458
,
sprmPChgTabs
=
0xC615
,
sprmPFInTable
=
0x2416
,
sprmPFTtp
=
0x2417
,
sprmPDxaAbs
=
0x8418
,
sprmPDyaAbs
=
0x8419
,
sprmPDxaWidth
=
0x841A
,
sprmPPc
=
0x261B
,
sprmPBrcTop10
=
0x461C
,
sprmPBrcLeft10
=
0x461D
,
sprmPBrcBottom10
=
0x461E
,
sprmPBrcRight10
=
0x461F
,
sprmPBrcBetween10
=
0x4620
,
sprmPBrcBar10
=
0x4621
,
sprmPDxaFromText10
=
0x4622
,
sprmPWr
=
0x2423
,
sprmPBrcBar
=
0xc653
,
sprmPBrcBar70
=
0x4629
,
sprmPBrcBar80
=
0x6629
,
sprmPBrcBetween
=
0xc652
,
sprmPBrcBetween70
=
0x4428
,
sprmPBrcBetween80
=
0x6428
,
sprmPBrcBottom
=
0xc650
,
sprmPBrcBottom70
=
0x4426
,
sprmPBrcBottom80
=
0x6426
,
sprmPBrcLeft
=
0xc64f
,
sprmPBrcLeft70
=
0x4425
,
sprmPBrcLeft80
=
0x6425
,
sprmPBrcRight
=
0xc651
,
sprmPBrcRight70
=
0x4427
,
sprmPBrcRight80
=
0x6427
,
sprmPBrcTop
=
0xc64e
,
sprmPBrcTop70
=
0x4424
,
sprmPBrcTop80
=
0x6424
,
sprmPFNoAutoHyph
=
0x242A
,
sprmPWHeightAbs
=
0x442B
,
sprmPDcs
=
0x442C
,
sprmPShd80
=
0x442D
,
sprmPShd
=
0xc64d
,
sprmPDyaFromText
=
0x842E
,
sprmPDxaFromText
=
0x842F
,
sprmPFLocked
=
0x2430
,
sprmPFWidowControl
=
0x2431
,
sprmPRuler
=
0xC632
,
sprmPFKinsoku
=
0x2433
,
sprmPFWordWrap
=
0x2434
,
sprmPFOverflowPunct
=
0x2435
,
sprmPFTopLinePunct
=
0x2436
,
sprmPFAutoSpaceDE
=
0x2437
,
sprmPFAutoSpaceDN
=
0x2438
,
sprmPWAlignFont
=
0x4439
,
sprmPFrameTextFlow
=
0x443A
,
sprmPISnapBaseLine
=
0x243B
,
sprmPAnld80
=
0xC63E
,
sprmPAnldCv
=
0x6654
,
sprmPPropRMark
=
0xC63F
,
sprmPOutLvl
=
0x2640
,
sprmPFBiDi
=
0x2441
,
sprmPFNumRMIns
=
0x2443
,
sprmPNumRM
=
0xC645
,
sprmPHugePapx
=
0x6645
,
sprmPFUsePgsuSettings
=
0x2447
,
sprmPFAdjustRight
=
0x2448
,
sprmPDtap
=
0x664a
,
sprmPFInnerTableCell
=
0x244b
,
sprmPFInnerTtp
=
0x244c
,
sprmPFNoAllowOverlap
=
0x2462
,
sprmPItap
=
0x6649
,
sprmPWall
=
0x2664
,
sprmPIpgp
=
0x6465
,
sprmPCnf
=
0xc666
,
sprmPRsid
=
0x6467
,
sprmPIstdList
=
0x4468
,
sprmPIstdListPermute
=
0xc669
,
sprmPDyaBeforeNotCp0
=
0xa46a
,
sprmPTableProps
=
0x646b
,
sprmPTIstdInfo
=
0xc66c
,
sprmPFContextualSpacing
=
0x246d
,
sprmPRpf
=
0x246e
,
sprmPPropRMark90
=
0xc66f
,
//Picture SPRMs
sprmPicBrcl
=
0x2E00
,
sprmPicScale
=
0xCE01
,
sprmPicBrcTop80
=
0x6C02
,
sprmPicBrcBottom
=
0xce0a
,
sprmPicBrcBottom70
=
0x4c04
,
sprmPicBrcLeft80
=
0x6C03
,
sprmPicBrcLeft
=
0xce09
,
sprmPicBrcLeft70
=
0x4c03
,
sprmPicBrcBottom80
=
0x6C04
,
sprmPicBrcRight
=
0xce0b
,
sprmPicBrcRight70
=
0x4c05
,
sprmPicBrcRight80
=
0x6C05
,
sprmPicBrcTop
=
0xce08
,
sprmPicBrcTop70
=
0x4c02
,
sprmPicSpare4
=
0xce06
,
sprmCFOle2WasHere
=
0xce07
,
//Character sprms
sprmCFRMarkDel
=
0x0800
,
sprmCFRMark
=
0x0801
,
sprmCFFldVanish
=
0x0802
,
sprmCFSdtVanish
=
0x2A90
,
sprmCPicLocation
=
0x6A03
,
sprmCIbstRMark
=
0x4804
,
sprmCDttmRMark
=
0x6805
,
sprmCFData
=
0x0806
,
sprmCIdslRMark
=
0x4807
,
sprmCChs
=
0xEA08
,
sprmCSymbol
=
0x6A09
,
sprmCFOle2
=
0x080A
,
sprmCIdCharType
=
0x480B
,
sprmCHighlight
=
0x2A0C
,
sprmCObjLocation
=
0x680E
,
sprmCObjpLocation
=
0x680e
,
sprmCFFtcAsciSymb
=
0x2A10
,
sprmCIstd
=
0x4A30
,
sprmCIstdPermute
=
0xCA31
,
sprmCDefault
=
0x2A32
,
sprmCPlain
=
0x2A33
,
sprmCKcd
=
0x2A34
,
sprmCFBold
=
0x0835
,
sprmCFItalic
=
0x0836
,
sprmCFStrike
=
0x0837
,
sprmCFOutline
=
0x0838
,
sprmCFShadow
=
0x0839
,
sprmCFSmallCaps
=
0x083A
,
sprmCFCaps
=
0x083B
,
sprmCFVanish
=
0x083C
,
sprmCFtcDefault
=
0x4A3D
,
sprmCKul
=
0x2A3E
,
sprmCSizePos
=
0xEA3F
,
sprmCDxaSpace
=
0x8840
,
sprmCLid
=
0x4A41
,
sprmCIco
=
0x2A42
,
sprmCHps
=
0x4A43
,
sprmCHpsInc
=
0x2A44
,
sprmCHpsPos
=
0x4845
,
sprmCHpsPosAdj
=
0x2A46
,
sprmCMajority
=
0xCA47
,
sprmCIss
=
0x2A48
,
sprmCHpsNew50
=
0xCA49
,
sprmCHpsInc1
=
0xCA4A
,
sprmCHpsKern
=
0x484B
,
sprmCMajority50
=
0xCA4C
,
sprmCHpsMul
=
0x4A4D
,
sprmCHresi
=
0x484e
,
sprmCRgFtc0
=
0x4A4F
,
sprmCRgFtc1
=
0x4A50
,
sprmCRgFtc2
=
0x4A51
,
sprmCCharScale
=
0x4852
,
sprmCFDStrike
=
0x2A53
,
sprmCFImprint
=
0x0854
,
sprmCFSpec
=
0x0855
,
sprmCFObj
=
0x0856
,
sprmCPropRMark1
=
0xCA57
,
sprmCFEmboss
=
0x0858
,
sprmCSfxText
=
0x2859
,
sprmCFBiDi
=
0x085A
,
sprmCFDiacColor
=
0x085B
,
sprmCFBoldBi
=
0x085C
,
sprmCFItalicBi
=
0x085D
,
sprmCFtcBi
=
0x4A5E
,
sprmCLidBi
=
0x485F
,
sprmCIcoBi
=
0x4A60
,
sprmCHpsBi
=
0x4A61
,
sprmCDispFldRMark
=
0xCA62
,
sprmCIbstRMarkDel
=
0x4863
,
sprmCDttmRMarkDel
=
0x6864
,
sprmCBrc80
=
0x6865
,
sprmCBrc
=
0xca72
,
sprmCShd80
=
0x4866
,
sprmCShd
=
0xca71
,
sprmCIdslRMarkDel
=
0x4867
,
sprmCFUsePgsuSettings
=
0x0868
,
sprmCCpg
=
0x486B
,
sprmCRgLid0_80
=
0x486D
,
sprmCRgLid0
=
0x4873
,
sprmCRgLid1_80
=
0x486E
,
sprmCRgLid1
=
0x4874
,
sprmCIdctHint
=
0x286F
,
sprmCCv
=
0x6870
,
sprmCCvPermute
=
0xca7c
,
sprmCCvUl
=
0x6877
,
sprmCFBoldPresent
=
0x287d
,
sprmCFELayout
=
0xca78
,
sprmCFItalicPresent
=
0x287e
,
sprmCFitText
=
0xca76
,
sprmCFLangApplied
=
0x2a7a
,
sprmCFNoProof
=
0x875
,
sprmCFWebHidde
=
0x811
,
sprmCHsp
=
0x6a12
,
sprmCLbcCRJ
=
0x2879
,
sprmCNewIbstRM
=
0xca13
,
sprmCTransNoProof0
=
0x287f
,
sprmCTransNoProof1
=
0x2880
,
sprmCFRMMove
=
0x2814
,
sprmCRsidProp
=
0x6815
,
sprmCRsidText
=
0x6816
,
sprmCRsidRMDel
=
0x6817
,
sprmCFSpecVanish
=
0x0818
,
sprmCFComplexScripts
=
0x0882
,
sprmCWall
=
0x2a83
,
sprmCPbi
=
0xca84
,
sprmCCnf
=
0xca85
,
sprmCNeedFontFixup
=
0x2a86
,
sprmCPbiIBullet
=
0x6887
,
sprmCPbiGrf
=
0x4888
,
sprmCPropRMark2
=
0xca89
,
//Section SPRMs
sprmScnsPgn
=
0x3000
,
sprmSiHeadingPgn
=
0x3001
,
sprmSOlstAnm
=
0xD202
,
sprmSOlstAnm80
=
0xd202
,
sprmSOlstCv
=
0xd238
,
sprmSDxaColWidth
=
0xF203
,
sprmSDxaColSpacing
=
0xF204
,
sprmSFEvenlySpaced
=
0x3005
,
sprmSFProtected
=
0x3006
,
sprmSDmBinFirst
=
0x5007
,
sprmSDmBinOther
=
0x5008
,
sprmSBkc
=
0x3009
,
sprmSFTitlePage
=
0x300A
,
sprmSCcolumns
=
0x500B
,
sprmSDxaColumns
=
0x900C
,
sprmSFAutoPgn
=
0x300D
,
sprmSNfcPgn
=
0x300E
,
sprmSDyaPgn
=
0xB00F
,
sprmSDxaPgn
=
0xB010
,
sprmSFPgnRestart
=
0x3011
,
sprmSFEndnote
=
0x3012
,
sprmSLnc
=
0x3013
,
sprmSGprfIhdt
=
0x3014
,
sprmSNLnnMod
=
0x5015
,
sprmSDxaLnn
=
0x9016
,
sprmSDyaHdrTop
=
0xB017
,
sprmSDyaHdrBottom
=
0xB018
,
sprmSLBetween
=
0x3019
,
sprmSVjc
=
0x301A
,
sprmSLnnMin
=
0x501B
,
sprmSPgnStart
=
0x501C
,
sprmSBOrientation
=
0x301D
,
sprmSXaPage
=
0xB01F
,
sprmSYaPage
=
0xB020
,
sprmSDxaLeft
=
0xB021
,
sprmSDxaRight
=
0xB022
,
sprmSDyaTop
=
0x9023
,
sprmSDyaBottom
=
0x9024
,
sprmSDzaGutter
=
0xB025
,
sprmSDmPaperReq
=
0x5026
,
sprmSPropRMark1
=
0xD227
,
sprmSFBiDi
=
0x3228
,
sprmSFFacingCol
=
0x3229
,
sprmSFRTLGutter
=
0x322A
,
sprmSBrcTop80
=
0x702B
,
sprmSBrcTop
=
0xd234
,
sprmSBrcLeft80
=
0x702C
,
sprmSBrcLeft
=
0xd235
,
sprmSBrcBottom80
=
0x702d
,
sprmSBrcBottom
=
0xd236
,
sprmSBrcRight80
=
0x702e
,
sprmSBrcRight
=
0xd237
,
sprmSPgbProp
=
0x522F
,
sprmSDxtCharSpace
=
0x7030
,
sprmSDyaLinePitch
=
0x9031
,
sprmSClm
=
0x5032
,
sprmSTextFlow
=
0x5033
,
sprmSWall
=
0x3239
,
sprmSRsid
=
0x703a
,
sprmSFpc
=
0x303b
,
sprmSRncFtn
=
0x303c
,
sprmSEpc
=
0x303d
,
sprmSRncEdn
=
0x303e
,
sprmSNFtn
=
0x503f
,
sprmSNfcFtnRef
=
0x5040
,
sprmSNEdn
=
0x5041
,
sprmSNfcEdnRef
=
0x5042
,
sprmSPropRMark2
=
0xd243
,
//Picture sprms
sprmPicBrcl
=
0x2E00
,
sprmPicScale
=
0xCE01
,
sprmPicBrcTop80
=
0x6C02
,
sprmPicBrcBottom
=
0xce0a
,
sprmPicBrcBottom70
=
0x4c04
,
sprmPicBrcLeft80
=
0x6C03
,
sprmPicBrcLeft
=
0xce09
,
sprmPicBrcLeft70
=
0x4c03
,
sprmPicBrcBottom80
=
0x6C04
,
sprmPicBrcRight
=
0xce0b
,
sprmPicBrcRight70
=
0x4c05
,
sprmPicBrcRight80
=
0x6C05
,
sprmPicBrcTop
=
0xce08
,
sprmPicBrcTop70
=
0x4c02
,
sprmPicSpare4
=
0xce06
,
sprmCFOle2WasHere
=
0xce07
,
//Table SPRMs
sprmTDefTable
=
0xD608
,
sprmTDefTable10
=
0xD606
,
sprmTDefTableShd80
=
0xD609
,
sprmTDefTableShd
=
0xd612
,
sprmTDefTableShd2nd
=
0xd616
,
sprmTDefTableShd3rd
=
0xd60c
,
sprmTDelete
=
0x5622
,
sprmTDiagLine
=
0xd630
,
sprmTDiagLine80
=
0xd62a
,
sprmTDxaCol
=
0x7623
,
sprmTDxaGapHalf
=
0x9602
,
sprmTDxaLeft
=
0x9601
,
sprmTDyaRowHeight
=
0x9407
,
sprmTFBiDi80
=
0x560b
,
sprmTFCantSplit
=
0x3403
,
sprmTHTMLProps
=
0x740C
,
sprmTInsert
=
0x7621
,
sprmTJc
=
0x5400
,
sprmTMerge
=
0x5624
,
sprmTSetBrc80
=
0xD620
,
sprmTSetBrc10
=
0xD626
,
sprmTSetBrc
=
0xd62f
,
sprmTSetShd80
=
0x7627
,
sprmTSetShdOdd80
=
0x7628
,
sprmTSetShd
=
0xd62d
,
sprmTSetShdOdd
=
0xd62e
,
sprmTSetShdTable
=
0xd660
,
sprmTSplit
=
0x5625
,
sprmTTableBorders
=
0xd613
,
sprmTTableBorders80
=
0xd605
,
sprmTTableHeader
=
0x3404
,
sprmTTextFlow
=
0x7629
,
sprmTTlp
=
0x740A
,
sprmTVertAlign
=
0xD62C
,
sprmTVertMerge
=
0xD62B
,
sprmTFCellNoWrap
=
0xd639
,
sprmTFitText
=
0xf636
,
sprmTFKeepFollow
=
0x3619
,
sprmTFNeverBeenAutofit
=
0x3663
,
sprmTFNoAllowOverlap
=
0x3465
,
sprmTPc
=
0x360d
,
sprmTBrcBottomCv
=
0xd61c
,
sprmTBrcLeftCv
=
0xd61b
,
sprmTBrcRightCv
=
0xd61d
,
sprmTBrcTopCv
=
0xd61a
,
sprmTCellBrcType
=
0xd662
,
sprmTCellPadding
=
0xd632
,
sprmTCellPaddingDefault
=
0xd634
,
sprmTCellPaddingOuter
=
0xd638
,
sprmTCellSpacing
=
0xd631
,
sprmTCellSpacingDefault
=
0xd633
,
sprmTCellSpacingOuter
=
0xd637
,
sprmTCellWidth
=
0xd635
,
sprmTDxaAbs
=
0x940e
,
sprmTDxaFromText
=
0x9410
,
sprmTDxaFromTextRight
=
0x941e
,
sprmTDyaAbs
=
0x940f
,
sprmTDyaFromText
=
0x9411
,
sprmTDyaFromTextBottom
=
0x941f
,
sprmTFAutofit
=
0x3615
,
sprmTTableWidth
=
0xf614
,
sprmTWidthAfter
=
0xf618
,
sprmTWidthBefore
=
0xf617
,
sprmTWidthIndent
=
0xf661
,
sprmTIstd
=
0x563a
,
sprmTSetShdRaw
=
0xd63b
,
sprmTSetShdOddRaw
=
0xd63c
,
sprmTIstdPermute
=
0xd63d
,
sprmTCellPaddingStyle
=
0xd63e
,
sprmTFCantSplit90
=
0x3466
,
sprmTPropRMark
=
0xd667
,
sprmTWall
=
0x3668
,
sprmTIpgp
=
0x7469
,
sprmTCnf
=
0xd66a
,
sprmTSetShdTableDef
=
0xd66b
,
sprmTDiagLine2nd
=
0xd66c
,
sprmTDiagLine3rd
=
0xd66d
,
sprmTDiagLine4th
=
0xd66e
,
sprmTDiagLine5th
=
0xd66f
,
sprmTDefTableShdRaw
=
0xd670
,
sprmTDefTableShdRaw2nd
=
0xd671
,
sprmTDefTableShdRaw3rd
=
0xd672
,
sprmTSetShdRowFirst
=
0xd673
,
sprmTSetShdRowLast
=
0xd674
,
sprmTSetShdColFirst
=
0xd675
,
sprmTSetShdColLast
=
0xd676
,
sprmTSetShdBand1
=
0xd677
,
sprmTSetShdBand2
=
0xd678
,
sprmTRsid
=
0x7479
,
sprmTCellWidthStyle
=
0xf47a
,
sprmTCellPaddingStyleBad
=
0xd67b
,
sprmTCellVertAlignStyle
=
0x347c
,
sprmTCellNoWrapStyle
=
0x347d
,
sprmTCellFitTextStyle
=
0x347e
,
sprmTCellBrcTopStyle
=
0xd47f
,
sprmTCellBrcBottomStyle
=
0xd680
,
sprmTCellBrcLeftStyle
=
0xd681
,
sprmTCellBrcRightStyle
=
0xd682
,
sprmTCellBrcInsideHStyle
=
0xd683
,
sprmTCellBrcInsideVStyle
=
0xd684
,
sprmTCellBrcTL2BRStyle
=
0xd685
,
sprmTCellBrcTR2BLStyle
=
0xd686
,
sprmTCellShdStyle
=
0xd687
,
sprmTCHorzBands
=
0x3488
,
sprmTCVertBands
=
0x3489
,
sprmTJcRow
=
0x548a
,
sprmTTableBrcTop
=
0xd68b
,
sprmTTableBrcLeft
=
0xd68c
,
sprmTTableBrcBottom
=
0xd68d
,
sprmTTableBrcRight
=
0xd68e
,
sprmTTableBrcInsideH
=
0xd68f
,
sprmTTableBrcInsideV
=
0xd690
,
sprmTFBiDi
=
0x560b
,
sprmTFBiDi90
=
0x5664
//Section sprms
sprmScnsPgn
=
0x3000
,
sprmSiHeadingPgn
=
0x3001
,
sprmSOlstAnm
=
0xD202
,
sprmSOlstAnm80
=
0xd202
,
sprmSOlstCv
=
0xd238
,
sprmSDxaColWidth
=
0xF203
,
sprmSDxaColSpacing
=
0xF204
,
sprmSFEvenlySpaced
=
0x3005
,
sprmSFProtected
=
0x3006
,
sprmSDmBinFirst
=
0x5007
,
sprmSDmBinOther
=
0x5008
,
sprmSBkc
=
0x3009
,
sprmSFTitlePage
=
0x300A
,
sprmSCcolumns
=
0x500B
,
sprmSDxaColumns
=
0x900C
,
sprmSFAutoPgn
=
0x300D
,
sprmSNfcPgn
=
0x300E
,
sprmSDyaPgn
=
0xB00F
,
sprmSDxaPgn
=
0xB010
,
sprmSFPgnRestart
=
0x3011
,
sprmSFEndnote
=
0x3012
,
sprmSLnc
=
0x3013
,
sprmSGprfIhdt
=
0x3014
,
sprmSNLnnMod
=
0x5015
,
sprmSDxaLnn
=
0x9016
,
sprmSDyaHdrTop
=
0xB017
,
sprmSDyaHdrBottom
=
0xB018
,
sprmSLBetween
=
0x3019
,
sprmSVjc
=
0x301A
,
sprmSLnnMin
=
0x501B
,
sprmSPgnStart
=
0x501C
,
sprmSBOrientation
=
0x301D
,
sprmSXaPage
=
0xB01F
,
sprmSYaPage
=
0xB020
,
sprmSDxaLeft
=
0xB021
,
sprmSDxaRight
=
0xB022
,
sprmSDyaTop
=
0x9023
,
sprmSDyaBottom
=
0x9024
,
sprmSDzaGutter
=
0xB025
,
sprmSDmPaperReq
=
0x5026
,
sprmSPropRMark1
=
0xD227
,
sprmSFBiDi
=
0x3228
,
sprmSFFacingCol
=
0x3229
,
sprmSFRTLGutter
=
0x322A
,
sprmSBrcTop80
=
0x702B
,
sprmSBrcTop
=
0xd234
,
sprmSBrcLeft80
=
0x702C
,
sprmSBrcLeft
=
0xd235
,
sprmSBrcBottom80
=
0x702d
,
sprmSBrcBottom
=
0xd236
,
sprmSBrcRight80
=
0x702e
,
sprmSBrcRight
=
0xd237
,
sprmSPgbProp
=
0x522F
,
sprmSDxtCharSpace
=
0x7030
,
sprmSDyaLinePitch
=
0x9031
,
sprmSClm
=
0x5032
,
sprmSTextFlow
=
0x5033
,
sprmSWall
=
0x3239
,
sprmSRsid
=
0x703a
,
sprmSFpc
=
0x303b
,
sprmSRncFtn
=
0x303c
,
sprmSEpc
=
0x303d
,
sprmSRncEdn
=
0x303e
,
sprmSNFtn
=
0x503f
,
sprmSNfcFtnRef
=
0x5040
,
sprmSNEdn
=
0x5041
,
sprmSNfcEdnRef
=
0x5042
,
sprmSPropRMark2
=
0xd243
,
//Table sprms
sprmTDefTable
=
0xD608
,
sprmTDefTable10
=
0xD606
,
sprmTDefTableShd80
=
0xD609
,
sprmTDefTableShd
=
0xd612
,
sprmTDefTableShd2nd
=
0xd616
,
sprmTDefTableShd3rd
=
0xd60c
,
sprmTDelete
=
0x5622
,
sprmTDiagLine
=
0xd630
,
sprmTDiagLine80
=
0xd62a
,
sprmTDxaCol
=
0x7623
,
sprmTDxaGapHalf
=
0x9602
,
sprmTDxaLeft
=
0x9601
,
sprmTDyaRowHeight
=
0x9407
,
sprmTFBiDi80
=
0x560b
,
sprmTFCantSplit
=
0x3403
,
sprmTHTMLProps
=
0x740C
,
sprmTInsert
=
0x7621
,
sprmTJc
=
0x5400
,
sprmTMerge
=
0x5624
,
sprmTSetBrc80
=
0xD620
,
sprmTSetBrc10
=
0xD626
,
sprmTSetBrc
=
0xd62f
,
sprmTSetShd80
=
0x7627
,
sprmTSetShdOdd80
=
0x7628
,
sprmTSetShd
=
0xd62d
,
sprmTSetShdOdd
=
0xd62e
,
sprmTSetShdTable
=
0xd660
,
sprmTSplit
=
0x5625
,
sprmTTableBorders
=
0xd613
,
sprmTTableBorders80
=
0xd605
,
sprmTTableHeader
=
0x3404
,
sprmTTextFlow
=
0x7629
,
sprmTTlp
=
0x740A
,
sprmTVertAlign
=
0xD62C
,
sprmTVertMerge
=
0xD62B
,
sprmTFCellNoWrap
=
0xd639
,
sprmTFitText
=
0xf636
,
sprmTFKeepFollow
=
0x3619
,
sprmTFNeverBeenAutofit
=
0x3663
,
sprmTFNoAllowOverlap
=
0x3465
,
sprmTPc
=
0x360d
,
sprmTBrcBottomCv
=
0xd61c
,
sprmTBrcLeftCv
=
0xd61b
,
sprmTBrcRightCv
=
0xd61d
,
sprmTBrcTopCv
=
0xd61a
,
sprmTCellBrcType
=
0xd662
,
sprmTCellPadding
=
0xd632
,
sprmTCellPaddingDefault
=
0xd634
,
sprmTCellPaddingOuter
=
0xd638
,
sprmTCellSpacing
=
0xd631
,
sprmTCellSpacingDefault
=
0xd633
,
sprmTCellSpacingOuter
=
0xd637
,
sprmTCellWidth
=
0xd635
,
sprmTDxaAbs
=
0x940e
,
sprmTDxaFromText
=
0x9410
,
sprmTDxaFromTextRight
=
0x941e
,
sprmTDyaAbs
=
0x940f
,
sprmTDyaFromText
=
0x9411
,
sprmTDyaFromTextBottom
=
0x941f
,
sprmTFAutofit
=
0x3615
,
sprmTTableWidth
=
0xf614
,
sprmTWidthAfter
=
0xf618
,
sprmTWidthBefore
=
0xf617
,
sprmTWidthIndent
=
0xf661
,
sprmTIstd
=
0x563a
,
sprmTSetShdRaw
=
0xd63b
,
sprmTSetShdOddRaw
=
0xd63c
,
sprmTIstdPermute
=
0xd63d
,
sprmTCellPaddingStyle
=
0xd63e
,
sprmTFCantSplit90
=
0x3466
,
sprmTPropRMark
=
0xd667
,
sprmTWall
=
0x3668
,
sprmTIpgp
=
0x7469
,
sprmTCnf
=
0xd66a
,
sprmTSetShdTableDef
=
0xd66b
,
sprmTDiagLine2nd
=
0xd66c
,
sprmTDiagLine3rd
=
0xd66d
,
sprmTDiagLine4th
=
0xd66e
,
sprmTDiagLine5th
=
0xd66f
,
sprmTDefTableShdRaw
=
0xd670
,
sprmTDefTableShdRaw2nd
=
0xd671
,
sprmTDefTableShdRaw3rd
=
0xd672
,
sprmTSetShdRowFirst
=
0xd673
,
sprmTSetShdRowLast
=
0xd674
,
sprmTSetShdColFirst
=
0xd675
,
sprmTSetShdColLast
=
0xd676
,
sprmTSetShdBand1
=
0xd677
,
sprmTSetShdBand2
=
0xd678
,
sprmTRsid
=
0x7479
,
sprmTCellWidthStyle
=
0xf47a
,
sprmTCellPaddingStyleBad
=
0xd67b
,
sprmTCellVertAlignStyle
=
0x347c
,
sprmTCellNoWrapStyle
=
0x347d
,
sprmTCellFitTextStyle
=
0x347e
,
sprmTCellBrcTopStyle
=
0xd47f
,
sprmTCellBrcBottomStyle
=
0xd680
,
sprmTCellBrcLeftStyle
=
0xd681
,
sprmTCellBrcRightStyle
=
0xd682
,
sprmTCellBrcInsideHStyle
=
0xd683
,
sprmTCellBrcInsideVStyle
=
0xd684
,
sprmTCellBrcTL2BRStyle
=
0xd685
,
sprmTCellBrcTR2BLStyle
=
0xd686
,
sprmTCellShdStyle
=
0xd687
,
sprmTCHorzBands
=
0x3488
,
sprmTCVertBands
=
0x3489
,
sprmTJcRow
=
0x548a
,
sprmTTableBrcTop
=
0xd68b
,
sprmTTableBrcLeft
=
0xd68c
,
sprmTTableBrcBottom
=
0xd68d
,
sprmTTableBrcRight
=
0xd68e
,
sprmTTableBrcInsideH
=
0xd68f
,
sprmTTableBrcInsideV
=
0xd690
,
sprmTFBiDi
=
0x560b
,
sprmTFBiDi90
=
0x5664
}
OperationCode
;
}
\ No newline at end of file
ASCOfficeDocFile/Common/TextMark.h
View file @
ab2461a5
...
...
@@ -33,32 +33,32 @@
namespace
TextMark
{
static
const
wchar_t
ParagraphEnd
=
(
wchar_t
)
13
;
static
const
wchar_t
ParagraphEnd
=
(
wchar_t
)
13
;
static
const
wchar_t
HardLineBreak
=
(
wchar_t
)
11
;
static
const
wchar_t
BreakingHyphen
=
(
wchar_t
)
4
;
static
const
wchar_t
CellOrRowMark
=
(
wchar_t
)
7
;
static
const
wchar_t
NonRequiredHyphen
=
(
wchar_t
)
31
;
static
const
wchar_t
NonBreakingHyphen
=
(
wchar_t
)
30
;
static
const
wchar_t
NonBreakingSpace
=
(
wchar_t
)
160
;
static
const
wchar_t
NonBreakingSpace
=
(
wchar_t
)
160
;
static
const
wchar_t
Space
=
(
wchar_t
)
32
;
static
const
wchar_t
PageBreakOrSectionMark
=
(
wchar_t
)
12
;
static
const
wchar_t
ColumnBreak
=
(
wchar_t
)
14
;
static
const
wchar_t
Tab
=
(
wchar_t
)
9
;
static
const
wchar_t
ColumnBreak
=
(
wchar_t
)
14
;
static
const
wchar_t
Tab
=
(
wchar_t
)
9
;
static
const
wchar_t
FieldBeginMark
=
(
wchar_t
)
19
;
static
const
wchar_t
FieldSeparator
=
(
wchar_t
)
20
;
static
const
wchar_t
FieldEndMark
=
(
wchar_t
)
21
;
static
const
wchar_t
FieldEndMark
=
(
wchar_t
)
21
;
//Special WCHARacters (chp.fSpec == 1)
static
const
wchar_t
CurrentPageNumber
=
(
wchar_t
)
0
;
static
const
wchar_t
Picture
=
(
wchar_t
)
1
;
static
const
wchar_t
Picture
=
(
wchar_t
)
1
;
static
const
wchar_t
AutoNumberedFootnoteReference
=
(
wchar_t
)
2
;
static
const
wchar_t
AutoNumberedEndnoteReference
=
(
wchar_t
)
2
;
static
const
wchar_t
AutoNumberedEndnoteReference
=
(
wchar_t
)
2
;
static
const
wchar_t
FootnoteSeparator
=
(
wchar_t
)
3
;
static
const
wchar_t
FootnoteContinuation
=
(
wchar_t
)
4
;
static
const
wchar_t
AnnotationReference
=
(
wchar_t
)
5
;
static
const
wchar_t
FootnoteContinuation
=
(
wchar_t
)
4
;
static
const
wchar_t
AnnotationReference
=
(
wchar_t
)
5
;
static
const
wchar_t
LineNumber
=
(
wchar_t
)
6
;
static
const
wchar_t
HandAnnotationPicture
=
(
wchar_t
)
7
;
static
const
wchar_t
DrawnObject
=
(
wchar_t
)
8
;
static
const
wchar_t
DrawnObject
=
(
wchar_t
)
8
;
static
const
wchar_t
Symbol
=
(
wchar_t
)
40
;
}
\ No newline at end of file
ASCOfficeDocFile/DocDocxConverter/CharacterPropertiesMapping.cpp
View file @
ab2461a5
...
...
@@ -72,26 +72,24 @@ namespace DocFileFormat
void
CharacterPropertiesMapping
::
Apply
(
IVisitable
*
chpx
)
{
//convert the normal SPRMS
convertSprms
(
dynamic_cast
<
CharacterPropertyExceptions
*>
(
chpx
)
->
grpprl
,
this
->
_rPr
);
convertSprms
(
dynamic_cast
<
CharacterPropertyExceptions
*>
(
chpx
)
->
grpprl
,
_rPr
);
// apend revision changes
if
(
_revisionData
->
Type
==
Changed
)
{
XMLTools
::
XMLElement
<
wchar_t
>
rPrChange
(
_T
(
"w:rPrChange"
)
);
//!!!TODO!!!
//date
//_revisionData->Dttm.Convert( new DateMapping( rPrChange ) );
//todooo date - _revisionData->Dttm.Convert( new DateMapping( rPrChange ) );
WideString
*
author_str
=
static_cast
<
WideString
*>
(
this
->
_doc
->
RevisionAuthorTable
->
operator
[](
_revisionData
->
Isbt
));
WideString
*
author_str
=
static_cast
<
WideString
*>
(
_doc
->
RevisionAuthorTable
->
operator
[](
_revisionData
->
Isbt
));
XMLTools
::
XMLAttribute
<
wchar_t
>
author
(
_T
(
"w:author"
),
FormatUtils
::
XmlEncode
(
*
author_str
).
c_str
());
rPrChange
.
AppendAttribute
(
author
);
//convert revision stack
convertSprms
(
this
->
_revisionData
->
Changes
,
&
rPrChange
);
convertSprms
(
_revisionData
->
Changes
,
&
rPrChange
);
this
->
_rPr
->
AppendChild
(
rPrChange
);
_rPr
->
AppendChild
(
rPrChange
);
}
//write properties
...
...
@@ -107,7 +105,7 @@ namespace DocFileFormat
{
//Todo сделать определение симольного шрифта через fontManager
//Заглушка под Google Docs, они пишут bullet в Arial
if
(
-
1
!=
this
->
m_sAsciiFont
.
find
(
_T
(
"Arial"
))
&&
-
1
!=
this
->
m_sEastAsiaFont
.
find
(
_T
(
"Arial"
))
&&
-
1
!=
this
->
m_shAnsiFont
.
find
(
_T
(
"Arial"
)))
if
(
-
1
!=
m_sAsciiFont
.
find
(
_T
(
"Arial"
))
&&
-
1
!=
m_sEastAsiaFont
.
find
(
_T
(
"Arial"
))
&&
-
1
!=
m_shAnsiFont
.
find
(
_T
(
"Arial"
)))
return
false
;
return
true
;
...
...
@@ -117,10 +115,10 @@ namespace DocFileFormat
void
CharacterPropertiesMapping
::
convertSprms
(
std
::
list
<
SinglePropertyModifier
>*
sprms
,
XMLTools
::
XMLElement
<
wchar_t
>*
parent
)
{
XMLTools
::
XMLElement
<
wchar_t
>
*
rFonts
=
new
XMLTools
::
XMLElement
<
wchar_t
>
(
_T
(
"w:rFonts"
)
);
XMLTools
::
XMLElement
<
wchar_t
>
*
color
=
new
XMLTools
::
XMLElement
<
wchar_t
>
(
_T
(
"w:color"
)
);
XMLTools
::
XMLAttribute
<
wchar_t
>
*
colorVal
=
new
XMLTools
::
XMLAttribute
<
wchar_t
>
(
_T
(
"w:val"
)
);
XMLTools
::
XMLElement
<
wchar_t
>
*
lang
=
new
XMLTools
::
XMLElement
<
wchar_t
>
(
_T
(
"w:lang"
)
);
XMLTools
::
XMLElement
<
wchar_t
>
*
rFonts
=
new
XMLTools
::
XMLElement
<
wchar_t
>
(
_T
(
"w:rFonts"
)
);
XMLTools
::
XMLElement
<
wchar_t
>
*
color
=
new
XMLTools
::
XMLElement
<
wchar_t
>
(
_T
(
"w:color"
)
);
XMLTools
::
XMLAttribute
<
wchar_t
>
*
colorVal
=
new
XMLTools
::
XMLAttribute
<
wchar_t
>
(
_T
(
"w:val"
)
);
XMLTools
::
XMLElement
<
wchar_t
>
*
lang
=
new
XMLTools
::
XMLElement
<
wchar_t
>
(
_T
(
"w:lang"
)
);
if
(
_webHidden
)
{
...
...
@@ -131,57 +129,64 @@ namespace DocFileFormat
std
::
list
<
SinglePropertyModifier
>::
iterator
end
=
sprms
->
end
();
for
(
std
::
list
<
SinglePropertyModifier
>::
iterator
iter
=
sprms
->
begin
();
iter
!=
end
;
++
iter
)
{
int
nProperty
=
0
;
//for unknown test
switch
(
(
int
)(
iter
->
OpCode
)
)
{
case
0x4A30
:
// style id
{
case
sprmOldCIstd
:
case
sprmCIstd
:
// style id
{
if
(
_isRunStyleNeeded
&&
!
_webHidden
)
{
_currentIstd
=
FormatUtils
::
BytesToUInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
);
if
(
_currentIstd
<
this
->
_doc
->
Styles
->
Styles
->
size
())
if
(
_currentIstd
<
_doc
->
Styles
->
Styles
->
size
())
{
appendValueElement
(
parent
,
_T
(
"rStyle"
),
StyleSheetMapping
::
MakeStyleId
(
this
->
_doc
->
Styles
->
Styles
->
at
(
_currentIstd
)
).
c_str
(),
true
);
appendValueElement
(
parent
,
_T
(
"rStyle"
),
StyleSheetMapping
::
MakeStyleId
(
_doc
->
Styles
->
Styles
->
at
(
_currentIstd
)
).
c_str
(),
true
);
}
}
}
break
;
case
0x085A
:
// right to left
}
break
;
case
sprmCFBiDi
:
appendFlagElement
(
parent
,
*
iter
,
_T
(
"rtl"
),
true
);
this
->
_isRTL
=
true
;
_isRTL
=
true
;
break
;
case
0x0835
:
case
sprmOldCFBold
:
case
sprmCFBold
:
appendFlagElement
(
parent
,
*
iter
,
_T
(
"b"
),
true
);
break
;
case
0x085C
:
case
sprmCFBoldBi
:
appendFlagElement
(
parent
,
*
iter
,
_T
(
"bCs"
),
true
);
break
;
case
0x083B
:
case
sprmOldCFCaps
:
case
sprmCFCaps
:
appendFlagElement
(
parent
,
*
iter
,
_T
(
"caps"
),
true
);
break
;
case
0x0882
:
case
sprmCFComplexScripts
:
appendFlagElement
(
parent
,
*
iter
,
_T
(
"cs"
),
true
);
break
;
case
0x2A53
:
case
sprmCFDStrike
:
appendFlagElement
(
parent
,
*
iter
,
_T
(
"dstrike"
),
true
);
break
;
case
0x0858
:
case
sprmCFEmboss
:
appendFlagElement
(
parent
,
*
iter
,
_T
(
"emboss"
),
true
);
break
;
case
0x0854
:
case
sprmCFImprint
:
appendFlagElement
(
parent
,
*
iter
,
_T
(
"imprint"
),
true
);
break
;
case
0x0836
:
case
sprmOldCFItalic
:
case
sprmCFItalic
:
appendFlagElement
(
parent
,
*
iter
,
_T
(
"i"
),
true
);
break
;
case
0x085D
:
case
sprmCFItalicBi
:
appendFlagElement
(
parent
,
*
iter
,
_T
(
"iCs"
),
true
);
break
;
...
...
@@ -189,27 +194,32 @@ namespace DocFileFormat
appendFlagElement
(
parent
,
*
iter
,
_T
(
"noProof"
),
true
);
break
;
case
0x0838
:
case
sprmOldCFOutline
:
case
sprmCFOutline
:
appendFlagElement
(
parent
,
*
iter
,
_T
(
"outline"
),
true
);
break
;
case
0x0839
:
case
sprmOldCFShadow
:
case
sprmCFShadow
:
appendFlagElement
(
parent
,
*
iter
,
_T
(
"shadow"
),
true
);
break
;
case
0x083A
:
case
sprmOldCFSmallCaps
:
case
sprmCFSmallCaps
:
appendFlagElement
(
parent
,
*
iter
,
_T
(
"smallCaps"
),
true
);
break
;
case
0x0818
:
case
sprmCFSpecVanish
:
appendFlagElement
(
parent
,
*
iter
,
_T
(
"specVanish"
),
true
);
break
;
case
0x0837
:
case
sprmOldCFStrike
:
case
sprmCFStrike
:
appendFlagElement
(
parent
,
*
iter
,
_T
(
"strike"
),
true
);
break
;
case
0x083C
:
case
sprmOldCFVanish
:
case
sprmCFVanish
:
appendFlagElement
(
parent
,
*
iter
,
_T
(
"vanish"
),
true
);
break
;
...
...
@@ -217,13 +227,14 @@ namespace DocFileFormat
appendFlagElement
(
parent
,
*
iter
,
_T
(
"webHidden"
),
true
);
break
;
case
0x2A48
:
case
sprmOldCIss
:
case
sprmCIss
:
appendValueElement
(
parent
,
_T
(
"vertAlign"
),
FormatUtils
::
MapValueToWideString
(
iter
->
Arguments
[
0
],
&
SuperscriptIndex
[
0
][
0
],
3
,
12
).
c_str
(),
true
);
break
;
case
0x486D
:
//language
case
0x4873
:
{
//latin
break
;
case
sprmCRgLid0_80
:
case
sprmCRgLid0
:
{
//latin
LanguageId
langid
(
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
)
);
LanguageIdMapping
*
langIDMapping
=
new
LanguageIdMapping
(
lang
,
Default
);
...
...
@@ -231,10 +242,12 @@ namespace DocFileFormat
langid
.
Convert
(
langIDMapping
);
RELEASEOBJECT
(
langIDMapping
);
}
break
;
case
0x486E
:
case
0x4874
:
//east asia
{
}
break
;
case
sprmOldCLid
:
case
sprmCRgLid1_80
:
case
sprmCRgLid1
:
{
//east asia
LanguageId
langid
(
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
)
);
LanguageIdMapping
*
langIDMapping
=
new
LanguageIdMapping
(
lang
,
EastAsian
);
...
...
@@ -243,7 +256,8 @@ namespace DocFileFormat
RELEASEOBJECT
(
langIDMapping
);
}
break
;
case
0x485F
:
//bidi
case
sprmCLidBi
:
{
LanguageId
langid
(
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
)
);
...
...
@@ -252,43 +266,52 @@ namespace DocFileFormat
langid
.
Convert
(
langIDMapping
);
RELEASEOBJECT
(
langIDMapping
);
}
break
;
case
0x6865
:
//borders
case
0xCA72
:
{
}
break
;
case
sprmCBrc80
:
case
sprmCBrc
:
{
//borders
XMLTools
::
XMLElement
<
wchar_t
>
bdr
(
_T
(
"w:bdr"
)
);
BorderCode
bc
(
iter
->
Arguments
,
iter
->
argumentsSize
);
appendBorderAttributes
(
&
bc
,
&
bdr
);
parent
->
AppendChild
(
bdr
);
}
break
;
case
0x4866
:
//shading
case
0xCA71
:
{
}
break
;
case
sprmCShd80
:
case
sprmCShd
:
{
//shading
ShadingDescriptor
desc
(
iter
->
Arguments
,
iter
->
argumentsSize
);
appendShading
(
parent
,
desc
);
}
break
;
case
0x2A42
:
//color
case
0x4A60
:
{
}
break
;
case
sprmOldCIco
:
case
sprmCIco
:
case
sprmCIcoBi
:
{
//color
colorVal
->
SetValue
(
FormatUtils
::
MapValueToWideString
(
iter
->
Arguments
[
0
],
&
Global
::
ColorIdentifier
[
0
][
0
],
17
,
12
).
c_str
()
);
}
break
;
case
0x6870
:
case
sprmCCv
:
{
CString
rgbColor
;
rgbColor
.
Format
(
_T
(
"%02x%02x%02x"
),
/*R*/
iter
->
Arguments
[
0
],
/*G*/
iter
->
Arguments
[
1
],
/*B*/
iter
->
Arguments
[
2
]
);
colorVal
->
SetValue
(
rgbColor
.
GetString
()
);
}
break
;
case
0x2A0C
:
//highlightning
}
break
;
case
sprmCHighlight
:
{
appendValueElement
(
parent
,
_T
(
"highlight"
),
FormatUtils
::
MapValueToWideString
(
iter
->
Arguments
[
0
],
&
Global
::
ColorIdentifier
[
0
][
0
],
17
,
12
).
c_str
(),
true
);
}
break
;
case
0x8840
:
//spacing
}
break
;
case
sprmOldCDxaSpace
:
case
sprmCDxaSpace
:
{
appendValueElement
(
parent
,
_T
(
"spacing"
),
FormatUtils
::
IntToWideString
(
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
)
).
c_str
(),
true
);
}
break
;
case
sprmCFtcBi
:
{
//default from FontTable
SHORT
nIndex
=
FormatUtils
::
BytesToUInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
);
...
...
@@ -296,86 +319,112 @@ namespace DocFileFormat
{
FontFamilyName
*
ffn
=
static_cast
<
FontFamilyName
*>
(
_doc
->
FontTable
->
operator
[]
(
nIndex
)
);
if
(
ffn
)
this
->
m_sDefaultFont
=
ffn
->
xszFtn
;
m_sDefaultFont
=
ffn
->
xszFtn
;
}
}
break
;
case
sprmCHpsBi
:
{
appendValueElement
(
parent
,
_T
(
"szCs"
),
FormatUtils
::
IntToWideString
(
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
)
).
c_str
(),
true
);
FormatUtils
::
IntToWideString
(
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
)
).
c_str
(),
true
);
}
break
;
case
sprmCHps
:
// Font Size in points (2~3276) default 20-half-points
{
// Font Size in points (2~3276) default 20-half-points
case
sprmOldCHps
:
{
appendValueElement
(
parent
,
_T
(
"sz"
),
FormatUtils
::
IntToWideString
(
FormatUtils
::
BytesToU
Int16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
)
).
c_str
(),
FormatUtils
::
IntToWideString
(
FormatUtils
::
BytesToU
Char
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
)
).
c_str
(),
true
);
}
break
;
case
sprmCHpsPos
:
// The vertical position, in half-points, of text relative to the normal position. (MUST be between -3168 and 3168)
{
case
sprmCHps
:
{
appendValueElement
(
parent
,
_T
(
"sz"
),
FormatUtils
::
IntToWideString
(
FormatUtils
::
BytesToUInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
)
).
c_str
(),
true
);
}
break
;
case
sprmCMajority
:
{
//for complex props
}
break
;
case
sprmOldCHpsPos
:
{
// The vertical position, in half-points, of text relative to the normal position. (MUST be between -3168 and 3168)
short
nVertPos
=
FormatUtils
::
BytesToUChar
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
);
appendValueElement
(
parent
,
_T
(
"position"
),
nVertPos
,
true
);
}
break
;
case
sprmCHpsPos
:
{
// The vertical position, in half-points, of text relative to the normal position. (MUST be between -3168 and 3168)
short
nVertPos
=
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
);
appendValueElement
(
parent
,
_T
(
"position"
),
nVertPos
,
true
);
}
break
;
case
sprmOldCHpsKern
:
case
sprmCHpsKern
:
{
appendValueElement
(
parent
,
_T
(
"kern"
),
FormatUtils
::
IntToWideString
(
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
)
).
c_str
(),
true
);
}
break
;
case
sprmCRgFtc0
:
// font family
{
case
sprmOldCFtc
:
case
sprmCRgFtc0
:
{
// font family
int
nIndex
=
FormatUtils
::
BytesToUInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
);
if
(
nIndex
<
_doc
->
FontTable
->
Data
.
size
()
)
{
XMLTools
::
XMLAttribute
<
wchar_t
>*
ascii
=
new
XMLTools
::
XMLAttribute
<
wchar_t
>
(
_T
(
"w:ascii"
)
);
FontFamilyName
*
ffn
=
static_cast
<
FontFamilyName
*>
(
_doc
->
FontTable
->
operator
[]
(
nIndex
)
);
this
->
m_sAsciiFont
=
ffn
->
xszFtn
;
m_sAsciiFont
=
ffn
->
xszFtn
;
ascii
->
SetValue
(
FormatUtils
::
XmlEncode
(
m_sAsciiFont
).
c_str
()
);
rFonts
->
AppendAttribute
(
*
ascii
);
RELEASEOBJECT
(
ascii
);
}
}
break
;
case
sprmCRgFtc1
:
{
int
nIndex
=
FormatUtils
::
BytesToUInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
);
if
(
nIndex
>=
0
&&
nIndex
<
_doc
->
FontTable
->
Data
.
size
()
)
if
(
nIndex
>=
0
&&
nIndex
<
_doc
->
FontTable
->
Data
.
size
()
)
{
XMLTools
::
XMLAttribute
<
wchar_t
>*
eastAsia
=
new
XMLTools
::
XMLAttribute
<
wchar_t
>
(
_T
(
"w:eastAsia"
)
);
FontFamilyName
*
ffn
=
static_cast
<
FontFamilyName
*>
(
_doc
->
FontTable
->
operator
[]
(
nIndex
)
);
this
->
m_sEastAsiaFont
=
ffn
->
xszFtn
;
eastAsia
->
SetValue
(
FormatUtils
::
XmlEncode
(
this
->
m_sEastAsiaFont
).
c_str
()
);
m_sEastAsiaFont
=
ffn
->
xszFtn
;
eastAsia
->
SetValue
(
FormatUtils
::
XmlEncode
(
m_sEastAsiaFont
).
c_str
()
);
rFonts
->
AppendAttribute
(
*
eastAsia
);
RELEASEOBJECT
(
eastAsia
);
}
}
break
;
case
0x4A51
:
case
sprmCRgFtc2
:
{
int
nIndex
=
FormatUtils
::
BytesToUInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
);
if
(
nIndex
>=
0
&&
nIndex
<
_doc
->
FontTable
->
Data
.
size
()
)
{
XMLTools
::
XMLAttribute
<
wchar_t
>*
ansi
=
new
XMLTools
::
XMLAttribute
<
wchar_t
>
(
_T
(
"w:hAnsi"
)
);
FontFamilyName
*
ffn
=
static_cast
<
FontFamilyName
*>
(
_doc
->
FontTable
->
operator
[]
(
nIndex
)
);
this
->
m_shAnsiFont
=
ffn
->
xszFtn
;
ansi
->
SetValue
(
FormatUtils
::
XmlEncode
(
this
->
m_shAnsiFont
).
c_str
()
);
m_shAnsiFont
=
ffn
->
xszFtn
;
ansi
->
SetValue
(
FormatUtils
::
XmlEncode
(
m_shAnsiFont
).
c_str
()
);
rFonts
->
AppendAttribute
(
*
ansi
);
RELEASEOBJECT
(
ansi
);
}
}
break
;
case
0x2A3E
:
//Underlining
{
}
break
;
case
sprmOldCKul
:
case
sprmCKul
:
{
//Underlining
appendValueElement
(
parent
,
_T
(
"u"
),
FormatUtils
::
MapValueToWideString
(
iter
->
Arguments
[
0
],
&
Global
::
UnderlineCode
[
0
][
0
],
56
,
16
).
c_str
(),
true
);
}
break
;
case
0x4852
:
//char width
{
break
;
case
sprmCCharScale
:
{
//char width
appendValueElement
(
parent
,
_T
(
"w"
),
FormatUtils
::
IntToWideString
(
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
)
).
c_str
(),
true
);
}
break
;
case
0x2859
:
//animation
{
case
sprmCSfxText
:
{
//animation
appendValueElement
(
parent
,
_T
(
"effect"
),
FormatUtils
::
MapValueToWideString
(
iter
->
Arguments
[
0
],
&
Global
::
TextAnimation
[
0
][
0
],
7
,
16
).
c_str
(),
true
);
}
break
;
case
sprmCIdctHint
:
{
switch
(
iter
->
Arguments
[
0
])
...
...
@@ -387,6 +436,7 @@ namespace DocFileFormat
}
}
break
;
case
sprmCPbiIBullet
:
{
int
nIndex
=
FormatUtils
::
BytesToInt32
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
);
...
...
@@ -399,19 +449,26 @@ namespace DocFileFormat
}
}
}
break
;
case
sprmCPbiGrf
:
{
//used picture bullet
int
val
=
FormatUtils
::
BytesToUInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
);
}
break
;
case
sprmCRsidProp
:
case
sprmCRsidText
:
break
;
default:
if
(
iter
->
argumentsSize
==
2
)
{
int
nIndex
=
FormatUtils
::
BytesToUInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
);
nProperty
=
FormatUtils
::
BytesToUInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
);
}
else
if
(
iter
->
argumentsSize
==
1
)
{
nProperty
=
FormatUtils
::
BytesToUChar
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
);
}
break
;
}
...
...
@@ -500,12 +557,12 @@ namespace DocFileFormat
//don't use the id of the chpx or the papx, use the baseOn style
if
(
_styleChpx
)
{
StyleSheetDescription
*
thisStyle
=
this
->
_doc
->
Styles
->
Styles
->
at
(
styleId
);
StyleSheetDescription
*
thisStyle
=
_doc
->
Styles
->
Styles
->
at
(
styleId
);
styleId
=
(
unsigned
short
)
thisStyle
->
istdBase
;
}
//build the style hierarchy
this
->
_hierarchy
=
buildHierarchy
(
this
->
_doc
->
Styles
,
styleId
);
_hierarchy
=
buildHierarchy
(
_doc
->
Styles
,
styleId
);
//apply the toggle values to get the real value of the style
bool
stylesVal
=
applyToggleHierachy
(
sprm
);
...
...
@@ -575,7 +632,7 @@ namespace DocFileFormat
bool
ret
=
false
;
std
::
list
<
CharacterPropertyExceptions
*>::
const_iterator
end
=
_hierarchy
.
end
();
for
(
std
::
list
<
CharacterPropertyExceptions
*>::
const_iterator
iter
=
this
->
_hierarchy
.
begin
();
iter
!=
end
;
++
iter
)
for
(
std
::
list
<
CharacterPropertyExceptions
*>::
const_iterator
iter
=
_hierarchy
.
begin
();
iter
!=
end
;
++
iter
)
{
std
::
list
<
SinglePropertyModifier
>::
const_iterator
end_grpprl
=
(
*
iter
)
->
grpprl
->
end
();
for
(
std
::
list
<
SinglePropertyModifier
>::
const_iterator
grpprlIter
=
(
*
iter
)
->
grpprl
->
begin
();
grpprlIter
!=
end_grpprl
;
++
grpprlIter
)
...
...
ASCOfficeDocFile/DocDocxConverter/DocumentMapping.cpp
View file @
ab2461a5
...
...
@@ -644,7 +644,7 @@ namespace DocFileFormat
CharacterPropertyExceptions
*
chpxPic
=
chpxs
->
front
();
PictureDescriptor
pic
(
chpxPic
,
m_document
->
DataStream
,
0x7fffffff
,
m_document
->
FIB
->
m_
bOlderVersion
);
PictureDescriptor
pic
(
chpxPic
,
m_document
->
DataStream
,
0x7fffffff
,
m_document
->
bOlderVersion
);
RevisionData
oData
=
RevisionData
(
chpxPic
);
...
...
@@ -782,9 +782,9 @@ namespace DocFileFormat
}
}
}
else
if
((
TextMark
::
Picture
==
c
)
&&
fSpec
)
else
if
((
TextMark
::
Picture
==
c
)
&&
fSpec
)
{
PictureDescriptor
oPicture
(
chpx
,
m_document
->
DataStream
,
0x7fffffff
,
m_document
->
FIB
->
m_
bOlderVersion
);
PictureDescriptor
oPicture
(
chpx
,
m_document
->
bOlderVersion
?
m_document
->
WordDocumentStream
:
m_document
->
DataStream
,
0x7fffffff
,
m_document
->
bOlderVersion
);
if
((
oPicture
.
mfp
.
mm
>
98
)
&&
(
NULL
!=
oPicture
.
shapeContainer
))
{
...
...
@@ -1041,7 +1041,7 @@ namespace DocFileFormat
//find first row end
int
fcRowEnd
=
findRowEndFc
(
cp
,
nestingLevel
);
TablePropertyExceptions
row1Tapx
(
findValidPapx
(
fcRowEnd
),
m_document
->
DataStream
,
m_document
->
FIB
->
m_
bOlderVersion
);
TablePropertyExceptions
row1Tapx
(
findValidPapx
(
fcRowEnd
),
m_document
->
DataStream
,
m_document
->
bOlderVersion
);
//start table
m_pXmlWriter
->
WriteNodeBegin
(
_T
(
"w:tbl"
)
);
...
...
@@ -1291,7 +1291,7 @@ namespace DocFileFormat
//convert the properties
int
fcRowEnd
=
findRowEndFc
(
cp
,
nestingLevel
);
TablePropertyExceptions
tapx
(
findValidPapx
(
fcRowEnd
),
m_document
->
DataStream
,
m_document
->
FIB
->
m_
bOlderVersion
);
TablePropertyExceptions
tapx
(
findValidPapx
(
fcRowEnd
),
m_document
->
DataStream
,
m_document
->
bOlderVersion
);
std
::
list
<
CharacterPropertyExceptions
*>*
chpxs
=
m_document
->
GetCharacterPropertyExceptions
(
fcRowEnd
,
fcRowEnd
+
1
);
TableRowPropertiesMapping
*
trpMapping
=
new
TableRowPropertiesMapping
(
m_pXmlWriter
,
*
(
chpxs
->
begin
())
);
...
...
@@ -1523,11 +1523,13 @@ namespace DocFileFormat
{
return
true
;
}
else
if
(
sprmCSymbol
==
iter
->
OpCode
)
// SYMBOL
else
if
(
sprmCSymbol
==
iter
->
OpCode
||
sprmOldCSymbol
==
iter
->
OpCode
)
// SYMBOL
{
return
true
;
}
else
if
(
sprmCFSpec
==
iter
->
OpCode
)
// SPECIAL OBJECT
else
if
(
sprmOldCFSpec
==
iter
->
OpCode
||
sprmCFSpec
==
iter
->
OpCode
)
// SPECIAL OBJECT
{
return
((
0
!=
iter
->
Arguments
[
0
])
?
true
:
false
);
}
...
...
ASCOfficeDocFile/DocDocxConverter/FormattedDiskPagePAPX.cpp
View file @
ab2461a5
...
...
@@ -52,7 +52,7 @@ namespace DocFileFormat
/*========================================================================================================*/
FormattedDiskPagePAPX
::
FormattedDiskPagePAPX
(
POLE
::
Stream
*
wordStream
,
int
offset
,
POLE
::
Stream
*
dataStream
,
bool
oldVersion
)
:
FormattedDiskPagePAPX
::
FormattedDiskPagePAPX
(
POLE
::
Stream
*
wordStream
,
int
offset
,
POLE
::
Stream
*
dataStream
,
bool
oldVersion
,
bool
fComplex
)
:
FormattedDiskPage
(),
rgbx
(
NULL
),
grppapxSize
(
0
),
grppapx
(
NULL
)
{
Type
=
Paragraph
;
...
...
@@ -98,54 +98,68 @@ namespace DocFileFormat
unsigned
char
*
papx
=
NULL
;
for
(
int
i
=
0
;
i
<
crun
;
i
++
)
{
memcpy
(
phe
,
(
bytes
+
j
+
1
),
12
);
//fill the rgbx array
BX
bx
;
bx
.
wordOffset
=
bytes
[
j
];
bx
.
phe
=
ParagraphHeight
(
phe
,
12
,
false
);
for
(
int
i
=
0
;
i
<
crun
;
i
++
)
{
BX
bx
;
bx
.
wordOffset
=
bytes
[
j
];
j
++
;
if
(
fComplex
||
!
oldVersion
)
{
memcpy
(
phe
,
(
bytes
+
j
),
12
);
rgbx
[
i
]
=
bx
;
j
+=
13
;
//fill the rgbx array
bx
.
phe
=
ParagraphHeight
(
phe
,
12
,
false
)
;
if
(
bx
.
wordOffset
!=
0
)
{
//read first unsigned char of PAPX
//PAPX is stored in a FKP; so the first unsigned char is a count of words
unsigned
char
padbyte
=
0
;
unsigned
char
cw
=
bytes
[
bx
.
wordOffset
*
2
];
//if that unsigned char is zero, it's a pad unsigned char, and the word count is the following unsigned char
if
(
cw
==
0
)
{
padbyte
=
1
;
cw
=
bytes
[
bx
.
wordOffset
*
2
+
1
];
}
j
+=
12
;
}
else
{
memcpy
(
phe
,
(
bytes
+
j
),
6
);
if
(
cw
!=
0
)
{
//read the bytes for papx
papx
=
new
unsigned
char
[
cw
*
2
];
memcpy
(
papx
,
(
bytes
+
(
bx
.
wordOffset
*
2
)
+
padbyte
+
1
),
(
cw
*
2
)
);
//fill the rgbx array
bx
.
phe
=
ParagraphHeight
(
phe
,
6
,
false
);
//parse PAPX and fill grppapx
grppapx
[
i
]
=
new
ParagraphPropertyExceptions
(
papx
,
(
cw
*
2
),
dataStream
,
oldVersion
);
j
+=
6
;
}
rgbx
[
i
]
=
bx
;
RELEASEARRAYOBJECTS
(
papx
);
}
}
else
{
//create a PAPX which doesn't modify anything
grppapx
[
i
]
=
new
ParagraphPropertyExceptions
();
}
}
if
(
bx
.
wordOffset
!=
0
)
{
//read first unsigned char of PAPX
//PAPX is stored in a FKP; so the first unsigned char is a count of words
unsigned
char
padbyte
=
0
;
unsigned
char
cw
=
bytes
[
bx
.
wordOffset
*
2
];
//if that unsigned char is zero, it's a pad unsigned char, and the word count is the following unsigned char
if
(
cw
==
0
)
{
padbyte
=
1
;
cw
=
bytes
[
bx
.
wordOffset
*
2
+
1
];
}
if
(
cw
!=
0
)
{
//read the bytes for papx
papx
=
new
unsigned
char
[
cw
*
2
];
memcpy
(
papx
,
(
bytes
+
(
bx
.
wordOffset
*
2
)
+
padbyte
+
1
),
(
cw
*
2
)
);
//parse PAPX and fill grppapx
grppapx
[
i
]
=
new
ParagraphPropertyExceptions
(
papx
,
(
cw
*
2
),
dataStream
,
oldVersion
);
RELEASEARRAYOBJECTS
(
papx
);
}
}
else
{
//create a PAPX which doesn't modify anything
grppapx
[
i
]
=
new
ParagraphPropertyExceptions
();
}
}
RELEASEARRAYOBJECTS
(
phe
);
RELEASEARRAYOBJECTS
(
bytes
);
}
RELEASEARRAYOBJECTS
(
phe
);
RELEASEARRAYOBJECTS
(
bytes
);
}
/*========================================================================================================*/
...
...
@@ -188,7 +202,7 @@ namespace DocFileFormat
int
offset
=
fkpnr
*
512
;
//parse the FKP and add it to the list
PAPXlist
->
push_back
(
new
FormattedDiskPagePAPX
(
wordStream
,
offset
,
dataStream
,
fib
->
m_bOlderVersion
)
);
PAPXlist
->
push_back
(
new
FormattedDiskPagePAPX
(
wordStream
,
offset
,
dataStream
,
fib
->
m_bOlderVersion
,
fib
->
m_FibBase
.
fComplex
)
);
}
//if (PAPXlist->back()->rgfc[PAPXlist->back()->rgfcSize-1] < last)
...
...
@@ -212,7 +226,7 @@ namespace DocFileFormat
int
offset
=
fkpnr
*
512
;
//parse the FKP and add it to the list
PAPXlist
->
push_back
(
new
FormattedDiskPagePAPX
(
wordStream
,
offset
,
dataStream
,
fib
->
m_bOlderVersion
)
);
PAPXlist
->
push_back
(
new
FormattedDiskPagePAPX
(
wordStream
,
offset
,
dataStream
,
fib
->
m_bOlderVersion
,
fib
->
m_FibBase
.
fComplex
)
);
}
}
...
...
ASCOfficeDocFile/DocDocxConverter/FormattedDiskPagePAPX.h
View file @
ab2461a5
...
...
@@ -63,7 +63,7 @@ namespace DocFileFormat
public:
virtual
~
FormattedDiskPagePAPX
();
FormattedDiskPagePAPX
(
POLE
::
Stream
*
wordStream
,
int
offset
,
POLE
::
Stream
*
dataStream
,
bool
oldVersion
);
FormattedDiskPagePAPX
(
POLE
::
Stream
*
wordStream
,
int
offset
,
POLE
::
Stream
*
dataStream
,
bool
oldVersion
,
bool
fComplex
);
/// Parses the 0Table (or 1Table) for FKP _entries containing PAPX
static
std
::
list
<
FormattedDiskPagePAPX
*>*
GetAllPAPXFKPs
(
FileInformationBlock
*
fib
,
POLE
::
Stream
*
wordStream
,
POLE
::
Stream
*
tableStream
,
POLE
::
Stream
*
dataStream
);
/// Returns a list of all PAPX FCs between they given boundaries.
...
...
ASCOfficeDocFile/DocDocxConverter/LineSpacingDescriptor.h
View file @
ab2461a5
/*
* (c) Copyright Ascensio System SIA 2010-2016
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
* (c) Copyright Ascensio System SIA 2010-2016
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
namespace
DocFileFormat
{
class
LineSpacingDescriptor
{
friend
class
ParagraphPropertiesMapping
;
class
LineSpacingDescriptor
{
friend
class
ParagraphPropertiesMapping
;
private:
short
dyaLine
;
bool
fMultLinespace
;
private:
short
dyaLine
;
bool
fMultLinespace
;
public:
/// Creates a new LineSpacingDescriptor with empty values
LineSpacingDescriptor
()
:
dyaLine
(
0
),
fMultLinespace
(
false
)
{
}
public:
/// Creates a new LineSpacingDescriptor with empty values
LineSpacingDescriptor
()
:
dyaLine
(
0
),
fMultLinespace
(
false
)
{
}
/// Parses the bytes to retrieve a LineSpacingDescriptor
LineSpacingDescriptor
(
unsigned
char
*
bytes
,
int
size
)
:
dyaLine
(
0
),
fMultLinespace
(
false
)
{
if
(
size
==
4
)
{
this
->
dyaLine
=
FormatUtils
::
BytesToInt16
(
bytes
,
0
,
size
);
/// Parses the bytes to retrieve a LineSpacingDescriptor
LineSpacingDescriptor
(
unsigned
char
*
bytes
,
int
size
)
:
dyaLine
(
0
),
fMultLinespace
(
false
)
{
if
(
size
==
4
)
{
dyaLine
=
FormatUtils
::
BytesToInt16
(
bytes
,
0
,
size
);
if
(
FormatUtils
::
BytesToInt16
(
bytes
,
2
,
size
)
==
1
)
{
this
->
fMultLinespace
=
true
;
}
}
else
{
//throw new ByteParseException("Cannot parse the struct LSPD, the length of the struct doesn't match");
}
}
};
if
(
FormatUtils
::
BytesToInt16
(
bytes
,
2
,
size
)
==
1
)
{
fMultLinespace
=
true
;
}
}
else
{
}
}
};
}
\ No newline at end of file
ASCOfficeDocFile/DocDocxConverter/MainDocumentMapping.cpp
View file @
ab2461a5
...
...
@@ -66,7 +66,7 @@ namespace DocFileFormat
//m_pXmlWriter->WriteAttribute(_T("xmlns:wpc"), _T("http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas"));
//m_pXmlWriter->WriteAttribute(_T("xmlns:mc"), _T("http://schemas.openxmlformats.org/markup-compatibility/2006"));
//m_pXmlWriter->WriteAttribute(_T("xmlns:wp14"),
_T("http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing"));
//m_pXmlWriter->WriteAttribute(_T("xmlns:wp14"),_T("http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing"));
//m_pXmlWriter->WriteAttribute(_T("xmlns:wp"), _T("http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"));
//m_pXmlWriter->WriteAttribute(_T("xmlns:w14"), _T("http://schemas.microsoft.com/office/word/2010/wordml"));
//m_pXmlWriter->WriteAttribute(_T("xmlns:wpg"), _T("http://schemas.microsoft.com/office/word/2010/wordprocessingGroup"));
...
...
ASCOfficeDocFile/DocDocxConverter/NumberingMapping.cpp
View file @
ab2461a5
...
...
@@ -518,14 +518,17 @@ namespace DocFileFormat
for
(
std
::
list
<
SinglePropertyModifier
>::
const_iterator
iter
=
grpprlChpx
->
grpprl
->
begin
();
iter
!=
grpprlChpx
->
grpprl
->
end
();
++
iter
)
{
if
((
int
)(
iter
->
OpCode
)
==
sprmCPbiIBullet
)
switch
(
iter
->
OpCode
)
{
cp
=
FormatUtils
::
BytesToUInt32
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
);
}
case
sprmCPbiIBullet
:
{
cp
=
FormatUtils
::
BytesToUInt32
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
);
}
break
;
if
((
int
)(
iter
->
OpCode
)
==
sprmCPbiGrf
)
{
isPictureBullet
=
FormatUtils
::
BitmaskToBool
(
FormatUtils
::
BytesToUInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
),
0x1
);
case
sprmCPbiGrf
:
{
isPictureBullet
=
FormatUtils
::
BitmaskToBool
(
FormatUtils
::
BytesToUInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
),
0x1
);
}
break
;
}
}
...
...
ASCOfficeDocFile/DocDocxConverter/ParagraphHeight.cpp
View file @
ab2461a5
...
...
@@ -45,52 +45,60 @@ namespace DocFileFormat
ParagraphHeight
::
ParagraphHeight
(
unsigned
char
*
bytes
,
int
size
,
bool
fTtpMode
)
{
//set default values
setDefaultValues
();
//set default values
setDefaultValues
();
if
(
size
==
12
)
{
// The ParagraphHeight is placed in a ParagraphProperties whose fTtp field is set,
//so used another bit setting
if
(
fTtpMode
)
{
this
->
fSpare
=
FormatUtils
::
BitmaskToBool
(
FormatUtils
::
BytesToInt16
(
bytes
,
0
,
size
),
0x0001
);
this
->
fUnk
=
FormatUtils
::
BitmaskToBool
(
FormatUtils
::
BytesToInt16
(
bytes
,
0
,
size
),
0x0002
);
this
->
dcpTtpNext
=
FormatUtils
::
BytesToInt16
(
bytes
,
0
,
size
);
this
->
dxaCol
=
FormatUtils
::
BytesToInt32
(
bytes
,
4
,
size
);
this
->
dymTableHeight
=
FormatUtils
::
BytesToInt32
(
bytes
,
8
,
size
);
}
else
{
this
->
fVolatile
=
FormatUtils
::
BitmaskToBool
(
FormatUtils
::
BytesToInt16
(
bytes
,
0
,
size
),
0x0001
);
this
->
fUnk
=
FormatUtils
::
BitmaskToBool
(
FormatUtils
::
BytesToInt16
(
bytes
,
0
,
size
),
0x0002
);
this
->
fDiffLines
=
FormatUtils
::
BitmaskToBool
(
FormatUtils
::
BytesToInt16
(
bytes
,
0
,
size
),
0x0004
);
this
->
clMac
=
FormatUtils
::
BytesToUInt16
(
bytes
,
0
,
size
)
&
0x00FF
;
// The ParagraphHeight is placed in a ParagraphProperties whose fTtp field is set,
//so used another bit setting
if
(
size
==
12
)
{
if
(
fTtpMode
)
{
fSpare
=
FormatUtils
::
BitmaskToBool
(
FormatUtils
::
BytesToInt16
(
bytes
,
0
,
size
),
0x0001
);
fUnk
=
FormatUtils
::
BitmaskToBool
(
FormatUtils
::
BytesToInt16
(
bytes
,
0
,
size
),
0x0002
);
dcpTtpNext
=
FormatUtils
::
BytesToInt16
(
bytes
,
0
,
size
);
dxaCol
=
FormatUtils
::
BytesToInt32
(
bytes
,
4
,
size
);
dymTableHeight
=
FormatUtils
::
BytesToInt32
(
bytes
,
8
,
size
);
}
else
{
fVolatile
=
FormatUtils
::
BitmaskToBool
(
FormatUtils
::
BytesToInt16
(
bytes
,
0
,
size
),
0x0001
);
fUnk
=
FormatUtils
::
BitmaskToBool
(
FormatUtils
::
BytesToInt16
(
bytes
,
0
,
size
),
0x0002
);
fDiffLines
=
FormatUtils
::
BitmaskToBool
(
FormatUtils
::
BytesToInt16
(
bytes
,
0
,
size
),
0x0004
);
clMac
=
FormatUtils
::
BytesToUInt16
(
bytes
,
0
,
size
)
&
0x00FF
;
this
->
dxaCol
=
FormatUtils
::
BytesToInt32
(
bytes
,
4
,
size
);
this
->
dymLine
=
FormatUtils
::
BytesToInt32
(
bytes
,
8
,
size
);
this
->
dymHeight
=
FormatUtils
::
BytesToInt32
(
bytes
,
8
,
size
);
}
}
else
{
//throw new ByteParseException("Cannot parse the struct ParagraphHeight, the length of the struct doesn't match");
}
}
dxaCol
=
FormatUtils
::
BytesToInt32
(
bytes
,
4
,
size
);
dymLine
=
FormatUtils
::
BytesToInt32
(
bytes
,
8
,
size
);
dymHeight
=
FormatUtils
::
BytesToInt32
(
bytes
,
8
,
size
);
}
}
else
if
(
size
==
6
)
{
fVolatile
=
FormatUtils
::
BitmaskToBool
(
FormatUtils
::
BytesToInt16
(
bytes
,
0
,
size
),
0x0001
);
fUnk
=
FormatUtils
::
BitmaskToBool
(
FormatUtils
::
BytesToInt16
(
bytes
,
0
,
size
),
0x0002
);
fDiffLines
=
FormatUtils
::
BitmaskToBool
(
FormatUtils
::
BytesToInt16
(
bytes
,
0
,
size
),
0x0004
);
clMac
=
FormatUtils
::
BytesToUChar
(
bytes
,
0
,
size
)
&
0x000F
;
dxaCol
=
FormatUtils
::
BytesToInt16
(
bytes
,
2
,
size
);
dymLine
=
FormatUtils
::
BytesToInt16
(
bytes
,
4
,
size
);
dymHeight
=
FormatUtils
::
BytesToInt16
(
bytes
,
4
,
size
);
}
}
/*========================================================================================================*/
void
ParagraphHeight
::
setDefaultValues
()
{
this
->
clMac
=
0
;
this
->
dcpTtpNext
=
0
;
this
->
dxaCol
=
0
;
this
->
dymHeight
=
0
;
this
->
dymLine
=
0
;
this
->
dymTableHeight
=
0
;
this
->
fDiffLines
=
false
;
this
->
fSpare
=
false
;
this
->
fUnk
=
false
;
this
->
fVolatile
=
false
;
clMac
=
0
;
dcpTtpNext
=
0
;
dxaCol
=
0
;
dymHeight
=
0
;
dymLine
=
0
;
dymTableHeight
=
0
;
fDiffLines
=
false
;
fSpare
=
false
;
fUnk
=
false
;
fVolatile
=
false
;
}
}
\ No newline at end of file
ASCOfficeDocFile/DocDocxConverter/ParagraphPropertiesMapping.cpp
View file @
ab2461a5
...
...
@@ -136,6 +136,8 @@ namespace DocFileFormat
std
::
list
<
SinglePropertyModifier
>::
iterator
end
=
papx
->
grpprl
->
end
();
for
(
std
::
list
<
SinglePropertyModifier
>::
iterator
iter
=
papx
->
grpprl
->
begin
();
iter
!=
end
;
++
iter
)
{
int
nProperty
=
0
;
//for unknown test
switch
(
iter
->
OpCode
)
{
case
sprmPIpgp
:
...
...
@@ -170,10 +172,12 @@ namespace DocFileFormat
}
break
;
case
sprmOldPFKeep
:
case
sprmPFKeep
:
appendFlagElement
(
_pPr
,
*
iter
,
_T
(
"keepLines"
),
true
);
break
;
case
sprmOldPFKeepFollow
:
case
sprmPFKeepFollow
:
appendFlagElement
(
_pPr
,
*
iter
,
_T
(
"keepNext"
),
true
);
break
;
...
...
@@ -215,6 +219,8 @@ namespace DocFileFormat
break
;
//indentation
case
sprmOldPDxaLeft
:
case
sprmOldPNest
:
case
sprmPDxaLeft
:
case
sprmPDxaLeft80
:
case
sprmPNest
:
...
...
@@ -226,6 +232,7 @@ namespace DocFileFormat
appendValueAttribute
(
&
ind
,
_T
(
"w:leftChars"
),
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
)
);
break
;
case
sprmOldPDxaLeft1
:
case
sprmPDxaLeft1
:
case
sprmPDxaLeft180
:
{
...
...
@@ -250,6 +257,7 @@ namespace DocFileFormat
appendValueAttribute
(
&
ind
,
_T
(
"w:firstLineChars"
),
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
)
);
break
;
case
sprmOldPDxaRight
:
case
sprmPDxaRight
:
case
sprmPDxaRight80
:
appendValueAttribute
(
&
ind
,
_T
(
"w:right"
),
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
)
);
...
...
@@ -260,10 +268,12 @@ namespace DocFileFormat
break
;
//spacing
case
sprmOldPDyaBefore
:
case
sprmPDyaBefore
:
appendValueAttribute
(
&
spacing
,
_T
(
"w:before"
),
FormatUtils
::
BytesToUInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
)
);
break
;
case
sprmOldPDyaAfter
:
case
sprmPDyaAfter
:
appendValueAttribute
(
&
spacing
,
_T
(
"w:after"
),
FormatUtils
::
BytesToUInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
)
);
break
;
...
...
@@ -276,6 +286,7 @@ namespace DocFileFormat
appendValueAttribute
(
&
spacing
,
_T
(
"w:beforeAutospacing"
),
iter
->
Arguments
[
0
]
);
break
;
case
sprmOldPDyaLine
:
case
sprmPDyaLine
:
{
LineSpacingDescriptor
lspd
(
iter
->
Arguments
,
iter
->
argumentsSize
);
...
...
@@ -300,6 +311,7 @@ namespace DocFileFormat
break
;
//justification code
case
sprmOldPJc
:
case
sprmPJc
:
case
sprmPJc80
:
{
...
...
@@ -316,6 +328,7 @@ namespace DocFileFormat
//borders
//case 0x461C:
case
sprmOldPBrcTop
:
case
sprmPBrcTop
:
//case 0x4424:
case
sprmPBrcTop80
:
...
...
@@ -331,6 +344,7 @@ namespace DocFileFormat
break
;
//case 0x461D:
case
sprmOldPBrcLeft
:
case
sprmPBrcLeft
:
//case 0x4425:
case
sprmPBrcLeft80
:
...
...
@@ -346,6 +360,7 @@ namespace DocFileFormat
break
;
//case 0x461E:
case
sprmOldPBrcBottom
:
case
sprmPBrcBottom
:
//case 0x4426:
case
sprmPBrcBottom80
:
...
...
@@ -361,6 +376,7 @@ namespace DocFileFormat
break
;
//case 0x461F:
case
sprmOldPBrcRight
:
case
sprmPBrcRight
:
//case 0x4427:
case
sprmPBrcRight80
:
...
...
@@ -376,6 +392,7 @@ namespace DocFileFormat
break
;
//case 0x4620:
case
sprmOldPBrcBetween
:
case
sprmPBrcBetween
:
//case 0x4428:
case
sprmPBrcBetween80
:
...
...
@@ -391,6 +408,7 @@ namespace DocFileFormat
break
;
//case 0x4621:
case
sprmOldPBrcBar
:
case
sprmPBrcBar
:
//case 0x4629:
case
sprmPBrcBar80
:
...
...
@@ -445,6 +463,7 @@ namespace DocFileFormat
break
;
//tabs
case
sprmOldPChgTabs
:
case
sprmPChgTabsPapx
:
case
sprmPChgTabs
:
{
...
...
@@ -513,6 +532,7 @@ namespace DocFileFormat
break
;
//frame properties
case
sprmOldPPc
:
case
sprmPPc
:
{
//position code
...
...
@@ -523,14 +543,17 @@ namespace DocFileFormat
}
break
;
case
sprmOldPWr
:
case
sprmPWr
:
appendValueAttribute
(
this
->
_framePr
,
_T
(
"w:wrap"
),
FormatUtils
::
MapValueToWideString
(
iter
->
Arguments
[
0
],
&
Global
::
TextFrameWrapping
[
0
][
0
],
6
,
10
).
c_str
()
);
break
;
case
sprmOldPDxaAbs
:
case
sprmPDxaAbs
:
appendValueAttribute
(
this
->
_framePr
,
_T
(
"w:x"
),
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
)
);
break
;
case
sprmOldPDyaAbs
:
case
sprmPDyaAbs
:
appendValueAttribute
(
this
->
_framePr
,
_T
(
"w:y"
),
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
)
);
break
;
...
...
@@ -539,18 +562,22 @@ namespace DocFileFormat
appendValueAttribute
(
this
->
_framePr
,
_T
(
"w:h"
),
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
)
);
break
;
case
sprmOldPDxaWidth
:
case
sprmPDxaWidth
:
appendValueAttribute
(
this
->
_framePr
,
_T
(
"w:w"
),
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
)
);
break
;
case
sprmOldPDxaFromText
:
case
sprmPDxaFromText
:
appendValueAttribute
(
this
->
_framePr
,
_T
(
"w:hSpace"
),
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
)
);
break
;
case
sprmOldPDyaFromText
:
case
sprmPDyaFromText
:
appendValueAttribute
(
this
->
_framePr
,
_T
(
"w:vSpace"
),
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
)
);
break
;
case
sprmOldPDcs
:
case
sprmPDcs
:
{
short
pDcs
=
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
);
...
...
@@ -567,10 +594,13 @@ namespace DocFileFormat
break
;
default:
if
(
iter
->
argumentsSize
==
2
)
{
nProperty
=
FormatUtils
::
BytesToUInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
);
}
else
if
(
iter
->
argumentsSize
==
1
)
{
#ifdef _DEBUG
// //ATLTRACE (_T("ParagraphPropertiesMapping - UNKNOWN SPRM : 0x%x\n"), iter->OpCode);
#endif
nProperty
=
FormatUtils
::
BytesToUChar
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
);
}
break
;
}
...
...
ASCOfficeDocFile/DocDocxConverter/ParagraphPropertyExceptions.cpp
View file @
ab2461a5
...
...
@@ -39,14 +39,14 @@ namespace DocFileFormat
{
if
(
size
!=
0
)
{
this
->
istd
=
FormatUtils
::
BytesToUInt16
(
bytes
,
0
,
size
);
istd
=
FormatUtils
::
BytesToUInt16
(
bytes
,
0
,
size
);
}
VirtualStreamReader
*
reader
=
NULL
;
//There is a SPRM that points to an offset in the data stream,
//where a list of SPRM is saved.
for
(
std
::
list
<
SinglePropertyModifier
>::
iterator
iter
=
this
->
grpprl
->
begin
();
iter
!=
this
->
grpprl
->
end
();
iter
++
)
for
(
std
::
list
<
SinglePropertyModifier
>::
iterator
iter
=
grpprl
->
begin
();
iter
!=
grpprl
->
end
();
iter
++
)
{
SinglePropertyModifier
sprm
(
*
iter
);
...
...
@@ -68,11 +68,11 @@ namespace DocFileFormat
PropertyExceptions
externalPx
(
grpprlBytes
,
grpprlsize
,
oldVersion
);
//assign the external grpprl
RELEASEOBJECT
(
this
->
grpprl
);
this
->
grpprl
=
new
std
::
list
<
SinglePropertyModifier
>
(
*
(
externalPx
.
grpprl
)
);
RELEASEOBJECT
(
grpprl
);
grpprl
=
new
std
::
list
<
SinglePropertyModifier
>
(
*
(
externalPx
.
grpprl
)
);
//remove the sprmPHugePapx
this
->
grpprl
->
remove
(
sprm
);
grpprl
->
remove
(
sprm
);
RELEASEARRAYOBJECTS
(
grpprlBytes
);
RELEASEOBJECT
(
reader
)
...
...
ASCOfficeDocFile/DocDocxConverter/PictureDescriptor.cpp
View file @
ab2461a5
...
...
@@ -90,14 +90,14 @@ namespace DocFileFormat
if
(
lcb
>=
10
)
{
unsigned
short
cbHeader
=
reader
.
ReadUInt16
();
int
cbHeader
=
reader
.
ReadUInt16
();
mfp
.
mm
=
reader
.
ReadInt16
();
mfp
.
xExt
=
reader
.
ReadInt16
();
mfp
.
yExt
=
reader
.
ReadInt16
();
mfp
.
hMf
=
reader
.
ReadInt16
();
mfp
.
mm
=
reader
.
ReadInt16
();
mfp
.
xExt
=
reader
.
ReadInt16
();
mfp
.
yExt
=
reader
.
ReadInt16
();
mfp
.
hMf
=
reader
.
ReadInt16
();
if
(
mfp
.
mm
>
98
)
if
(
mfp
.
mm
>
=
98
||
oldVersion
)
{
unsigned
char
*
bytes
=
reader
.
ReadBytes
(
14
,
true
);
rcWinMf
=
std
::
vector
<
unsigned
char
>
(
bytes
,
(
bytes
+
14
));
...
...
@@ -154,22 +154,47 @@ namespace DocFileFormat
}
}
//Parse the OfficeDrawing Stuff
shapeContainer
=
dynamic_cast
<
ShapeContainer
*>
(
RecordFactory
::
ReadRecord
(
&
reader
,
0
));
if
(
oldVersion
)
{
////blipStoreEntry = new BlipStoreEntry();
//blipStoreEntry = new BlipStoreEntry(&reader,lcb, Global::msoblipDIB,0,0);
//long pos = reader.GetPosition();
//unsigned char* pPicData = reader.ReadBytes(lcb - pos, true);
//int pos1 = 0;
//BITMAPINFOHEADER *bm = (BITMAPINFOHEADER *)(pPicData + pos1);
long
pos
=
reader
.
GetPosition
();
//NSFile::CFileBinary f;
//
//f.CreateFile(L"d:\\test.jpg");
//f.WriteFile(pPicData + pos1, lcb - pos - pos1);
//f.CloseFile();
if
(
pos
<
(
fc
+
lcb
))
//RELEASEARRAYOBJECTS(pPicData);
}
else
{
Record
*
rec
=
RecordFactory
::
ReadRecord
(
&
reader
,
0
);
//Parse the OfficeDrawing Stuff
shapeContainer
=
dynamic_cast
<
ShapeContainer
*>
(
RecordFactory
::
ReadRecord
(
&
reader
,
0
));
if
((
rec
)
&&
(
typeid
(
*
rec
)
==
typeid
(
BlipStoreEntry
)
))
{
blipStoreEntry
=
dynamic_cast
<
BlipStoreEntry
*>
(
rec
);
}
else
long
pos
=
reader
.
GetPosition
();
if
(
pos
<
(
fc
+
lcb
))
{
RELEASEOBJECT
(
rec
);
Record
*
rec
=
RecordFactory
::
ReadRecord
(
&
reader
,
0
);
if
((
rec
)
&&
(
typeid
(
*
rec
)
==
typeid
(
BlipStoreEntry
)
))
{
blipStoreEntry
=
dynamic_cast
<
BlipStoreEntry
*>
(
rec
);
}
else
{
RELEASEOBJECT
(
rec
);
}
}
}
}
...
...
@@ -186,6 +211,7 @@ namespace DocFileFormat
{
switch
(
iter
->
OpCode
)
{
case
sprmOldCPicLocation
:
case
sprmCPicLocation
:
ret
=
FormatUtils
::
BytesToInt32
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
);
break
;
...
...
@@ -194,6 +220,7 @@ namespace DocFileFormat
ret
=
FormatUtils
::
BytesToInt32
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
);
break
;
case
sprmOldCFData
:
case
sprmCFData
:
break
;
}
...
...
ASCOfficeDocFile/DocDocxConverter/PropertyExceptions.cpp
View file @
ab2461a5
...
...
@@ -36,107 +36,116 @@
namespace
DocFileFormat
{
PropertyExceptions
::~
PropertyExceptions
()
{
RELEASEOBJECT
(
this
->
grpprl
);
}
/*========================================================================================================*/
PropertyExceptions
::
PropertyExceptions
()
:
grpprl
(
NULL
)
{
this
->
grpprl
=
new
std
::
list
<
SinglePropertyModifier
>
();
}
PropertyExceptions
::~
PropertyExceptions
()
{
RELEASEOBJECT
(
this
->
grpprl
);
}
/*========================================================================================================*/
PropertyExceptions
::
PropertyExceptions
()
:
grpprl
(
NULL
)
{
this
->
grpprl
=
new
std
::
list
<
SinglePropertyModifier
>
();
}
PropertyExceptions
::
PropertyExceptions
(
const
std
::
list
<
SinglePropertyModifier
>&
grpprl
)
{
this
->
grpprl
=
new
std
::
list
<
SinglePropertyModifier
>
(
grpprl
);
}
PropertyExceptions
::
PropertyExceptions
(
const
std
::
list
<
SinglePropertyModifier
>&
grpprl
)
{
this
->
grpprl
=
new
std
::
list
<
SinglePropertyModifier
>
(
grpprl
);
}
/*========================================================================================================*/
PropertyExceptions
::
PropertyExceptions
(
unsigned
char
*
bytes
,
int
size
,
bool
oldVersion
)
:
grpprl
(
NULL
)
{
this
->
grpprl
=
new
std
::
list
<
SinglePropertyModifier
>
();
PropertyExceptions
::
PropertyExceptions
(
unsigned
char
*
bytes
,
int
size
,
bool
oldVersion
)
:
grpprl
(
NULL
)
{
this
->
grpprl
=
new
std
::
list
<
SinglePropertyModifier
>
();
if
(
(
bytes
==
NULL
)
||
(
size
==
0
)
)
return
;
if
(
(
bytes
==
NULL
)
||
(
size
==
0
)
)
return
;
//read the sprms
int
sprmStart
=
0
;
bool
goOn
=
true
;
//read the sprms
int
sprmStart
=
0
;
bool
goOn
=
true
;
int
opCodeSize
=
(
oldVersion
?
1
:
2
);
while
(
goOn
)
{
//enough bytes to read?
if
(
(
sprmStart
+
2
)
<
size
)
while
(
goOn
)
{
//make spra
OperationCode
opCode
=
(
OperationCode
)
FormatUtils
::
BytesToUInt16
(
bytes
,
sprmStart
,
size
);
unsigned
char
spra
=
(
unsigned
char
)(
(
int
)
opCode
>>
13
);
//enough bytes to read?
if
(
(
sprmStart
+
opCodeSize
)
<
size
)
{
OperationCode
opCode
=
oldVersion
?
(
OperationCode
)
FormatUtils
::
BytesToUChar
(
bytes
,
sprmStart
,
size
)
:
(
OperationCode
)
FormatUtils
::
BytesToUInt16
(
bytes
,
sprmStart
,
size
)
;
// get size of operand
short
opSize
=
(
short
)
SinglePropertyModifier
::
GetOperandSize
(
spra
);
unsigned
char
lenByte
=
0
;
short
opSize
=
-
1
;
//operand has variable size
if
(
opSize
==
255
)
{
//some opCode need special treatment
switch
(
opCode
)
if
(
oldVersion
)
{
opSize
=
(
short
)
SinglePropertyModifier
::
GetOldOperandSize
(
(
unsigned
char
)
opCode
);
}
else
{
case
sprmTDefTable
:
case
sprmTDefTable10
:
{
//The opSize of the table definition is stored in 2 bytes instead of 1
lenByte
=
2
;
opSize
=
FormatUtils
::
BytesToInt16
(
bytes
,
(
sprmStart
+
2
),
size
);
//Word adds an additional unsigned char to the opSize to compensate the additional
//unsigned char needed for the length
opSize
--
;
}
break
;
case
sprmPChgTabs
:
{
//The tab operand can be bigger than 255 bytes (length unsigned char is set to 255).
//In this case a special calculation of the opSize is needed
lenByte
=
1
;
opSize
=
bytes
[
sprmStart
+
2
];
if
(
opSize
==
255
)
unsigned
char
spra
=
(
unsigned
char
)(
(
int
)
opCode
>>
13
);
opSize
=
(
short
)
SinglePropertyModifier
::
GetOperandSize
(
spra
);
}
unsigned
char
lenByte
=
0
;
//operand has variable size
if
(
opSize
==
255
)
{
//some opCode need special treatment
switch
(
opCode
)
{
unsigned
char
itbdDelMax
=
bytes
[
sprmStart
+
3
];
unsigned
char
itbdAddMax
=
bytes
[
sprmStart
+
3
+
2
*
itbdDelMax
];
opSize
=
(
short
)(
(
itbdDelMax
*
4
+
itbdAddMax
*
3
)
-
1
);
case
sprmTDefTable
:
case
sprmTDefTable10
:
{
//The opSize of the table definition is stored in 2 bytes instead of 1
lenByte
=
2
;
opSize
=
FormatUtils
::
BytesToInt16
(
bytes
,
(
sprmStart
+
2
),
size
);
//Word adds an additional unsigned char to the opSize to compensate the additional
//unsigned char needed for the length
opSize
--
;
}
break
;
case
sprmPChgTabs
:
{
//The tab operand can be bigger than 255 bytes (length unsigned char is set to 255).
//In this case a special calculation of the opSize is needed
lenByte
=
1
;
opSize
=
bytes
[
sprmStart
+
2
];
if
(
opSize
==
255
)
{
unsigned
char
itbdDelMax
=
bytes
[
sprmStart
+
3
];
unsigned
char
itbdAddMax
=
bytes
[
sprmStart
+
3
+
2
*
itbdDelMax
];
opSize
=
(
short
)(
(
itbdDelMax
*
4
+
itbdAddMax
*
3
)
-
1
);
}
}
break
;
case
sprmOldPAnld
:
{
lenByte
=
1
;
opSize
=
bytes
[
sprmStart
+
opCodeSize
];
}
break
;
default:
{
//The variable length stand in the unsigned char after the opcode
lenByte
=
1
;
opSize
=
bytes
[
sprmStart
+
opCodeSize
];
}
break
;
}
}
break
;
default:
{
//The variable length stand in the unsigned char after the opcode
lenByte
=
1
;
opSize
=
bytes
[
sprmStart
+
2
];
}
break
;
}
}
//copy sprm to array
//length is 2byte for the opCode, lenByte for the length, opSize for the length of the operand
int
sprmBytesSize
=
2
+
lenByte
+
opSize
;
unsigned
char
*
sprmBytes
=
NULL
;
sprmBytes
=
new
unsigned
char
[
sprmBytesSize
];
//copy sprm to array
//length is 2byte for the opCode, lenByte for the length, opSize for the length of the operand
int
sprmBytesSize
=
opCodeSize
+
lenByte
+
opSize
;
unsigned
char
*
sprmBytes
=
NULL
;
sprmBytes
=
new
unsigned
char
[
sprmBytesSize
];
if
(
size
>=
(
sprmStart
+
sprmBytesSize
)
)
{
memcpy
(
sprmBytes
,
(
bytes
+
sprmStart
),
sprmBytesSize
);
//parse
SinglePropertyModifier
sprm
(
sprmBytes
,
sprmBytesSize
);
SinglePropertyModifier
sprm
(
sprmBytes
,
sprmBytesSize
,
oldVersion
);
grpprl
->
push_back
(
sprm
);
sprmStart
+=
sprmBytesSize
;
...
...
@@ -154,4 +163,5 @@ PropertyExceptions::PropertyExceptions( unsigned char* bytes, int size, bool old
}
}
}
}
\ No newline at end of file
ASCOfficeDocFile/DocDocxConverter/SectionPropertiesMapping.cpp
View file @
ab2461a5
...
...
@@ -127,6 +127,7 @@ namespace DocFileFormat
switch
(
iter
->
OpCode
)
{
//page margins
case
sprmOldSDxaLeft
:
case
sprmSDxaLeft
:
{
//left margin
...
...
@@ -135,6 +136,7 @@ namespace DocFileFormat
}
break
;
case
sprmOldSDxaRight
:
case
sprmSDxaRight
:
{
//right margin
...
...
@@ -143,32 +145,38 @@ namespace DocFileFormat
}
break
;
case
sprmOldSDyaTop
:
case
sprmSDyaTop
:
//top margin
appendValueAttribute
(
&
pgMar
,
_T
(
"w:top"
),
FormatUtils
::
IntToWideString
(
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
)
).
c_str
()
);
break
;
case
sprmOldSDyaBottom
:
case
sprmSDyaBottom
:
//bottom margin
appendValueAttribute
(
&
pgMar
,
_T
(
"w:bottom"
),
FormatUtils
::
IntToWideString
(
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
)
).
c_str
()
);
break
;
case
sprmOldSDzaGutter
:
case
sprmSDzaGutter
:
//gutter margin
appendValueAttribute
(
&
pgMar
,
_T
(
"w:gutter"
),
FormatUtils
::
IntToWideString
(
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
)
).
c_str
()
);
break
;
case
sprmOldSDyaHdrTop
:
case
sprmSDyaHdrTop
:
//header margin
appendValueAttribute
(
&
pgMar
,
_T
(
"w:header"
),
FormatUtils
::
IntToWideString
(
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
)
).
c_str
()
);
break
;
case
sprmOldSDyaHdrBottom
:
case
sprmSDyaHdrBottom
:
//footer margin
appendValueAttribute
(
&
pgMar
,
_T
(
"w:footer"
),
FormatUtils
::
IntToWideString
(
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
)
).
c_str
()
);
break
;
//page size and orientation
case
sprmOldSXaPage
:
case
sprmSXaPage
:
{
//width
...
...
@@ -177,21 +185,25 @@ namespace DocFileFormat
}
break
;
case
sprmOldSYaPage
:
case
sprmSYaPage
:
//height
appendValueAttribute
(
&
pgSz
,
_T
(
"w:h"
),
FormatUtils
::
IntToWideString
(
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
)
).
c_str
()
);
break
;
case
sprmOldSBOrientation
:
case
sprmSBOrientation
:
//orientation
appendValueAttribute
(
&
pgSz
,
_T
(
"w:orient"
),
FormatUtils
::
MapValueToWideString
(
iter
->
Arguments
[
0
],
&
PageOrientationMap
[
0
][
0
],
3
,
10
).
c_str
()
);
break
;
//paper source
case
sprmOldSDmBinFirst
:
case
sprmSDmBinFirst
:
appendValueAttribute
(
&
paperSrc
,
_T
(
"w:first"
),
FormatUtils
::
IntToWideString
(
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
)
).
c_str
()
);
break
;
case
sprmOldSDmBinOther
:
case
sprmSDmBinOther
:
appendValueAttribute
(
&
paperSrc
,
_T
(
"w:other"
),
FormatUtils
::
IntToWideString
(
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
)
).
c_str
()
);
break
;
...
...
@@ -306,6 +318,7 @@ namespace DocFileFormat
break
;
// Columns
case
sprmOldSCcolumns
:
case
sprmSCcolumns
:
{
m_nColumns
=
static_cast
<
int
>
(
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
)
+
1
);
...
...
@@ -317,11 +330,13 @@ namespace DocFileFormat
}
break
;
case
sprmOldSDxaColumns
:
case
sprmSDxaColumns
:
//evenly spaced columns
appendValueAttribute
(
&
cols
,
_T
(
"w:space"
),
FormatUtils
::
IntToWideString
(
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
)
).
c_str
()
);
break
;
case
sprmOldSDxaColWidth
:
case
sprmSDxaColWidth
:
{
// there is at least one width set, so create the array
...
...
@@ -336,6 +351,7 @@ namespace DocFileFormat
}
break
;
case
sprmOldSDxaColSpacing
:
case
sprmSDxaColSpacing
:
{
// there is at least one space set, so create the array
...
...
@@ -356,6 +372,7 @@ namespace DocFileFormat
break
;
//title page
case
sprmOldSFTitlePage
:
case
sprmSFTitlePage
:
appendFlagElement
(
m_pXmlNode
,
*
iter
,
_T
(
"titlePg"
),
true
);
break
;
...
...
@@ -366,6 +383,7 @@ namespace DocFileFormat
break
;
//type
case
sprmOldSBkc
:
case
sprmSBkc
:
{
this
->
_type
=
FormatUtils
::
MapValueToWideString
(
iter
->
Arguments
[
0
],
&
SectionTypeMap
[
0
][
0
],
5
,
11
);
...
...
@@ -373,25 +391,30 @@ namespace DocFileFormat
break
;
//align
case
sprmOldSVjc
:
case
sprmSVjc
:
appendValueElement
(
m_pXmlNode
,
_T
(
"vAlign"
),
FormatUtils
::
MapValueToWideString
(
iter
->
Arguments
[
0
],
&
TextVerticalAlignment
[
0
][
0
],
4
,
7
).
c_str
(),
true
);
break
;
//pgNumType
case
sprmOldSNfcPgn
:
case
sprmSNfcPgn
:
appendValueAttribute
(
&
pgNumType
,
_T
(
"w:fmt"
),
FormatUtils
::
MapValueToWideString
(
iter
->
Arguments
[
0
],
&
PageNumberFormatCodeMap
[
0
][
0
],
42
,
29
).
c_str
()
);
break
;
case
sprmOldSPgnStart
:
case
sprmSPgnStart
:
wsSprmSPgnStart
=
FormatUtils
::
IntToWideString
(
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
)
);
break
;
case
sprmOldSFPgnRestart
:
case
sprmSFPgnRestart
:
bWasSprmSFPgnRestart
=
true
;
break
;
// <w:lnNumType> - Line Numbering Settings
case
sprmOldSLnnMin
:
case
sprmSLnnMin
:
{
unsigned
short
start
=
FormatUtils
::
BytesToUInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
);
...
...
@@ -401,6 +424,7 @@ namespace DocFileFormat
}
break
;
case
sprmOldSLnc
:
case
sprmSLnc
:
{
SLncOperand
mode
=
(
SLncOperand
)
FormatUtils
::
BytesToUChar
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
);
...
...
@@ -410,6 +434,7 @@ namespace DocFileFormat
}
break
;
case
sprmOldSNLnnMod
:
case
sprmSNLnnMod
:
{
short
countBy
=
FormatUtils
::
BytesToUInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
);
...
...
ASCOfficeDocFile/DocDocxConverter/SinglePropertyModifier.cpp
View file @
ab2461a5
...
...
@@ -36,38 +36,51 @@
namespace
DocFileFormat
{
SinglePropertyModifier
::
SinglePropertyModifier
()
:
Arguments
(
NULL
),
OpCode
(
sprmPIstd
),
fSpec
(
false
),
Type
(
PAP
),
argumentsSize
(
0
)
SinglePropertyModifier
::
SinglePropertyModifier
(
bool
oldVersion_
)
:
Arguments
(
NULL
),
OpCode
(
sprmPIstd
),
fSpec
(
false
),
Type
(
PAP
),
argumentsSize
(
0
),
oldVersion
(
oldVersion_
)
{
}
/// parses the unsigned char to retrieve a SPRM
SinglePropertyModifier
::
SinglePropertyModifier
(
unsigned
char
*
bytes
,
int
size
)
:
Arguments
(
NULL
),
OpCode
(
sprmPIstd
),
fSpec
(
false
),
Type
(
PAP
),
argumentsSize
(
0
)
SinglePropertyModifier
::
SinglePropertyModifier
(
unsigned
char
*
bytes
,
int
size
,
bool
oldVersion_
)
:
Arguments
(
NULL
),
OpCode
(
sprmPIstd
),
fSpec
(
false
),
Type
(
PAP
),
argumentsSize
(
0
),
oldVersion
(
oldVersion_
)
{
//first 2 bytes are the operation code ...
this
->
OpCode
=
(
OperationCode
)
FormatUtils
::
BytesToUInt16
(
bytes
,
0
,
size
);
//... whereof bit 9 is fSpec ...
unsigned
int
j
=
(
unsigned
int
)
this
->
OpCode
<<
22
;
j
=
j
>>
31
;
if
(
j
==
1
)
unsigned
char
opSize
=
0
;
unsigned
char
opCodeSize
=
0
;
if
(
oldVersion
)
{
this
->
fSpec
=
true
;
opCodeSize
=
1
;
//first 1 byte are the operation code ...
OpCode
=
(
OperationCode
)
FormatUtils
::
BytesToUChar
(
bytes
,
0
,
size
);
opSize
=
GetOldOperandSize
(
(
unsigned
char
)
OpCode
);
}
else
{
this
->
fSpec
=
false
;
}
opCodeSize
=
2
;
//first 2 bytes are the operation code ...
OpCode
=
(
OperationCode
)
FormatUtils
::
BytesToUInt16
(
bytes
,
0
,
size
);
//... whereof bit 9 is fSpec ...
unsigned
int
j
=
(
unsigned
int
)
this
->
OpCode
<<
22
;
j
=
j
>>
31
;
if
(
j
==
1
)
{
fSpec
=
true
;
}
else
{
fSpec
=
false
;
}
//... and bits 10,11,12 are the type ...
unsigned
int
i
=
(
unsigned
int
)
this
->
OpCode
<<
19
;
//... and bits 10,11,12 are the type ...
unsigned
int
i
=
(
unsigned
int
)
OpCode
<<
19
;
i
=
i
>>
29
;
this
->
Type
=
(
SprmType
)
i
;
i
=
i
>>
29
;
Type
=
(
SprmType
)
i
;
//... and last 3 bits are the spra
unsigned
char
spra
=
(
unsigned
char
)(
(
int
)
this
->
OpCode
>>
13
);
unsigned
char
opSize
=
GetOperandSize
(
spra
);
//... and last 3 bits are the spra
unsigned
char
spra
=
(
unsigned
char
)(
(
int
)
OpCode
>>
13
);
opSize
=
GetOperandSize
(
spra
);
}
if
(
opSize
==
255
)
{
...
...
@@ -77,31 +90,31 @@ namespace DocFileFormat
case
sprmTDefTable10
:
{
//the variable length stand in the bytes 2 and 3
short
opSizeTable
=
FormatUtils
::
BytesToInt16
(
bytes
,
2
,
size
);
this
->
argumentsSize
=
opSizeTable
-
1
;
short
opSizeTable
=
FormatUtils
::
BytesToInt16
(
bytes
,
opCodeSize
,
size
);
argumentsSize
=
opSizeTable
-
1
;
//and the arguments start at the unsigned char after that (byte3)
this
->
Arguments
=
new
unsigned
char
[
this
->
argumentsSize
];
Arguments
=
new
unsigned
char
[
argumentsSize
];
//Arguments start at unsigned char 4
memcpy
(
this
->
Arguments
,
(
bytes
+
4
),
this
->
argumentsSize
);
memcpy
(
Arguments
,
(
bytes
+
opCodeSize
+
2
),
argumentsSize
);
}
break
;
case
sprmPChgTabs
:
{
this
->
argumentsSize
=
bytes
[
2
];
this
->
Arguments
=
new
unsigned
char
[
this
->
argumentsSize
];
memcpy
(
this
->
Arguments
,
(
bytes
+
3
),
this
->
argumentsSize
);
argumentsSize
=
bytes
[
2
];
Arguments
=
new
unsigned
char
[
argumentsSize
];
memcpy
(
Arguments
,
(
bytes
+
opCodeSize
+
1
),
argumentsSize
);
}
break
;
default:
{
//the variable length stand in the unsigned char after the opcode (byte2)
opSize
=
bytes
[
2
];
this
->
argumentsSize
=
opSize
;
opSize
=
bytes
[
opCodeSize
];
argumentsSize
=
opSize
;
//and the arguments start at the unsigned char after that (byte3)
this
->
Arguments
=
new
unsigned
char
[
this
->
argumentsSize
];
memcpy
(
this
->
Arguments
,
(
bytes
+
3
),
this
->
argumentsSize
);
Arguments
=
new
unsigned
char
[
argumentsSize
];
memcpy
(
Arguments
,
(
bytes
+
opCodeSize
+
1
),
argumentsSize
);
}
break
;
...
...
@@ -109,9 +122,9 @@ namespace DocFileFormat
}
else
{
this
->
argumentsSize
=
opSize
;
this
->
Arguments
=
new
unsigned
char
[
this
->
argumentsSize
];
memcpy
(
this
->
Arguments
,
(
bytes
+
2
),
this
->
argumentsSize
);
argumentsSize
=
opSize
;
Arguments
=
new
unsigned
char
[
argumentsSize
];
memcpy
(
Arguments
,
(
bytes
+
opCodeSize
),
argumentsSize
);
}
}
...
...
@@ -119,19 +132,20 @@ namespace DocFileFormat
{
if
(
spm
.
Arguments
!=
NULL
)
{
this
->
argumentsSize
=
spm
.
argumentsSize
;
this
->
Arguments
=
new
unsigned
char
[
this
->
argumentsSize
];
memcpy
(
this
->
Arguments
,
spm
.
Arguments
,
this
->
argumentsSize
);
this
->
fSpec
=
spm
.
fSpec
;
this
->
OpCode
=
spm
.
OpCode
;
this
->
Type
=
spm
.
Type
;
argumentsSize
=
spm
.
argumentsSize
;
Arguments
=
new
unsigned
char
[
argumentsSize
];
memcpy
(
Arguments
,
spm
.
Arguments
,
argumentsSize
);
fSpec
=
spm
.
fSpec
;
OpCode
=
spm
.
OpCode
;
Type
=
spm
.
Type
;
oldVersion
=
spm
.
oldVersion
;
}
}
bool
SinglePropertyModifier
::
operator
==
(
const
SinglePropertyModifier
&
spm
)
const
{
if
(
(
this
->
argumentsSize
==
spm
.
argumentsSize
)
&&
(
memcmp
(
this
->
Arguments
,
spm
.
Arguments
,
this
->
argumentsSize
)
==
0
)
&&
(
this
->
fSpec
==
spm
.
fSpec
)
&&
(
this
->
OpCode
==
spm
.
OpCode
)
&&
(
this
->
Type
==
spm
.
Type
)
)
if
(
(
argumentsSize
==
spm
.
argumentsSize
)
&&
(
memcmp
(
Arguments
,
spm
.
Arguments
,
argumentsSize
)
==
0
)
&&
(
fSpec
==
spm
.
fSpec
)
&&
(
OpCode
==
spm
.
OpCode
)
&&
(
Type
==
spm
.
Type
)
)
{
return
true
;
}
...
...
@@ -156,9 +170,11 @@ namespace DocFileFormat
fSpec
=
spm
.
fSpec
;
Type
=
spm
.
Type
;
argumentsSize
=
spm
.
argumentsSize
;
oldVersion
=
spm
.
oldVersion
;
Arguments
=
new
unsigned
char
[
argumentsSize
];
memcpy
(
Arguments
,
spm
.
Arguments
,
spm
.
argumentsSize
);
memcpy
(
Arguments
,
spm
.
Arguments
,
spm
.
argumentsSize
);
}
return
*
this
;
...
...
@@ -187,4 +203,15 @@ namespace DocFileFormat
default:
return
0
;
}
}
static
const
unsigned
char
OldOperandSizeTable
[]
=
{
0
,
0
,
2
,
255
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
255
,
1
,
1
,
255
,
2
,
2
,
2
,
2
,
4
,
2
,
2
,
255
,
1
,
1
,
2
,
2
,
2
,
1
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
1
,
2
,
2
,
2
,
2
,
2
,
2
,
1
,
2
,
2
,
2
,
2
,
2
,
1
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
1
,
1
,
255
,
2
,
4
,
1
,
2
,
3
,
255
,
1
,
0
,
0
,
0
,
0
,
2
,
255
,
255
,
0
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
2
,
1
,
3
,
2
,
2
,
1
,
1
,
1
,
1
,
1
,
255
,
1
,
255
,
255
,
2
,
255
,
2
,
2
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
1
,
1
,
255
,
2
,
2
,
2
,
2
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
1
,
255
,
0
,
0
,
3
,
3
,
1
,
1
,
2
,
2
,
1
,
1
,
2
,
2
,
1
,
1
,
2
,
2
,
1
,
1
,
1
,
1
,
2
,
2
,
2
,
2
,
1
,
1
,
2
,
2
,
1
,
0
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
2
,
2
,
2
,
1
,
1
,
12
,
255
,
2
,
0
,
0
,
4
,
5
,
4
,
2
,
4
,
2
,
2
,
5
,
4
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
};
unsigned
char
SinglePropertyModifier
::
GetOldOperandSize
(
unsigned
char
code
)
{
if
(
code
<
2
||
code
>
207
)
return
-
1
;
return
OldOperandSizeTable
[
code
];
}
}
ASCOfficeDocFile/DocDocxConverter/SinglePropertyModifier.h
View file @
ab2461a5
...
...
@@ -48,6 +48,7 @@ namespace DocFileFormat
class
SinglePropertyModifier
{
public:
bool
oldVersion
;
/// The operation code identifies the property of the
/// PAP/CHP/PIC/SEP/TAP which sould be modified
OperationCode
OpCode
;
...
...
@@ -60,10 +61,11 @@ namespace DocFileFormat
/// The Arguments size
unsigned
int
argumentsSize
;
SinglePropertyModifier
();
SinglePropertyModifier
(
bool
oldVersion
);
/// parses the unsigned char to retrieve a SPRM
SinglePropertyModifier
(
unsigned
char
*
bytes
,
int
size
);
SinglePropertyModifier
(
const
SinglePropertyModifier
&
spm
);
SinglePropertyModifier
(
unsigned
char
*
bytes
,
int
size
,
bool
oldVersion
);
SinglePropertyModifier
(
const
SinglePropertyModifier
&
spm
);
bool
operator
==
(
const
SinglePropertyModifier
&
spm
)
const
;
bool
operator
!=
(
const
SinglePropertyModifier
&
spm
)
const
;
SinglePropertyModifier
&
operator
=
(
const
SinglePropertyModifier
&
spm
);
...
...
@@ -71,5 +73,6 @@ namespace DocFileFormat
/// Get be used to get the size of the sprm's operand.
/// Returns 0 if the Operation failed and 255 if the size is variable
static
unsigned
char
GetOperandSize
(
unsigned
char
spra
);
static
unsigned
char
GetOldOperandSize
(
unsigned
char
code
);
};
}
ASCOfficeDocFile/DocDocxConverter/TableCellPropertiesMapping.cpp
View file @
ab2461a5
...
...
@@ -78,38 +78,36 @@ namespace DocFileFormat
std
::
list
<
SinglePropertyModifier
>::
const_reverse_iterator
rend
=
tapx
->
grpprl
->
rend
();
for
(
std
::
list
<
SinglePropertyModifier
>::
const_reverse_iterator
iter
=
tapx
->
grpprl
->
rbegin
();
iter
!=
rend
;
++
iter
)
{
#ifdef _DEBUG
SinglePropertyModifier
spm
=
(
*
iter
);
#endif
switch
(
iter
->
OpCode
)
{
case
sprmTDefTable
:
// Table definition SPRM
case
sprmOldTDefTable
:
case
sprmTDefTable
:
{
SprmTDefTable
tdef
(
iter
->
Arguments
,
iter
->
argumentsSize
);
int
cc
=
tdef
.
numberOfColumns
;
this
->
_tGrid
=
tdef
.
rgdxaCenter
;
this
->
_tcDef
=
tdef
.
rgTc80
[(
std
::
min
)(
_cellIndex
,
(
int
)
tdef
.
rgTc80
.
size
()
-
1
)];
// NOTE: fix for crash
_tGrid
=
tdef
.
rgdxaCenter
;
_tcDef
=
tdef
.
rgTc80
[(
std
::
min
)(
_cellIndex
,
(
int
)
tdef
.
rgTc80
.
size
()
-
1
)];
// NOTE: fix for crash
appendValueElement
(
this
->
_tcPr
,
_T
(
"textDirection"
),
FormatUtils
::
MapValueToWideString
(
this
->
_tcDef
.
textFlow
,
&
Global
::
TextFlowMap
[
0
][
0
],
6
,
6
).
c_str
(),
false
);
appendValueElement
(
_tcPr
,
_T
(
"textDirection"
),
FormatUtils
::
MapValueToWideString
(
_tcDef
.
textFlow
,
&
Global
::
TextFlowMap
[
0
][
0
],
6
,
6
).
c_str
(),
false
);
if
(
this
->
_tcDef
.
vertMerge
==
Global
::
fvmMerge
)
if
(
_tcDef
.
vertMerge
==
Global
::
fvmMerge
)
{
appendValueElement
(
this
->
_tcPr
,
_T
(
"vMerge"
),
_T
(
"continue"
),
false
);
appendValueElement
(
_tcPr
,
_T
(
"vMerge"
),
_T
(
"continue"
),
false
);
}
else
if
(
this
->
_tcDef
.
vertMerge
==
Global
::
fvmRestart
)
else
if
(
_tcDef
.
vertMerge
==
Global
::
fvmRestart
)
{
appendValueElement
(
this
->
_tcPr
,
_T
(
"vMerge"
),
_T
(
"restart"
),
false
);
appendValueElement
(
_tcPr
,
_T
(
"vMerge"
),
_T
(
"restart"
),
false
);
}
appendValueElement
(
this
->
_tcPr
,
_T
(
"vAlign"
),
FormatUtils
::
MapValueToWideString
(
this
->
_tcDef
.
vertAlign
,
&
Global
::
VerticalAlignMap
[
0
][
0
],
3
,
7
).
c_str
(),
false
);
appendValueElement
(
_tcPr
,
_T
(
"vAlign"
),
FormatUtils
::
MapValueToWideString
(
_tcDef
.
vertAlign
,
&
Global
::
VerticalAlignMap
[
0
][
0
],
3
,
7
).
c_str
(),
false
);
if
(
this
->
_tcDef
.
fFitText
)
if
(
_tcDef
.
fFitText
)
{
appendValueElement
(
_tcPr
,
_T
(
"tcFitText"
),
_T
(
""
),
false
);
}
if
(
this
->
_tcDef
.
fNoWrap
)
if
(
_tcDef
.
fNoWrap
)
{
appendValueElement
(
_tcPr
,
_T
(
"noWrap"
),
_T
(
""
),
true
);
}
...
...
@@ -117,9 +115,9 @@ namespace DocFileFormat
nComputedCellWidth
=
(
short
)(
tdef
.
rgdxaCenter
[(
size_t
)(
std
::
min
)(
_cellIndex
,
(
int
)
tdef
.
rgTc80
.
size
()
-
1
)
+
1
]
-
tdef
.
rgdxaCenter
[(
std
::
min
)(
_cellIndex
,
(
int
)
tdef
.
rgTc80
.
size
()
-
1
)]
);
// NOTE: fix for crash
//borders
if
(
!
IsTableBordersDefined
(
tapx
->
grpprl
))
{
{
//borders
RELEASEOBJECT
(
_brcTop
);
_brcTop
=
new
BorderCode
(
*
_tcDef
.
brcTop
);
...
...
@@ -135,66 +133,65 @@ namespace DocFileFormat
}
break
;
//margins
case
sprmTCellPadding
:
{
case
sprmTCellPadding
:
{
//margins
unsigned
char
first
=
iter
->
Arguments
[
0
];
unsigned
char
lim
=
iter
->
Arguments
[
1
];
unsigned
char
ftsMargin
=
iter
->
Arguments
[
3
];
short
wMargin
=
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
4
,
iter
->
argumentsSize
);
if
(
(
this
->
_cellIndex
>=
first
)
&&
(
this
->
_cellIndex
<
lim
)
)
if
(
(
_cellIndex
>=
first
)
&&
(
_cellIndex
<
lim
)
)
{
if
(
FormatUtils
::
GetBitFromInt
(
iter
->
Arguments
[
2
],
0
)
==
true
)
{
appendDxaElement
(
this
->
_tcMar
,
_T
(
"top"
),
FormatUtils
::
IntToWideString
(
wMargin
).
c_str
(),
true
);
appendDxaElement
(
_tcMar
,
_T
(
"top"
),
FormatUtils
::
IntToWideString
(
wMargin
).
c_str
(),
true
);
}
if
(
FormatUtils
::
GetBitFromInt
(
iter
->
Arguments
[
2
],
1
)
==
true
)
{
appendDxaElement
(
this
->
_tcMar
,
_T
(
"left"
),
FormatUtils
::
IntToWideString
(
wMargin
).
c_str
(),
true
);
appendDxaElement
(
_tcMar
,
_T
(
"left"
),
FormatUtils
::
IntToWideString
(
wMargin
).
c_str
(),
true
);
}
if
(
FormatUtils
::
GetBitFromInt
(
iter
->
Arguments
[
2
],
2
)
==
true
)
{
appendDxaElement
(
this
->
_tcMar
,
_T
(
"bottom"
),
FormatUtils
::
IntToWideString
(
wMargin
).
c_str
(),
true
);
appendDxaElement
(
_tcMar
,
_T
(
"bottom"
),
FormatUtils
::
IntToWideString
(
wMargin
).
c_str
(),
true
);
}
if
(
FormatUtils
::
GetBitFromInt
(
iter
->
Arguments
[
2
],
3
)
==
true
)
{
appendDxaElement
(
this
->
_tcMar
,
_T
(
"right"
),
FormatUtils
::
IntToWideString
(
wMargin
).
c_str
(),
true
);
appendDxaElement
(
_tcMar
,
_T
(
"right"
),
FormatUtils
::
IntToWideString
(
wMargin
).
c_str
(),
true
);
}
}
}
break
;
case
sprmTDefTableShd80
:
if
(
!
tapx
->
IsSkipShading97
())
// если такой операнд единственный то учитываем его, иначе скипаем его
case
sprmTDefTableShd80
:
{
apppendCellShading
(
iter
->
Arguments
,
iter
->
argumentsSize
,
_cellIndex
);
}
break
;
// shading
if
(
!
tapx
->
IsSkipShading97
())
// если такой операнд единственный то учитываем его, иначе скипаем его
{
apppendCellShading
(
iter
->
Arguments
,
iter
->
argumentsSize
,
_cellIndex
)
;
}
}
break
;
case
sprmTDefTableShd
:
// cell shading for cells 0-20
apppendCellShading
(
iter
->
Arguments
,
iter
->
argumentsSize
,
_cellIndex
);
break
;
case
sprmOldTDefTableShd
:
case
sprmTDefTableShd
:
{
// cell shading for cells 0-20
apppendCellShading
(
iter
->
Arguments
,
iter
->
argumentsSize
,
_cellIndex
);
}
break
;
case
sprmTDefTableShd2nd
:
// cell shading for cells 21-42
apppendCellShading
(
iter
->
Arguments
,
iter
->
argumentsSize
,
(
_cellIndex
-
21
));
break
;
case
sprmTDefTableShd2nd
:
{
// cell shading for cells 21-42
apppendCellShading
(
iter
->
Arguments
,
iter
->
argumentsSize
,
(
_cellIndex
-
21
));
}
break
;
case
sprmTDefTableShd3rd
:
// cell shading for cells 43-62
apppendCellShading
(
iter
->
Arguments
,
iter
->
argumentsSize
,
(
_cellIndex
-
43
));
break
;
case
sprmTDefTableShd3rd
:
{
// cell shading for cells 43-62
apppendCellShading
(
iter
->
Arguments
,
iter
->
argumentsSize
,
(
_cellIndex
-
43
));
}
break
;
//width
case
sprmTCellWidth
:
{
case
sprmTCellWidth
:
{
//width
unsigned
char
first
=
iter
->
Arguments
[
0
];
unsigned
char
lim
=
iter
->
Arguments
[
1
];
...
...
@@ -205,10 +202,9 @@ namespace DocFileFormat
}
}
break
;
//vertical alignment
case
sprmTVertAlign
:
{
case
sprmTVertAlign
:
{
//vertical alignment
unsigned
char
first
=
iter
->
Arguments
[
0
];
unsigned
char
lim
=
iter
->
Arguments
[
1
];
...
...
@@ -219,28 +215,27 @@ namespace DocFileFormat
}
break
;
//Autofit
case
sprmTFitText
:
{
case
sprmTFitText
:
{
//Autofit
unsigned
char
first
=
iter
->
Arguments
[
0
];
unsigned
char
lim
=
iter
->
Arguments
[
1
];
if
(
(
this
->
_cellIndex
>=
first
)
&&
(
this
->
_cellIndex
<
lim
)
)
if
(
(
_cellIndex
>=
first
)
&&
(
_cellIndex
<
lim
)
)
{
appendValueElement
(
this
->
_tcPr
,
_T
(
"tcFitText"
),
FormatUtils
::
IntToWideString
(
iter
->
Arguments
[
2
]
).
c_str
(),
true
);
appendValueElement
(
_tcPr
,
_T
(
"tcFitText"
),
FormatUtils
::
IntToWideString
(
iter
->
Arguments
[
2
]
).
c_str
(),
true
);
}
}
break
;
//borders (cell definition)
case
sprmTSetBrc
:
{
case
sprmOldTSetBrc
:
case
sprmTSetBrc
:
{
//borders (cell definition)
unsigned
char
min
=
iter
->
Arguments
[
0
];
unsigned
char
max
=
iter
->
Arguments
[
1
];
int
bordersToApply
=
(
int
)(
iter
->
Arguments
[
2
]
);
if
(
(
this
->
_cellIndex
>=
min
)
&&
(
this
->
_cellIndex
<
max
)
)
if
(
(
_cellIndex
>=
min
)
&&
(
_cellIndex
<
max
)
)
{
const
int
brcSize
=
8
;
unsigned
char
brcBytes
[
brcSize
];
...
...
@@ -248,25 +243,25 @@ namespace DocFileFormat
if
(
FormatUtils
::
BitmaskToBool
(
bordersToApply
,
0x01
)
)
{
RELEASEOBJECT
(
this
->
_brcTop
);
this
->
_brcTop
=
new
BorderCode
(
brcBytes
,
brcSize
);
RELEASEOBJECT
(
_brcTop
);
_brcTop
=
new
BorderCode
(
brcBytes
,
brcSize
);
}
if
(
FormatUtils
::
BitmaskToBool
(
bordersToApply
,
0x02
)
)
{
RELEASEOBJECT
(
this
->
_brcLeft
);
this
->
_brcLeft
=
new
BorderCode
(
brcBytes
,
brcSize
);
RELEASEOBJECT
(
_brcLeft
);
_brcLeft
=
new
BorderCode
(
brcBytes
,
brcSize
);
}
if
(
FormatUtils
::
BitmaskToBool
(
bordersToApply
,
0x04
)
)
{
RELEASEOBJECT
(
this
->
_brcBottom
);
this
->
_brcBottom
=
new
BorderCode
(
brcBytes
,
brcSize
);
RELEASEOBJECT
(
_brcBottom
);
_brcBottom
=
new
BorderCode
(
brcBytes
,
brcSize
);
}
if
(
FormatUtils
::
BitmaskToBool
(
bordersToApply
,
0x08
)
)
{
RELEASEOBJECT
(
this
->
_brcRight
);
RELEASEOBJECT
(
_brcRight
);
_brcRight
=
new
BorderCode
(
brcBytes
,
brcSize
);
}
}
...
...
@@ -284,18 +279,18 @@ namespace DocFileFormat
_tcPr
->
AppendChild
(
tcW
);
//grid span
this
->
_gridSpan
=
1
;
_gridSpan
=
1
;
if
(
(
this
->
_gridIndex
<
(
int
)
this
->
_grid
->
size
()
)
&&
(
nComputedCellWidth
>
this
->
_grid
->
at
(
this
->
_gridIndex
)
)
)
if
(
(
_gridIndex
<
(
int
)
_grid
->
size
()
)
&&
(
nComputedCellWidth
>
_grid
->
at
(
_gridIndex
)
)
)
{
//check the number of merged cells
int
w
=
this
->
_grid
->
at
(
this
->
_gridIndex
);
int
w
=
_grid
->
at
(
_gridIndex
);
for
(
unsigned
int
i
=
this
->
_gridIndex
+
1
;
i
<
this
->
_grid
->
size
();
i
++
)
for
(
unsigned
int
i
=
_gridIndex
+
1
;
i
<
_grid
->
size
();
i
++
)
{
this
->
_gridSpan
++
;
_gridSpan
++
;
w
+=
this
->
_grid
->
at
(
i
);
w
+=
_grid
->
at
(
i
);
if
(
w
>=
nComputedCellWidth
)
{
...
...
@@ -303,7 +298,7 @@ namespace DocFileFormat
}
}
appendValueElement
(
this
->
_tcPr
,
_T
(
"gridSpan"
),
FormatUtils
::
IntToWideString
(
this
->
_gridSpan
).
c_str
(),
true
);
appendValueElement
(
_tcPr
,
_T
(
"gridSpan"
),
FormatUtils
::
IntToWideString
(
_gridSpan
).
c_str
(),
true
);
}
//append margins
...
...
@@ -337,13 +332,13 @@ namespace DocFileFormat
if
(
_brcRight
)
{
XMLTools
::
XMLElement
<
wchar_t
>
rightBorder
(
_T
(
"w:right"
)
);
appendBorderAttributes
(
this
->
_brcRight
,
&
rightBorder
);
addOrSetBorder
(
this
->
_tcBorders
,
&
rightBorder
);
appendBorderAttributes
(
_brcRight
,
&
rightBorder
);
addOrSetBorder
(
_tcBorders
,
&
rightBorder
);
}
if
(
this
->
_tcBorders
->
GetChildCount
()
>
0
)
if
(
_tcBorders
->
GetChildCount
()
>
0
)
{
this
->
_tcPr
->
AppendChild
(
*
(
this
->
_tcBorders
)
);
_tcPr
->
AppendChild
(
*
(
_tcBorders
)
);
}
//write Properties
...
...
ASCOfficeDocFile/DocDocxConverter/TableMapping.cpp
View file @
ab2461a5
...
...
@@ -43,7 +43,7 @@ namespace DocFileFormat
{
for
(
std
::
list
<
ITableCellElementPtr
>::
const_iterator
iter
=
_tableCell
.
cellElements
.
begin
();
iter
!=
_tableCell
.
cellElements
.
end
();
iter
++
)
{
this
->
AddItem
(
**
iter
);
AddItem
(
**
iter
);
}
}
...
...
@@ -55,16 +55,16 @@ namespace DocFileFormat
{
if
(
this
!=
&
_tableCell
)
{
this
->
cp
=
_tableCell
.
cp
;
this
->
depth
=
_tableCell
.
depth
;
this
->
cellElements
.
clear
();
cp
=
_tableCell
.
cp
;
depth
=
_tableCell
.
depth
;
cellElements
.
clear
();
for
(
std
::
list
<
ITableCellElementPtr
>::
const_iterator
iter
=
_tableCell
.
cellElements
.
begin
();
iter
!=
_tableCell
.
cellElements
.
end
();
iter
++
)
{
this
->
AddItem
(
**
iter
);
AddItem
(
**
iter
);
}
this
->
documentMapping
=
_tableCell
.
documentMapping
;
documentMapping
=
_tableCell
.
documentMapping
;
}
return
*
this
;
...
...
@@ -72,38 +72,38 @@ namespace DocFileFormat
void
TableCell
::
SetCP
(
int
_cp
)
{
this
->
cp
=
_cp
;
cp
=
_cp
;
}
int
TableCell
::
GetCP
()
const
{
return
this
->
cp
;
return
cp
;
}
void
TableCell
::
SetDepth
(
unsigned
int
_depth
)
{
this
->
depth
=
_depth
;
depth
=
_depth
;
}
unsigned
int
TableCell
::
GetDepth
()
const
{
return
this
->
depth
;
return
depth
;
}
void
TableCell
::
AddItem
(
const
ITableCellElement
&
_tableCellElement
)
{
this
->
cellElements
.
push_back
(
ITableCellElementPtr
(
static_cast
<
ITableCellElement
*>
(
_tableCellElement
.
Clone
()
)
)
);
cellElements
.
push_back
(
ITableCellElementPtr
(
static_cast
<
ITableCellElement
*>
(
_tableCellElement
.
Clone
()
)
)
);
}
bool
TableCell
::
IsEmpty
()
const
{
return
this
->
cellElements
.
empty
();
return
cellElements
.
empty
();
}
void
TableCell
::
Clear
()
{
this
->
cp
=
0
;
this
->
cellElements
.
clear
();
cp
=
0
;
cellElements
.
clear
();
}
void
TableCell
::
Convert
(
IMapping
*
mapping
,
TablePropertyExceptions
*
tapx
,
const
std
::
vector
<
short
>*
grid
,
int
&
gridIndex
,
int
nCellIndex
)
...
...
@@ -158,39 +158,39 @@ namespace DocFileFormat
void
TableRow
::
SetCP
(
int
_cp
)
{
this
->
cp
=
_cp
;
cp
=
_cp
;
}
int
TableRow
::
GetCP
()
const
{
return
this
->
cp
;
return
cp
;
}
void
TableRow
::
SetDepth
(
unsigned
int
_depth
)
{
this
->
depth
=
_depth
;
depth
=
_depth
;
}
unsigned
int
TableRow
::
GetDepth
()
const
{
return
this
->
depth
;
return
depth
;
}
void
TableRow
::
AddCell
(
const
TableCell
&
_tableCell
)
{
this
->
cells
.
push_back
(
_tableCell
);
cells
.
push_back
(
_tableCell
);
}
bool
TableRow
::
IsEmpty
()
const
{
return
this
->
cells
.
empty
();
return
cells
.
empty
();
}
void
TableRow
::
Clear
()
{
this
->
cp
=
0
;
this
->
depth
=
1
;
this
->
cells
.
clear
();
cp
=
0
;
depth
=
1
;
cells
.
clear
();
}
void
TableRow
::
Convert
(
IMapping
*
mapping
,
const
std
::
vector
<
short
>*
grid
)
...
...
@@ -205,11 +205,11 @@ namespace DocFileFormat
int
gridIndex
=
0
;
int
nCellIndex
=
0
;
ParagraphPropertyExceptions
*
papxBackup
=
this
->
documentMapping
->
_lastValidPapx
;
SectionPropertyExceptions
*
sepxBackup
=
this
->
documentMapping
->
_lastValidSepx
;
ParagraphPropertyExceptions
*
papxBackup
=
documentMapping
->
_lastValidPapx
;
SectionPropertyExceptions
*
sepxBackup
=
documentMapping
->
_lastValidSepx
;
//start w:tr
this
->
documentMapping
->
GetXMLWriter
()
->
WriteNodeBegin
(
_T
(
"w:tr"
)
);
documentMapping
->
GetXMLWriter
()
->
WriteNodeBegin
(
_T
(
"w:tr"
)
);
//convert the properties
int
fcRowEnd
=
documentMapping
->
findRowEndFc
(
cp
,
depth
);
...
...
@@ -217,20 +217,20 @@ namespace DocFileFormat
documentMapping
->
m_document
->
DataStream
,
documentMapping
->
m_document
->
FIB
->
m_bOlderVersion
);
std
::
list
<
CharacterPropertyExceptions
*>*
chpxs
=
this
->
documentMapping
->
m_document
->
GetCharacterPropertyExceptions
(
fcRowEnd
,
fcRowEnd
+
1
);
TableRowPropertiesMapping
trpMapping
(
this
->
documentMapping
->
GetXMLWriter
(),
*
(
chpxs
->
begin
())
);
std
::
list
<
CharacterPropertyExceptions
*>*
chpxs
=
documentMapping
->
m_document
->
GetCharacterPropertyExceptions
(
fcRowEnd
,
fcRowEnd
+
1
);
TableRowPropertiesMapping
trpMapping
(
documentMapping
->
GetXMLWriter
(),
*
(
chpxs
->
begin
())
);
tapx
.
Convert
(
&
trpMapping
);
this
->
documentMapping
->
_lastValidPapx
=
papxBackup
;
this
->
documentMapping
->
_lastValidSepx
=
sepxBackup
;
documentMapping
->
_lastValidPapx
=
papxBackup
;
documentMapping
->
_lastValidSepx
=
sepxBackup
;
for
(
std
::
list
<
TableCell
>::
iterator
iter
=
this
->
cells
.
begin
();
iter
!=
this
->
cells
.
end
();
iter
++
)
for
(
std
::
list
<
TableCell
>::
iterator
iter
=
cells
.
begin
();
iter
!=
cells
.
end
();
iter
++
)
{
iter
->
Convert
(
mapping
,
&
tapx
,
grid
,
gridIndex
,
nCellIndex
++
);
}
//end w:tr
this
->
documentMapping
->
GetXMLWriter
()
->
WriteNodeEnd
(
_T
(
"w:tr"
)
);
documentMapping
->
GetXMLWriter
()
->
WriteNodeEnd
(
_T
(
"w:tr"
)
);
RELEASEOBJECT
(
chpxs
);
}
...
...
@@ -249,27 +249,27 @@ namespace DocFileFormat
int
DocParagraph
::
GetCPStart
()
const
{
return
this
->
cpStart
;
return
cpStart
;
}
void
DocParagraph
::
SetCPStart
(
int
_cpStart
)
{
this
->
cpStart
=
_cpStart
;
cpStart
=
_cpStart
;
}
int
DocParagraph
::
GetCPEnd
()
const
{
return
this
->
cpEnd
;
return
cpEnd
;
}
void
DocParagraph
::
SetCPEnd
(
int
_cpEnd
)
{
this
->
cpEnd
=
_cpEnd
;
cpEnd
=
_cpEnd
;
}
IVirtualConstructor
*
DocParagraph
::
New
()
const
{
return
new
DocParagraph
(
this
->
documentMapping
);
return
new
DocParagraph
(
documentMapping
);
}
IVirtualConstructor
*
DocParagraph
::
Clone
()
const
...
...
@@ -281,10 +281,10 @@ namespace DocFileFormat
{
if
(
mapping
!=
NULL
)
{
this
->
documentMapping
=
static_cast
<
DocumentMapping
*>
(
mapping
);
documentMapping
=
static_cast
<
DocumentMapping
*>
(
mapping
);
}
this
->
documentMapping
->
writeParagraph
(
this
->
cpStart
);
documentMapping
->
writeParagraph
(
cpStart
);
}
}
...
...
@@ -324,13 +324,13 @@ namespace DocFileFormat
ParagraphPropertyExceptions
*
papx
=
NULL
;
papx
=
this
->
documentMapping
->
findValidPapx
(
fc
);
papx
=
documentMapping
->
findValidPapx
(
fc
);
TableInfo
tai
(
papx
);
return
(
(
tai
.
fInTable
)
&&
(
(
(
this
->
documentMapping
->
m_document
->
Text
->
at
(
_cp
)
==
0x0007
)
&&
(
tai
.
iTap
<=
1
)
&&
return
(
(
tai
.
fInTable
)
&&
(
(
(
documentMapping
->
m_document
->
Text
->
at
(
_cp
)
==
0x0007
)
&&
(
tai
.
iTap
<=
1
)
&&
(
tai
.
fTtp
)
)
||
(
(
this
->
documentMapping
->
m_document
->
Text
->
at
(
_cp
)
==
0x000D
)
&&
(
tai
.
iTap
>
1
)
&&
(
(
documentMapping
->
m_document
->
Text
->
at
(
_cp
)
==
0x000D
)
&&
(
tai
.
iTap
>
1
)
&&
(
tai
.
fInnerTtp
)
)
)
);
}
...
...
@@ -344,48 +344,48 @@ namespace DocFileFormat
ParagraphPropertyExceptions
*
papx
=
NULL
;
papx
=
this
->
documentMapping
->
findValidPapx
(
fc
);
papx
=
documentMapping
->
findValidPapx
(
fc
);
TableInfo
tai
(
papx
);
return
(
(
tai
.
fInTable
)
&&
(
this
->
documentMapping
->
m_document
->
Text
->
at
(
_cp
)
==
0x000D
)
&&
(
!
this
->
IsCellMarker
(
_cp
)
)
&&
(
!
this
->
IsRowMarker
(
_cp
)
)
);
return
(
(
tai
.
fInTable
)
&&
(
documentMapping
->
m_document
->
Text
->
at
(
_cp
)
==
0x000D
)
&&
(
!
IsCellMarker
(
_cp
)
)
&&
(
!
IsRowMarker
(
_cp
)
)
);
}
Table
::
Table
(
DocumentMapping
*
_documentMapping
,
int
_cp
,
unsigned
int
_depth
)
:
cpStart
(
_cp
),
cpEnd
(
_cp
),
depth
(
_depth
),
documentMapping
(
_documentMapping
)
{
if
(
this
->
documentMapping
!=
NULL
)
if
(
documentMapping
!=
NULL
)
{
int
paragraphBeginCP
=
_cp
;
ParagraphPropertyExceptions
*
papxBackup
=
this
->
documentMapping
->
_lastValidPapx
;
SectionPropertyExceptions
*
sepxBackup
=
this
->
documentMapping
->
_lastValidSepx
;
ParagraphPropertyExceptions
*
papxBackup
=
documentMapping
->
_lastValidPapx
;
SectionPropertyExceptions
*
sepxBackup
=
documentMapping
->
_lastValidSepx
;
int
fc
=
documentMapping
->
m_document
->
FindFileCharPos
(
_cp
);
if
(
fc
<
0
)
return
;
ParagraphPropertyExceptions
*
papx
=
NULL
;
papx
=
this
->
documentMapping
->
findValidPapx
(
fc
);
papx
=
documentMapping
->
findValidPapx
(
fc
);
TableInfo
tai
(
papx
);
TableRow
tableRow
(
this
->
documentMapping
,
_cp
);
TableCell
tableCell
(
this
->
documentMapping
,
_cp
);
TableRow
tableRow
(
documentMapping
,
_cp
);
TableCell
tableCell
(
documentMapping
,
_cp
);
do
{
fc
=
documentMapping
->
m_document
->
FindFileCharPos
(
_cp
);
if
(
fc
<
0
)
break
;
papx
=
this
->
documentMapping
->
findValidPapx
(
fc
);
papx
=
documentMapping
->
findValidPapx
(
fc
);
tai
=
TableInfo
(
papx
);
if
(
tai
.
iTap
>
_depth
)
{
Table
innerTable
(
this
->
documentMapping
,
_cp
,
(
_depth
+
1
)
);
Table
innerTable
(
documentMapping
,
_cp
,
(
_depth
+
1
)
);
tableCell
.
AddItem
(
innerTable
);
...
...
@@ -394,7 +394,7 @@ namespace DocFileFormat
fc
=
documentMapping
->
m_document
->
FindFileCharPos
(
_cp
);
if
(
fc
<
0
)
break
;
papx
=
this
->
documentMapping
->
findValidPapx
(
fc
);
papx
=
documentMapping
->
findValidPapx
(
fc
);
tai
=
TableInfo
(
papx
);
...
...
@@ -402,28 +402,28 @@ namespace DocFileFormat
}
else
{
if
(
this
->
IsCellMarker
(
_cp
)
)
if
(
IsCellMarker
(
_cp
)
)
{
tableCell
.
SetCP
(
_cp
);
tableCell
.
SetDepth
(
_depth
);
tableCell
.
AddItem
(
DocParagraph
(
this
->
documentMapping
,
paragraphBeginCP
,
_cp
)
);
tableCell
.
AddItem
(
DocParagraph
(
documentMapping
,
paragraphBeginCP
,
_cp
)
);
tableRow
.
AddCell
(
tableCell
);
tableCell
.
Clear
();
paragraphBeginCP
=
(
_cp
+
1
);
}
else
if
(
this
->
IsRowMarker
(
_cp
)
)
else
if
(
IsRowMarker
(
_cp
)
)
{
tableRow
.
SetCP
(
_cp
);
tableRow
.
SetDepth
(
_depth
);
this
->
AddRow
(
tableRow
);
AddRow
(
tableRow
);
tableRow
.
Clear
();
paragraphBeginCP
++
;
}
else
if
(
this
->
IsParagraphMarker
(
_cp
)
)
else
if
(
IsParagraphMarker
(
_cp
)
)
{
tableCell
.
AddItem
(
DocParagraph
(
this
->
documentMapping
,
paragraphBeginCP
,
_cp
)
);
tableCell
.
AddItem
(
DocParagraph
(
documentMapping
,
paragraphBeginCP
,
_cp
)
);
paragraphBeginCP
=
(
_cp
+
1
);
}
...
...
@@ -432,65 +432,65 @@ namespace DocFileFormat
}
while
(
(
tai
.
fInTable
)
&&
(
tai
.
iTap
==
_depth
)
);
this
->
cpEnd
=
(
_cp
-
1
);
cpEnd
=
(
_cp
-
1
);
this
->
documentMapping
->
_lastValidPapx
=
papxBackup
;
this
->
documentMapping
->
_lastValidSepx
=
sepxBackup
;
documentMapping
->
_lastValidPapx
=
papxBackup
;
documentMapping
->
_lastValidSepx
=
sepxBackup
;
}
}
int
Table
::
GetCPStart
()
const
{
return
this
->
cpStart
;
return
cpStart
;
}
void
Table
::
SetCPStart
(
int
_cpStart
)
{
this
->
cpStart
=
_cpStart
;
cpStart
=
_cpStart
;
}
int
Table
::
GetCPEnd
()
const
{
return
this
->
cpEnd
;
return
cpEnd
;
}
void
Table
::
SetCPEnd
(
int
_cpEnd
)
{
this
->
cpEnd
=
_cpEnd
;
cpEnd
=
_cpEnd
;
}
bool
Table
::
IsEmpty
()
const
{
return
this
->
rows
.
empty
();
return
rows
.
empty
();
}
void
Table
::
Clear
()
{
this
->
cpStart
=
0
;
this
->
cpEnd
=
0
;
this
->
rows
.
clear
();
cpStart
=
0
;
cpEnd
=
0
;
rows
.
clear
();
}
void
Table
::
SetDepth
(
unsigned
int
_depth
)
{
this
->
depth
=
_depth
;
depth
=
_depth
;
}
unsigned
int
Table
::
GetDepth
()
const
{
return
this
->
depth
;
return
depth
;
}
int
Table
::
AddRow
(
const
TableRow
&
_tableRow
)
{
this
->
rows
.
push_back
(
_tableRow
);
rows
.
push_back
(
_tableRow
);
return
this
->
cpEnd
;
return
cpEnd
;
}
IVirtualConstructor
*
Table
::
New
()
const
{
return
new
Table
(
this
->
documentMapping
);
return
new
Table
(
documentMapping
);
}
IVirtualConstructor
*
Table
::
Clone
()
const
...
...
@@ -507,33 +507,33 @@ namespace DocFileFormat
SectionPropertyExceptions
*
sepxBackup
=
documentMapping
->
_lastValidSepx
;
//build the table grid
std
::
vector
<
short
>*
grid
=
this
->
documentMapping
->
buildTableGrid
(
this
->
cpStart
,
this
->
depth
);
std
::
vector
<
short
>*
grid
=
documentMapping
->
buildTableGrid
(
cpStart
,
depth
);
//find first row end
int
fcRowEnd
=
this
->
documentMapping
->
findRowEndFc
(
this
->
cpStart
,
this
->
depth
);
int
fcRowEnd
=
documentMapping
->
findRowEndFc
(
cpStart
,
depth
);
TablePropertyExceptions
row1Tapx
(
documentMapping
->
findValidPapx
(
fcRowEnd
),
documentMapping
->
m_document
->
DataStream
,
documentMapping
->
m_document
->
FIB
->
m_bOlderVersion
);
//start table
this
->
documentMapping
->
GetXMLWriter
()
->
WriteNodeBegin
(
_T
(
"w:tbl"
)
);
documentMapping
->
GetXMLWriter
()
->
WriteNodeBegin
(
_T
(
"w:tbl"
)
);
//Convert it
TablePropertiesMapping
tpMapping
(
this
->
documentMapping
->
GetXMLWriter
(),
this
->
documentMapping
->
m_document
->
Styles
,
grid
);
TablePropertiesMapping
tpMapping
(
documentMapping
->
GetXMLWriter
(),
documentMapping
->
m_document
->
Styles
,
grid
);
row1Tapx
.
Convert
(
&
tpMapping
);
this
->
documentMapping
->
_lastValidPapx
=
papxBackup
;
this
->
documentMapping
->
_lastValidSepx
=
sepxBackup
;
documentMapping
->
_lastValidPapx
=
papxBackup
;
documentMapping
->
_lastValidSepx
=
sepxBackup
;
for
(
std
::
list
<
TableRow
>::
iterator
iter
=
this
->
rows
.
begin
();
iter
!=
this
->
rows
.
end
();
iter
++
)
for
(
std
::
list
<
TableRow
>::
iterator
iter
=
rows
.
begin
();
iter
!=
rows
.
end
();
iter
++
)
{
iter
->
Convert
(
mapping
,
grid
);
}
//close w:tbl
this
->
documentMapping
->
GetXMLWriter
()
->
WriteNodeEnd
(
_T
(
"w:tbl"
)
);
documentMapping
->
GetXMLWriter
()
->
WriteNodeEnd
(
_T
(
"w:tbl"
)
);
RELEASEOBJECT
(
grid
);
}
...
...
ASCOfficeDocFile/DocDocxConverter/TablePropertiesMapping.cpp
View file @
ab2461a5
...
...
@@ -35,14 +35,14 @@
namespace
DocFileFormat
{
TablePropertiesMapping
::
TablePropertiesMapping
(
XmlUtils
::
CXmlWriter
*
pWriter
,
StyleSheet
*
styles
,
std
::
vector
<
short
>*
grid
,
bool
isTableStyleNeeded
)
:
PropertiesMapping
(
pWriter
),
_tblPr
(
NULL
),
_tblGrid
(
NULL
),
_tblBorders
(
NULL
),
_grid
(
NULL
),
brcLeft
(
NULL
),
brcTop
(
NULL
),
brcBottom
(
NULL
),
brcRight
(
NULL
),
brcHorz
(
NULL
),
brcVert
(
NULL
),
_styles
(
NULL
),
_isTableStyleNeeded
(
isTableStyleNeeded
)
PropertiesMapping
(
pWriter
),
_tblPr
(
NULL
),
_tblGrid
(
NULL
),
_tblBorders
(
NULL
),
_grid
(
NULL
),
brcLeft
(
NULL
),
brcTop
(
NULL
),
brcBottom
(
NULL
),
brcRight
(
NULL
),
brcHorz
(
NULL
),
brcVert
(
NULL
),
_styles
(
NULL
),
_isTableStyleNeeded
(
isTableStyleNeeded
)
{
_styles
=
styles
;
this
->
_tblPr
=
new
XMLTools
::
XMLElement
<
wchar_t
>
(
_T
(
"w:tblPr"
)
);
this
->
_tblBorders
=
new
XMLTools
::
XMLElement
<
wchar_t
>
(
_T
(
"w:tblBorders"
)
);
this
->
_grid
=
grid
;
_styles
=
styles
;
_tblPr
=
new
XMLTools
::
XMLElement
<
wchar_t
>
(
_T
(
"w:tblPr"
)
);
_tblBorders
=
new
XMLTools
::
XMLElement
<
wchar_t
>
(
_T
(
"w:tblBorders"
)
);
_grid
=
grid
;
}
TablePropertiesMapping
::~
TablePropertiesMapping
()
{
...
...
@@ -63,30 +63,32 @@ namespace DocFileFormat
{
TablePropertyExceptions
*
tapx
=
static_cast
<
TablePropertyExceptions
*>
(
visited
);
XMLTools
::
XMLElement
<
wchar_t
>
tblCellMar
(
_T
(
"w:tblCellMar"
)
);
XMLTools
::
XMLElement
<
wchar_t
>
tblLayout
(
_T
(
"w:tblLayout"
)
);
XMLTools
::
XMLElement
<
wchar_t
>
tblpPr
(
_T
(
"w:tblpPr"
)
);
XMLTools
::
XMLAttribute
<
wchar_t
>
layoutType
(
_T
(
"w:type"
),
_T
(
"fixed"
)
);
XMLTools
::
XMLElement
<
wchar_t
>
tblCellMar
(
_T
(
"w:tblCellMar"
)
);
XMLTools
::
XMLElement
<
wchar_t
>
tblLayout
(
_T
(
"w:tblLayout"
)
);
XMLTools
::
XMLElement
<
wchar_t
>
tblpPr
(
_T
(
"w:tblpPr"
)
);
XMLTools
::
XMLAttribute
<
wchar_t
>
layoutType
(
_T
(
"w:type"
),
_T
(
"fixed"
)
);
bool
bLayoutFixed
=
true
;
short
tblIndent
=
0
;
short
gabHalf
=
0
;
short
marginLeft
=
0
;
short
marginRight
=
0
;
short
tblIndent
=
0
;
short
gabHalf
=
0
;
short
marginLeft
=
0
;
short
marginRight
=
0
;
for
(
std
::
list
<
SinglePropertyModifier
>::
iterator
iter
=
tapx
->
grpprl
->
begin
();
iter
!=
tapx
->
grpprl
->
end
();
iter
++
)
{
switch
(
iter
->
OpCode
)
{
case
sprmTDxaGapHalf
:
case
sprmOldTDxaGapHalf
:
case
sprmTDxaGapHalf
:
{
gabHalf
=
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
);
}
break
;
//table definition
case
sprmTDefTable
:
{
case
sprmOldTDefTable
:
case
sprmTDefTable
:
{
//table definition
SprmTDefTable
tDef
(
iter
->
Arguments
,
iter
->
argumentsSize
);
//Workaround for retrieving the indent of the table:
//In some files there is a indent but no sprmTWidthIndent is set.
...
...
@@ -97,14 +99,13 @@ namespace DocFileFormat
tblIndent
+=
gabHalf
;
//If there follows a real sprmTWidthIndent, this value will be overwritten
///<<<<FIXED
tblIndent
=
(
std
::
max
)((
int
)
tblIndent
,
0
);
}
break
;
//preferred table width
case
sprmTTableWidth
:
{
case
sprmTTableWidth
:
{
//preferred table width
unsigned
char
fts
=
iter
->
Arguments
[
0
];
short
width
=
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
1
,
iter
->
argumentsSize
);
...
...
@@ -120,27 +121,28 @@ namespace DocFileFormat
}
break
;
//justification
case
sprmTJc
:
case
sprmTJcRow
:
{
case
sprmOldTJc
:
case
sprmTJc
:
case
sprmTJcRow
:
{
//justification
appendValueElement
(
_tblPr
,
_T
(
"jc"
),
FormatUtils
::
MapValueToWideString
(
iter
->
Arguments
[
0
],
&
Global
::
JustificationCode
[
0
][
0
],
10
,
15
).
c_str
(),
true
);
}
break
;
//indent
case
sprmTWidthIndent
:
{
case
sprmTWidthIndent
:
{
//indent
tblIndent
=
FtsWWidth_Indent
(
iter
->
Arguments
).
wWidth
;
// tblIndent = FormatUtils::BytesToInt16( iter->Arguments, 1, iter->argumentsSize );
}
break
;
//style
case
sprmTIstd
:
case
sprmTIstdPermute
:
{
if
(
this
->
_isTableStyleNeeded
)
case
sprmTIstd
:
case
sprmTIstdPermute
:
{
//style
if
(
_isTableStyleNeeded
)
{
int
ind
=
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
);
...
...
@@ -154,24 +156,25 @@ namespace DocFileFormat
}
break
;
//bidi
case
sprmTFBiDi
:
case
sprmTFBiDi90
:
{
case
sprmTFBiDi
:
case
sprmTFBiDi90
:
{
//bidi
appendValueElement
(
_tblPr
,
_T
(
"bidiVisual"
),
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
),
true
);
}
break
;
//table look
case
sprmTTlp
:
{
case
sprmOldTTlp
:
case
sprmTTlp
:
{
//table look
appendValueElement
(
_tblPr
,
_T
(
"tblLook"
),
FormatUtils
::
IntToFormattedWideString
(
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
2
,
iter
->
argumentsSize
),
_T
(
"%04x"
)
).
c_str
(),
true
);
}
break
;
//autofit
case
sprmTFAutofit
:
{
case
sprmTFAutofit
:
{
//autofit
if
(
iter
->
Arguments
[
0
]
==
1
)
{
layoutType
.
SetValue
(
_T
(
"auto"
)
);
...
...
@@ -180,11 +183,11 @@ namespace DocFileFormat
}
break
;
//default cell padding (margin)
case
sprmTCellPadding
:
case
sprmTCellPaddingDefault
:
case
sprmTCellPaddingOuter
:
{
case
sprmTCellPadding
:
case
sprmTCellPaddingDefault
:
case
sprmTCellPaddingOuter
:
{
//default cell padding (margin)
unsigned
char
grfbrc
=
iter
->
Arguments
[
2
];
short
wMar
=
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
4
,
iter
->
argumentsSize
);
std
::
wstring
strValue
=
FormatUtils
::
IntToWideString
(
wMar
);
...
...
@@ -211,23 +214,23 @@ namespace DocFileFormat
}
break
;
//row count
case
sprmTCHorzBands
:
{
case
sprmTCHorzBands
:
{
//row count
appendValueElement
(
_tblPr
,
_T
(
"tblStyleRowBandSize"
),
iter
->
Arguments
[
0
],
true
);
}
break
;
//col count
case
sprmTCVertBands
:
{
case
sprmTCVertBands
:
{
//col count
appendValueElement
(
_tblPr
,
_T
(
"tblStyleColBandSize"
),
iter
->
Arguments
[
0
],
true
);
}
break
;
//overlap
case
sprmTFNoAllowOverlap
:
{
case
sprmTFNoAllowOverlap
:
{
//overlap
std
::
wstring
tblOverlapVal
=
std
::
wstring
(
_T
(
"overlap"
)
);
if
(
iter
->
Arguments
[
0
]
)
...
...
@@ -239,16 +242,17 @@ namespace DocFileFormat
}
break
;
//shading
case
sprmTSetShdTable
:
{
case
sprmOldTSetShd
:
case
sprmTSetShdTable
:
{
//shading
appendShading
(
_tblPr
,
ShadingDescriptor
(
iter
->
Arguments
,
iter
->
argumentsSize
)
);
}
break
;
//borders 80 exceptions
case
sprmTTableBorders80
:
{
case
sprmTTableBorders80
:
{
//borders 80 exceptions
const
int
size
=
4
;
unsigned
char
brc80
[
size
];
...
...
@@ -285,7 +289,8 @@ namespace DocFileFormat
break
;
//border exceptions
case
sprmTTableBorders
:
case
sprmOldTTableBorders
:
case
sprmTTableBorders
:
{
const
int
size
=
8
;
unsigned
char
brc
[
size
];
...
...
@@ -323,7 +328,7 @@ namespace DocFileFormat
break
;
//floating table properties
case
sprmTPc
:
case
sprmTPc
:
{
unsigned
char
flag
=
(
iter
->
Arguments
[
0
]
&
0x30
)
>>
4
;
...
...
@@ -335,37 +340,37 @@ namespace DocFileFormat
}
break
;
case
sprmTDxaFromText
:
case
sprmTDxaFromText
:
{
appendValueAttribute
(
&
tblpPr
,
_T
(
"w:leftFromText"
),
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
)
);
}
break
;
case
sprmTDxaFromTextRight
:
case
sprmTDxaFromTextRight
:
{
appendValueAttribute
(
&
tblpPr
,
_T
(
"w:rightFromText"
),
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
)
);
}
break
;
case
sprmTDyaFromText
:
case
sprmTDyaFromText
:
{
appendValueAttribute
(
&
tblpPr
,
_T
(
"w:topFromText"
),
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
)
);
}
break
;
case
sprmTDyaFromTextBottom
:
case
sprmTDyaFromTextBottom
:
{
appendValueAttribute
(
&
tblpPr
,
_T
(
"w:bottomFromText"
),
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
)
);
}
break
;
case
sprmTDxaAbs
:
case
sprmTDxaAbs
:
{
appendValueAttribute
(
&
tblpPr
,
_T
(
"w:tblpX"
),
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
)
);
}
break
;
case
sprmTDyaAbs
:
case
sprmTDyaAbs
:
{
appendValueAttribute
(
&
tblpPr
,
_T
(
"w:tblpY"
),
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
)
);
}
...
...
ASCOfficeDocFile/DocDocxConverter/TableRowPropertiesMapping.cpp
View file @
ab2461a5
...
...
@@ -54,53 +54,53 @@ namespace DocFileFormat
TablePropertyExceptions
*
tapx
=
static_cast
<
TablePropertyExceptions
*>
(
visited
);
//delete infos
RevisionData
rev
(
this
->
_rowEndChpx
);
RevisionData
rev
(
_rowEndChpx
);
if
(
(
this
->
_rowEndChpx
!=
NULL
)
&&
(
rev
.
Type
==
Deleted
)
)
if
(
(
_rowEndChpx
!=
NULL
)
&&
(
rev
.
Type
==
Deleted
)
)
{
XMLTools
::
XMLElement
<
wchar_t
>
del
(
_T
(
"w:del"
)
);
this
->
_trPr
->
AppendChild
(
del
);
_trPr
->
AppendChild
(
del
);
}
for
(
std
::
list
<
SinglePropertyModifier
>::
iterator
iter
=
tapx
->
grpprl
->
begin
();
iter
!=
tapx
->
grpprl
->
end
();
iter
++
)
{
switch
(
iter
->
OpCode
)
{
case
sprmTDefTable
:
case
sprmOldTDefTable
:
case
sprmTDefTable
:
{
//SprmTDefTable tdef = new SprmTDefTable(sprm.Arguments);
}
break
;
//header row
case
sprmTTableHeader
:
{
case
sprmOldTTableHeader
:
case
sprmTTableHeader
:
{
//header row
bool
fHeader
=
(
iter
->
Arguments
[
0
]
!=
0
)
?
(
true
)
:
(
false
);
if
(
fHeader
)
{
XMLTools
::
XMLElement
<
wchar_t
>
header
(
_T
(
"w:tblHeader"
)
);
this
->
_trPr
->
AppendChild
(
header
);
_trPr
->
AppendChild
(
header
);
}
}
break
;
//width after
case
sprmTWidthAfter
:
{
case
sprmTWidthAfter
:
{
//width after
XMLTools
::
XMLElement
<
wchar_t
>
wAfter
(
_T
(
"w:wAfter"
)
);
XMLTools
::
XMLAttribute
<
wchar_t
>
wAfterValue
(
_T
(
"w:w"
),
FormatUtils
::
IntToWideString
(
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
1
,
iter
->
argumentsSize
)
).
c_str
()
);
wAfter
.
AppendAttribute
(
wAfterValue
);
XMLTools
::
XMLAttribute
<
wchar_t
>
wAfterType
(
_T
(
"w:type"
),
_T
(
"dxa"
)
);
wAfter
.
AppendAttribute
(
wAfterType
);
this
->
_trPr
->
AppendChild
(
wAfter
);
_trPr
->
AppendChild
(
wAfter
);
}
break
;
//width before
case
sprmTWidthBefore
:
{
case
sprmTWidthBefore
:
{
//width before
short
before
=
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
1
,
iter
->
argumentsSize
);
if
(
before
!=
0
)
...
...
@@ -111,14 +111,14 @@ namespace DocFileFormat
XMLTools
::
XMLAttribute
<
wchar_t
>
wBeforeType
(
_T
(
"w:type"
),
_T
(
"dxa"
)
);
wBefore
.
AppendAttribute
(
wBeforeType
);
this
->
_trPr
->
AppendChild
(
wBefore
);
_trPr
->
AppendChild
(
wBefore
);
}
}
break
;
//row height
case
sprmTDyaRowHeight
:
{
case
sprmOldTDyaRowHeight
:
case
sprmTDyaRowHeight
:
{
//row height
XMLTools
::
XMLElement
<
wchar_t
>
rowHeight
(
_T
(
"w:trHeight"
)
);
XMLTools
::
XMLAttribute
<
wchar_t
>
rowHeightVal
(
_T
(
"w:val"
)
);
XMLTools
::
XMLAttribute
<
wchar_t
>
rowHeightRule
(
_T
(
"w:hRule"
)
);
...
...
@@ -144,20 +144,22 @@ namespace DocFileFormat
}
rowHeight
.
AppendAttribute
(
rowHeightRule
);
this
->
_trPr
->
AppendChild
(
rowHeight
);
_trPr
->
AppendChild
(
rowHeight
);
}
break
;
//can't split
case
sprmOldTFCantSplit
:
case
sprmTFCantSplit
:
case
sprmTFCantSplit90
:
appendFlagElement
(
this
->
_trPr
,
*
iter
,
_T
(
"cantSplit"
),
true
);
break
;
{
//can't split
appendFlagElement
(
_trPr
,
*
iter
,
_T
(
"cantSplit"
),
true
);
}
break
;
//div id
case
sprmTIpgp
:
appendValueElement
(
this
->
_trPr
,
_T
(
"divId"
),
FormatUtils
::
IntToWideString
(
FormatUtils
::
BytesToInt32
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
)
).
c_str
(),
true
);
break
;
{
appendValueElement
(
_trPr
,
_T
(
"divId"
),
FormatUtils
::
IntToWideString
(
FormatUtils
::
BytesToInt32
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
)
).
c_str
(),
true
);
}
break
;
//borders 80 exceptions
//case SinglePropertyModifier.OperationCode.sprmTTableBorders80:
...
...
@@ -250,15 +252,15 @@ namespace DocFileFormat
//}
//set exceptions
if
(
this
->
_tblPrEx
->
GetChildCount
()
>
0
)
if
(
_tblPrEx
->
GetChildCount
()
>
0
)
{
this
->
_trPr
->
AppendChild
(
*
(
this
->
_tblPrEx
)
);
_trPr
->
AppendChild
(
*
(
_tblPrEx
)
);
}
//write Properties
if
(
(
this
->
_trPr
->
GetChildCount
()
>
0
)
||
(
this
->
_trPr
->
GetAttributeCount
()
>
0
)
)
if
(
(
_trPr
->
GetChildCount
()
>
0
)
||
(
_trPr
->
GetAttributeCount
()
>
0
)
)
{
m_pXmlWriter
->
WriteString
(
this
->
_trPr
->
GetXMLString
().
c_str
()
);
m_pXmlWriter
->
WriteString
(
_trPr
->
GetXMLString
().
c_str
()
);
}
}
}
\ No newline at end of file
ASCOfficeDocFile/DocDocxConverter/WordDocument.cpp
View file @
ab2461a5
...
...
@@ -31,14 +31,15 @@
*/
#include "WordDocument.h"
#include "../../Common/OfficeFileErrorDescription.h"
#include "../../ASCOfficeXlsFile2/source/XlsFormat/Logic/SummaryInformationStream/SummaryInformation.h"
#include "../../ASCOfficeXlsFile2/source/XlsFormat/Binary/CFStream.h"
#include "../../Common/DocxFormat/Source/SystemUtility/FileSystem/Directory.h"
#include "../../DesktopEditor/common/File.h"
namespace
DocFileFormat
{
WordDocument
::
WordDocument
(
const
ProgressCallback
*
pCallFunc
,
const
std
::
wstring
&
sTempFolder
)
:
...
...
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