3 * Copyright (C) 1998-2005 A.J. van Os; Released under GNU GPL
6 * Read the properties information from a MS Word file
15 * Build the lists with Property Information
18 vGetPropertyInfo(FILE *pFile
, const pps_info_type
*pPPS
,
19 const ULONG
*aulBBD
, size_t tBBDLen
,
20 const ULONG
*aulSBD
, size_t tSBDLen
,
21 const UCHAR
*aucHeader
, int iWordVersion
)
23 options_type tOptions
;
25 TRACE_MSG("vGetPropertyInfo");
28 fail(pPPS
== NULL
&& iWordVersion
>= 6);
29 fail(aulBBD
== NULL
&& tBBDLen
!= 0);
30 fail(aulSBD
== NULL
&& tSBDLen
!= 0);
31 fail(aucHeader
== NULL
);
34 vGetOptions(&tOptions
);
36 /* Get the property information per Word version */
37 switch (iWordVersion
) {
39 vGet0DopInfo(pFile
, aucHeader
);
40 vGet0SepInfo(pFile
, aucHeader
);
41 vGet0PapInfo(pFile
, aucHeader
);
42 if (tOptions
.eConversionType
== conversion_draw
||
43 tOptions
.eConversionType
== conversion_ps
||
44 tOptions
.eConversionType
== conversion_xml
||
45 tOptions
.eConversionType
== conversion_fmt_text
||
46 tOptions
.eConversionType
== conversion_pdf
) {
47 vGet0ChrInfo(pFile
, aucHeader
);
49 if (tOptions
.eConversionType
== conversion_draw
||
50 tOptions
.eConversionType
== conversion_ps
||
51 tOptions
.eConversionType
== conversion_pdf
) {
54 vSet0SummaryInfo(pFile
, aucHeader
);
58 vGet2Stylesheet(pFile
, iWordVersion
, aucHeader
);
59 vGet2DopInfo(pFile
, aucHeader
);
60 vGet2SepInfo(pFile
, aucHeader
);
61 vGet2PapInfo(pFile
, aucHeader
);
62 if (tOptions
.eConversionType
== conversion_ps
||
63 tOptions
.eConversionType
== conversion_pdf
) {
64 vGet2HdrFtrInfo(pFile
, aucHeader
);
66 if (tOptions
.eConversionType
== conversion_draw
||
67 tOptions
.eConversionType
== conversion_ps
||
68 tOptions
.eConversionType
== conversion_xml
||
69 tOptions
.eConversionType
== conversion_fmt_text
||
70 tOptions
.eConversionType
== conversion_pdf
) {
71 vGet2ChrInfo(pFile
, iWordVersion
, aucHeader
);
73 if (tOptions
.eConversionType
== conversion_draw
||
74 tOptions
.eConversionType
== conversion_ps
||
75 tOptions
.eConversionType
== conversion_pdf
) {
76 vCreate2FontTable(pFile
, iWordVersion
, aucHeader
);
78 vSet2SummaryInfo(pFile
, iWordVersion
, aucHeader
);
85 vGet6Stylesheet(pFile
, pPPS
->tWordDocument
.ulSB
,
86 aulBBD
, tBBDLen
, aucHeader
);
87 vGet6DopInfo(pFile
, pPPS
->tWordDocument
.ulSB
,
88 aulBBD
, tBBDLen
, aucHeader
);
89 vGet6SepInfo(pFile
, pPPS
->tWordDocument
.ulSB
,
90 aulBBD
, tBBDLen
, aucHeader
);
91 vGet6PapInfo(pFile
, pPPS
->tWordDocument
.ulSB
,
92 aulBBD
, tBBDLen
, aucHeader
);
93 if (tOptions
.eConversionType
== conversion_ps
||
94 tOptions
.eConversionType
== conversion_pdf
) {
95 vGet6HdrFtrInfo(pFile
, pPPS
->tWordDocument
.ulSB
,
96 aulBBD
, tBBDLen
, aucHeader
);
98 if (tOptions
.eConversionType
== conversion_draw
||
99 tOptions
.eConversionType
== conversion_ps
||
100 tOptions
.eConversionType
== conversion_xml
||
101 tOptions
.eConversionType
== conversion_fmt_text
||
102 tOptions
.eConversionType
== conversion_pdf
) {
103 vGet6ChrInfo(pFile
, pPPS
->tWordDocument
.ulSB
,
104 aulBBD
, tBBDLen
, aucHeader
);
106 if (tOptions
.eConversionType
== conversion_draw
||
107 tOptions
.eConversionType
== conversion_ps
||
108 tOptions
.eConversionType
== conversion_pdf
) {
109 vCreate6FontTable(pFile
, pPPS
->tWordDocument
.ulSB
,
110 aulBBD
, tBBDLen
, aucHeader
);
112 vSet6SummaryInfo(pFile
, pPPS
,
113 aulBBD
, tBBDLen
, aulSBD
, tSBDLen
, aucHeader
);
116 vGet8LstInfo(pFile
, pPPS
,
117 aulBBD
, tBBDLen
, aulSBD
, tSBDLen
, aucHeader
);
118 vGet8Stylesheet(pFile
, pPPS
,
119 aulBBD
, tBBDLen
, aulSBD
, tSBDLen
, aucHeader
);
120 vGet8DopInfo(pFile
, &pPPS
->tTable
,
121 aulBBD
, tBBDLen
, aulSBD
, tSBDLen
, aucHeader
);
122 vGet8SepInfo(pFile
, pPPS
,
123 aulBBD
, tBBDLen
, aulSBD
, tSBDLen
, aucHeader
);
124 vGet8PapInfo(pFile
, pPPS
,
125 aulBBD
, tBBDLen
, aulSBD
, tSBDLen
, aucHeader
);
126 if (tOptions
.eConversionType
== conversion_ps
||
127 tOptions
.eConversionType
== conversion_pdf
) {
128 vGet8HdrFtrInfo(pFile
, &pPPS
->tTable
,
129 aulBBD
, tBBDLen
, aulSBD
, tSBDLen
, aucHeader
);
131 if (tOptions
.eConversionType
== conversion_draw
||
132 tOptions
.eConversionType
== conversion_ps
||
133 tOptions
.eConversionType
== conversion_xml
||
134 tOptions
.eConversionType
== conversion_fmt_text
||
135 tOptions
.eConversionType
== conversion_pdf
) {
136 vGet8ChrInfo(pFile
, pPPS
,
137 aulBBD
, tBBDLen
, aulSBD
, tSBDLen
, aucHeader
);
139 if (tOptions
.eConversionType
== conversion_draw
||
140 tOptions
.eConversionType
== conversion_ps
||
141 tOptions
.eConversionType
== conversion_pdf
) {
142 vCreate8FontTable(pFile
, pPPS
,
143 aulBBD
, tBBDLen
, aulSBD
, tSBDLen
, aucHeader
);
145 vSet8SummaryInfo(pFile
, pPPS
,
146 aulBBD
, tBBDLen
, aulSBD
, tSBDLen
, aucHeader
);
149 DBG_DEC(iWordVersion
);
151 werr(0, "Sorry, no property information");
155 /* Temporarily: Correct the font table */
156 vCorrectFontTable(tOptions
.eConversionType
, tOptions
.eEncoding
);
157 } /* end of vGetPropertyInfo */
160 * ePropMod2RowInfo - Turn the Property Modifier into row information
162 * Returns: the row information
165 ePropMod2RowInfo(USHORT usPropMod
, int iWordVersion
)
168 const UCHAR
*aucPropMod
;
171 TRACE_MSG("ePropMod2RowInfo");
173 aucPropMod
= aucReadPropModListItem(usPropMod
);
174 if (aucPropMod
== NULL
) {
175 return found_nothing
;
177 iLen
= (int)usGetWord(0, aucPropMod
);
179 switch (iWordVersion
) {
181 return found_nothing
;
184 return eGet2RowInfo(0, aucPropMod
+ 2, iLen
, &tRow
);
187 return found_nothing
;
190 return eGet6RowInfo(0, aucPropMod
+ 2, iLen
, &tRow
);
192 return eGet8RowInfo(0, aucPropMod
+ 2, iLen
, &tRow
);
194 DBG_DEC(iWordVersion
);
196 return found_nothing
;
198 } /* end of ePropMod2RowInfo */