wined3d: Remove some debug TRACE stuff.
[wine] / dlls / riched20 / para.c
1 /*
2  * RichEdit - functions working on paragraphs of text (diParagraph).
3  * 
4  * Copyright 2004 by Krzysztof Foltman
5  * Copyright 2006 by Phil Krylov
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20  */ 
21
22 #include "editor.h"
23
24 WINE_DEFAULT_DEBUG_CHANNEL(richedit);
25
26 static const WCHAR wszParagraphSign[] = {0xB6, 0};
27
28 void ME_MakeFirstParagraph(ME_TextEditor *editor)
29 {
30   ME_Context c;
31   PARAFORMAT2 fmt;
32   CHARFORMAT2W cf;
33   LOGFONTW lf;
34   HFONT hf;
35   ME_TextBuffer *text = editor->pBuffer;
36   ME_DisplayItem *para = ME_MakeDI(diParagraph);
37   ME_DisplayItem *run;
38   ME_Style *style;
39
40   ME_InitContext(&c, editor, GetDC(editor->hWnd));
41
42   hf = (HFONT)GetStockObject(SYSTEM_FONT);
43   assert(hf);
44   GetObjectW(hf, sizeof(LOGFONTW), &lf);
45   ZeroMemory(&cf, sizeof(cf));
46   cf.cbSize = sizeof(cf);
47   cf.dwMask = CFM_BACKCOLOR|CFM_COLOR|CFM_FACE|CFM_SIZE|CFM_CHARSET;
48   cf.dwMask |= CFM_ALLCAPS|CFM_BOLD|CFM_DISABLED|CFM_EMBOSS|CFM_HIDDEN;
49   cf.dwMask |= CFM_IMPRINT|CFM_ITALIC|CFM_LINK|CFM_OUTLINE|CFM_PROTECTED;
50   cf.dwMask |= CFM_REVISED|CFM_SHADOW|CFM_SMALLCAPS|CFM_STRIKEOUT;
51   cf.dwMask |= CFM_SUBSCRIPT|CFM_UNDERLINETYPE|CFM_WEIGHT;
52   
53   cf.dwEffects = CFE_AUTOCOLOR | CFE_AUTOBACKCOLOR;
54   lstrcpyW(cf.szFaceName, lf.lfFaceName);
55   cf.yHeight = ME_twips2pointsY(&c, lf.lfHeight);
56   if (lf.lfWeight > FW_NORMAL) cf.dwEffects |= CFE_BOLD;
57   cf.wWeight = lf.lfWeight;
58   if (lf.lfItalic) cf.dwEffects |= CFE_ITALIC;
59   cf.bUnderlineType = (lf.lfUnderline) ? CFU_CF1UNDERLINE : CFU_UNDERLINENONE;
60   if (lf.lfStrikeOut) cf.dwEffects |= CFE_STRIKEOUT;
61   cf.bPitchAndFamily = lf.lfPitchAndFamily;
62   cf.bCharSet = lf.lfCharSet;
63
64   ZeroMemory(&fmt, sizeof(fmt));
65   fmt.cbSize = sizeof(fmt);
66   fmt.dwMask = PFM_ALIGNMENT | PFM_OFFSET | PFM_STARTINDENT | PFM_RIGHTINDENT | PFM_TABSTOPS;
67   fmt.wAlignment = PFA_LEFT;
68
69   *para->member.para.pFmt = fmt;
70
71   style = ME_MakeStyle(&cf);
72   text->pDefaultStyle = style;
73   
74   run = ME_MakeRun(style, ME_MakeString(wszParagraphSign), MERF_ENDPARA);
75   run->member.run.nCharOfs = 0;
76
77   ME_InsertBefore(text->pLast, para);
78   ME_InsertBefore(text->pLast, run);
79   para->member.para.prev_para = text->pFirst;
80   para->member.para.next_para = text->pLast;
81   text->pFirst->member.para.next_para = para;
82   text->pLast->member.para.prev_para = para;
83
84   text->pLast->member.para.nCharOfs = 1;
85
86   ME_DestroyContext(&c, editor->hWnd);
87 }
88  
89 void ME_MarkAllForWrapping(ME_TextEditor *editor)
90 {
91   ME_MarkForWrapping(editor, editor->pBuffer->pFirst->member.para.next_para, editor->pBuffer->pLast);
92 }
93
94 void ME_MarkForWrapping(ME_TextEditor *editor, ME_DisplayItem *first, const ME_DisplayItem *last)
95 {
96   while(first != last)
97   {
98     first->member.para.nFlags |= MEPF_REWRAP;
99     first = first->member.para.next_para;
100   }
101 }
102
103 void ME_MarkForPainting(ME_TextEditor *editor, ME_DisplayItem *first, const ME_DisplayItem *last)
104 {
105   while(first != last)
106   {
107     first->member.para.nFlags |= MEPF_REPAINT;
108     first = first->member.para.next_para;
109   }
110 }
111
112 /* split paragraph at the beginning of the run */
113 ME_DisplayItem *ME_SplitParagraph(ME_TextEditor *editor, ME_DisplayItem *run, ME_Style *style)
114 {
115   ME_DisplayItem *next_para = NULL;
116   ME_DisplayItem *run_para = NULL;
117   ME_DisplayItem *new_para = ME_MakeDI(diParagraph);
118   ME_DisplayItem *end_run = ME_MakeRun(style,ME_MakeString(wszParagraphSign), MERF_ENDPARA);
119   ME_UndoItem *undo = NULL;
120   int ofs;
121   ME_DisplayItem *pp;
122   int end_len = (editor->bEmulateVersion10 ? 2 : 1);
123   
124   assert(run->type == diRun);  
125
126   run_para = ME_GetParagraph(run);
127   assert(run_para->member.para.pFmt->cbSize == sizeof(PARAFORMAT2));
128
129   ofs = end_run->member.run.nCharOfs = run->member.run.nCharOfs;
130   next_para = run_para->member.para.next_para;
131   assert(next_para == ME_FindItemFwd(run_para, diParagraphOrEnd));
132   
133   undo = ME_AddUndoItem(editor, diUndoJoinParagraphs, NULL);
134   if (undo)
135     undo->nStart = run_para->member.para.nCharOfs + ofs;
136   
137   /* the new paragraph will have a different starting offset, so let's update its runs */
138   pp = run;
139   while(pp->type == diRun) {
140     pp->member.run.nCharOfs -= ofs;
141     pp = ME_FindItemFwd(pp, diRunOrParagraphOrEnd);
142   }
143   new_para->member.para.nCharOfs = ME_GetParagraph(run)->member.para.nCharOfs+ofs;
144   new_para->member.para.nCharOfs += end_len;
145   
146   new_para->member.para.nFlags = MEPF_REWRAP; /* FIXME copy flags (if applicable) */
147   /* FIXME initialize format style and call ME_SetParaFormat blah blah */
148   *new_para->member.para.pFmt = *run_para->member.para.pFmt;
149
150   new_para->member.para.bTable = run_para->member.para.bTable;
151   
152   /* Inherit previous cell definitions if any */
153   new_para->member.para.pCells = NULL;
154   if (run_para->member.para.pCells)
155   {
156     ME_TableCell *pCell, *pNewCell;
157
158     for (pCell = run_para->member.para.pCells; pCell; pCell = pCell->next)
159     {
160       pNewCell = ALLOC_OBJ(ME_TableCell);
161       pNewCell->nRightBoundary = pCell->nRightBoundary;
162       pNewCell->next = NULL;
163       if (new_para->member.para.pCells)
164         new_para->member.para.pLastCell->next = pNewCell;
165       else
166         new_para->member.para.pCells = pNewCell;
167       new_para->member.para.pLastCell = pNewCell;
168     }
169   }
170     
171   /* fix paragraph properties. FIXME only needed when called from RTF reader */
172   if (run_para->member.para.pCells && !run_para->member.para.bTable)
173   {
174     /* Paragraph does not have an \intbl keyword, so any table definition
175      * stored is invalid */
176     ME_DestroyTableCellList(run_para);
177   }
178   
179   /* insert paragraph into paragraph double linked list */
180   new_para->member.para.prev_para = run_para;
181   new_para->member.para.next_para = next_para;
182   run_para->member.para.next_para = new_para;
183   next_para->member.para.prev_para = new_para;
184
185   /* insert end run of the old paragraph, and new paragraph, into DI double linked list */
186   ME_InsertBefore(run, new_para);
187   ME_InsertBefore(new_para, end_run);
188
189   /* force rewrap of the */
190   run_para->member.para.prev_para->member.para.nFlags |= MEPF_REWRAP;
191   new_para->member.para.prev_para->member.para.nFlags |= MEPF_REWRAP;
192   
193   /* we've added the end run, so we need to modify nCharOfs in the next paragraphs */
194   ME_PropagateCharOffset(next_para, end_len);
195   editor->nParagraphs++;
196   
197   return new_para;
198 }
199
200 /* join tp with tp->member.para.next_para, keeping tp's style; this
201  * is consistent with the original */
202 ME_DisplayItem *ME_JoinParagraphs(ME_TextEditor *editor, ME_DisplayItem *tp)
203 {
204   ME_DisplayItem *pNext, *pFirstRunInNext, *pRun, *pTmp;
205   int i, shift;
206   ME_UndoItem *undo = NULL;
207   int end_len = (editor->bEmulateVersion10 ? 2 : 1);
208
209   assert(tp->type == diParagraph);
210   assert(tp->member.para.next_para);
211   assert(tp->member.para.next_para->type == diParagraph);
212   
213   pNext = tp->member.para.next_para;
214   
215   {
216     /* null char format operation to store the original char format for the ENDPARA run */
217     CHARFORMAT2W fmt;
218     ME_InitCharFormat2W(&fmt);
219     ME_SetCharFormat(editor, pNext->member.para.nCharOfs - end_len, end_len, &fmt);
220   }
221   undo = ME_AddUndoItem(editor, diUndoSplitParagraph, NULL);
222   if (undo)
223   {
224     undo->nStart = pNext->member.para.nCharOfs - end_len;
225     assert(pNext->member.para.pFmt->cbSize == sizeof(PARAFORMAT2));
226     *undo->di.member.para.pFmt = *pNext->member.para.pFmt;
227   }
228   
229   shift = pNext->member.para.nCharOfs - tp->member.para.nCharOfs - end_len;
230   
231   pRun = ME_FindItemBack(pNext, diRunOrParagraph);
232   pFirstRunInNext = ME_FindItemFwd(pNext, diRunOrParagraph);
233   
234   assert(pRun);
235   assert(pRun->type == diRun);
236   assert(pRun->member.run.nFlags & MERF_ENDPARA);
237   assert(pFirstRunInNext->type == diRun);
238   
239   /* if some cursor points at end of paragraph, make it point to the first
240      run of the next joined paragraph */
241   for (i=0; i<editor->nCursors; i++) {
242     if (editor->pCursors[i].pRun == pRun) {
243       editor->pCursors[i].pRun = pFirstRunInNext;
244       editor->pCursors[i].nOffset = 0;
245     }
246   }
247
248   pTmp = pNext;
249   do {
250     pTmp = ME_FindItemFwd(pTmp, diRunOrParagraphOrEnd);
251     if (pTmp->type != diRun)
252       break;
253     TRACE("shifting \"%s\" by %d (previous %d)\n", debugstr_w(pTmp->member.run.strText->szData), shift, pTmp->member.run.nCharOfs);
254     pTmp->member.run.nCharOfs += shift;
255   } while(1);
256   
257   ME_Remove(pRun);
258   ME_DestroyDisplayItem(pRun);
259
260   if (editor->pLastSelStartPara == pNext)
261     editor->pLastSelStartPara = tp;
262   if (editor->pLastSelEndPara == pNext)
263     editor->pLastSelEndPara = tp;
264     
265   tp->member.para.next_para = pNext->member.para.next_para;
266   pNext->member.para.next_para->member.para.prev_para = tp;
267   ME_Remove(pNext);
268   ME_DestroyDisplayItem(pNext);
269
270   ME_PropagateCharOffset(tp->member.para.next_para, -end_len);
271   
272   ME_CheckCharOffsets(editor);
273   
274   editor->nParagraphs--;
275   tp->member.para.nFlags |= MEPF_REWRAP;
276   return tp;
277 }
278
279 ME_DisplayItem *ME_GetParagraph(ME_DisplayItem *item) {
280   return ME_FindItemBackOrHere(item, diParagraph);
281 }
282
283 void ME_DumpParaStyleToBuf(const PARAFORMAT2 *pFmt, char buf[2048])
284 {
285   char *p;
286   p = buf;
287
288 #define DUMP(mask, name, fmt, field) \
289   if (pFmt->dwMask & (mask)) p += sprintf(p, "%-22s" fmt "\n", name, pFmt->field); \
290   else p += sprintf(p, "%-22sN/A\n", name);
291
292 /* we take for granted that PFE_xxx is the hiword of the corresponding PFM_xxx */
293 #define DUMP_EFFECT(mask, name) \
294   p += sprintf(p, "%-22s%s\n", name, (pFmt->dwMask & (mask)) ? ((pFmt->wEffects & ((mask) >> 8)) ? "yes" : "no") : "N/A");
295
296   DUMP(PFM_NUMBERING,      "Numbering:",         "%u", wNumbering);
297   DUMP_EFFECT(PFM_DONOTHYPHEN,     "Disable auto-hyphen:");
298   DUMP_EFFECT(PFM_KEEP,            "No page break in para:");
299   DUMP_EFFECT(PFM_KEEPNEXT,        "No page break in para & next:");
300   DUMP_EFFECT(PFM_NOLINENUMBER,    "No line number:");
301   DUMP_EFFECT(PFM_NOWIDOWCONTROL,  "No widow & orphan:");
302   DUMP_EFFECT(PFM_PAGEBREAKBEFORE, "Page break before:");
303   DUMP_EFFECT(PFM_RTLPARA,         "RTL para:");
304   DUMP_EFFECT(PFM_SIDEBYSIDE,      "Side by side:");
305   DUMP_EFFECT(PFM_TABLE,           "Table:");
306   DUMP(PFM_OFFSETINDENT,   "Offset indent:",     "%d", dxStartIndent);
307   DUMP(PFM_STARTINDENT,    "Start indent:",      "%d", dxStartIndent);
308   DUMP(PFM_RIGHTINDENT,    "Right indent:",      "%d", dxRightIndent);
309   DUMP(PFM_OFFSET,         "Offset:",            "%d", dxOffset);
310   if (pFmt->dwMask & PFM_ALIGNMENT) {
311     switch (pFmt->wAlignment) {
312     case PFA_LEFT   : p += sprintf(p, "Alignment:            left\n"); break;
313     case PFA_RIGHT  : p += sprintf(p, "Alignment:            right\n"); break;
314     case PFA_CENTER : p += sprintf(p, "Alignment:            center\n"); break;
315     case PFA_JUSTIFY: p += sprintf(p, "Alignment:            justify\n"); break;
316     default         : p += sprintf(p, "Alignment:            incorrect %d\n", pFmt->wAlignment); break;
317     }
318   }
319   else p += sprintf(p, "Alignment:            N/A\n");
320   DUMP(PFM_TABSTOPS,       "Tab Stops:",         "%d", cTabCount);
321   if (pFmt->dwMask & PFM_TABSTOPS) {
322     int i;
323     p += sprintf(p, "\t");
324     for (i = 0; i < pFmt->cTabCount; i++) p += sprintf(p, "%x ", pFmt->rgxTabs[i]);
325     p += sprintf(p, "\n");
326   }
327   DUMP(PFM_SPACEBEFORE,    "Space Before:",      "%d", dySpaceBefore);
328   DUMP(PFM_SPACEAFTER,     "Space After:",       "%d", dySpaceAfter);
329   DUMP(PFM_LINESPACING,    "Line spacing:",      "%d", dyLineSpacing);
330   DUMP(PFM_STYLE,          "Text style:",        "%d", sStyle);
331   DUMP(PFM_LINESPACING,    "Line spacing rule:", "%u", bLineSpacingRule);
332   /* bOutlineLevel should be 0 */
333   DUMP(PFM_SHADING,        "Shading Weigth:",    "%u", wShadingWeight);
334   DUMP(PFM_SHADING,        "Shading Style:",     "%u", wShadingStyle);
335   DUMP(PFM_NUMBERINGSTART, "Numbering Start:",   "%u", wNumberingStart);
336   DUMP(PFM_NUMBERINGSTYLE, "Numbering Style:",   "0x%x", wNumberingStyle);
337   DUMP(PFM_NUMBERINGTAB,   "Numbering Tab:",     "%u", wNumberingStyle);
338   DUMP(PFM_BORDER,         "Border Space:",      "%u", wBorderSpace);
339   DUMP(PFM_BORDER,         "Border Width:",      "%u", wBorderWidth);
340   DUMP(PFM_BORDER,         "Borders:",           "%u", wBorders);
341
342 #undef DUMP
343 #undef DUMP_EFFECT
344 }
345
346 void ME_SetParaFormat(ME_TextEditor *editor, ME_DisplayItem *para, const PARAFORMAT2 *pFmt)
347 {
348   PARAFORMAT2 copy;
349   assert(sizeof(*para->member.para.pFmt) == sizeof(PARAFORMAT2));
350   ME_AddUndoItem(editor, diUndoSetParagraphFormat, para);
351   
352   copy = *para->member.para.pFmt;
353
354 #define COPY_FIELD(m, f) \
355   if (pFmt->dwMask & (m)) {                     \
356     para->member.para.pFmt->dwMask |= m;        \
357     para->member.para.pFmt->f = pFmt->f;        \
358   }
359
360   COPY_FIELD(PFM_NUMBERING, wNumbering);
361 #define EFFECTS_MASK (PFM_RTLPARA|PFM_KEEP|PFM_KEEPNEXT|PFM_PAGEBREAKBEFORE| \
362                       PFM_NOLINENUMBER|PFM_NOWIDOWCONTROL|PFM_DONOTHYPHEN|PFM_SIDEBYSIDE| \
363                       PFM_TABLE)
364   /* we take for granted that PFE_xxx is the hiword of the corresponding PFM_xxx */
365   if (pFmt->dwMask & EFFECTS_MASK) {
366     para->member.para.pFmt->dwMask &= ~(pFmt->dwMask & EFFECTS_MASK);
367     para->member.para.pFmt->wEffects |= pFmt->wEffects & HIWORD(pFmt->dwMask);
368   }
369 #undef EFFECTS_MASK
370
371   COPY_FIELD(PFM_STARTINDENT, dxStartIndent);
372   if (pFmt->dwMask & PFM_OFFSETINDENT)
373     para->member.para.pFmt->dxStartIndent += pFmt->dxStartIndent;
374   COPY_FIELD(PFM_RIGHTINDENT, dxRightIndent);
375   COPY_FIELD(PFM_OFFSET, dxOffset);
376   COPY_FIELD(PFM_ALIGNMENT, wAlignment);
377
378   if (pFmt->dwMask & PFM_TABSTOPS)
379   {
380     para->member.para.pFmt->cTabCount = pFmt->cTabCount;
381     memcpy(para->member.para.pFmt->rgxTabs, pFmt->rgxTabs, pFmt->cTabCount*sizeof(LONG));
382   }
383   COPY_FIELD(PFM_SPACEBEFORE, dySpaceBefore);
384   COPY_FIELD(PFM_SPACEAFTER, dySpaceAfter);
385   COPY_FIELD(PFM_LINESPACING, dyLineSpacing);
386   COPY_FIELD(PFM_STYLE, sStyle);
387   COPY_FIELD(PFM_LINESPACING, bLineSpacingRule);
388   COPY_FIELD(PFM_SHADING, wShadingWeight);
389   COPY_FIELD(PFM_SHADING, wShadingStyle);
390   COPY_FIELD(PFM_NUMBERINGSTART, wNumberingStart);
391   COPY_FIELD(PFM_NUMBERINGSTYLE, wNumberingStyle);
392   COPY_FIELD(PFM_NUMBERINGTAB, wNumberingTab);
393   COPY_FIELD(PFM_BORDER, wBorderSpace);
394   COPY_FIELD(PFM_BORDER, wBorderWidth);
395   COPY_FIELD(PFM_BORDER, wBorders);
396
397   para->member.para.pFmt->dwMask |= pFmt->dwMask;
398 #undef COPY_FIELD
399
400   if (memcmp(&copy, para->member.para.pFmt, sizeof(PARAFORMAT2)))
401     para->member.para.nFlags |= MEPF_REWRAP;
402 }
403
404
405 void
406 ME_GetSelectionParas(ME_TextEditor *editor, ME_DisplayItem **para, ME_DisplayItem **para_end)
407 {
408   ME_Cursor *pEndCursor = &editor->pCursors[1];
409   
410   *para = ME_GetParagraph(editor->pCursors[0].pRun);
411   *para_end = ME_GetParagraph(editor->pCursors[1].pRun);
412   if ((*para_end)->member.para.nCharOfs < (*para)->member.para.nCharOfs) {
413     ME_DisplayItem *tmp = *para;
414
415     *para = *para_end;
416     *para_end = tmp;
417     pEndCursor = &editor->pCursors[0];
418   }
419   
420   /* selection consists of chars from nFrom up to nTo-1 */
421   if ((*para_end)->member.para.nCharOfs > (*para)->member.para.nCharOfs) {
422     if (!pEndCursor->nOffset) {
423       *para_end = ME_GetParagraph(ME_FindItemBack(pEndCursor->pRun, diRun));
424     }
425   }
426 }
427
428
429 void ME_SetSelectionParaFormat(ME_TextEditor *editor, const PARAFORMAT2 *pFmt)
430 {
431   ME_DisplayItem *para, *para_end;
432   
433   ME_GetSelectionParas(editor, &para, &para_end);
434  
435   do {
436     ME_SetParaFormat(editor, para, pFmt);
437     if (para == para_end)
438       break;
439     para = para->member.para.next_para;
440   } while(1);
441 }
442
443 void ME_GetParaFormat(ME_TextEditor *editor, const ME_DisplayItem *para, PARAFORMAT2 *pFmt)
444 {
445   if (pFmt->cbSize >= sizeof(PARAFORMAT2))
446   {
447     *pFmt = *para->member.para.pFmt;
448     return;
449   }
450   CopyMemory(pFmt, para->member.para.pFmt, pFmt->cbSize);  
451 }
452
453 void ME_GetSelectionParaFormat(ME_TextEditor *editor, PARAFORMAT2 *pFmt)
454 {
455   ME_DisplayItem *para, *para_end;
456   PARAFORMAT2 tmp;
457   
458   ME_GetSelectionParas(editor, &para, &para_end);
459   
460   ME_GetParaFormat(editor, para, pFmt);
461   if (para == para_end) return;
462   
463   do {
464     ZeroMemory(&tmp, sizeof(tmp));
465     tmp.cbSize = sizeof(tmp);
466     ME_GetParaFormat(editor, para, &tmp);
467
468 #define CHECK_FIELD(m, f) \
469     if (pFmt->f != tmp.f) pFmt->dwMask &= ~(m);
470
471     CHECK_FIELD(PFM_NUMBERING, wNumbering);
472     /* para->member.para.pFmt->wEffects = pFmt->wEffects; */
473     assert(tmp.dwMask & PFM_ALIGNMENT);
474     CHECK_FIELD(PFM_NUMBERING, wNumbering);
475     assert(tmp.dwMask & PFM_STARTINDENT);
476     CHECK_FIELD(PFM_STARTINDENT, dxStartIndent);
477     assert(tmp.dwMask & PFM_RIGHTINDENT);
478     CHECK_FIELD(PFM_RIGHTINDENT, dxRightIndent);
479     assert(tmp.dwMask & PFM_OFFSET);
480     CHECK_FIELD(PFM_OFFSET, dxOffset);
481     CHECK_FIELD(PFM_ALIGNMENT, wAlignment);
482
483     assert(tmp.dwMask & PFM_TABSTOPS);
484     if (pFmt->dwMask & PFM_TABSTOPS) {
485       if (pFmt->cTabCount != tmp.cTabCount ||
486           memcmp(pFmt->rgxTabs, tmp.rgxTabs, tmp.cTabCount*sizeof(int)))
487         pFmt->dwMask &= ~PFM_TABSTOPS;
488     }
489
490     CHECK_FIELD(PFM_SPACEBEFORE, dySpaceBefore);
491     CHECK_FIELD(PFM_SPACEAFTER, dySpaceAfter);
492     CHECK_FIELD(PFM_LINESPACING, dyLineSpacing);
493     CHECK_FIELD(PFM_STYLE, sStyle);
494     CHECK_FIELD(PFM_SPACEAFTER, bLineSpacingRule);
495     CHECK_FIELD(PFM_SHADING, wShadingWeight);
496     CHECK_FIELD(PFM_SHADING, wShadingStyle);
497     CHECK_FIELD(PFM_NUMBERINGSTART, wNumberingStart);
498     CHECK_FIELD(PFM_NUMBERINGSTYLE, wNumberingStyle);
499     CHECK_FIELD(PFM_NUMBERINGTAB, wNumberingTab);
500     CHECK_FIELD(PFM_BORDER, wBorderSpace);
501     CHECK_FIELD(PFM_BORDER, wBorderWidth);
502     CHECK_FIELD(PFM_BORDER, wBorders);
503
504 #undef CHECK_FIELD
505
506     if (para == para_end)
507       return;
508     para = para->member.para.next_para;
509   } while(1);
510 }