ReactOS 0.4.16-dev-1369-gd4d04c8
para.c
Go to the documentation of this file.
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
25
27{
28 para->nFlags |= MEPF_REWRAP;
29 para_mark_add( editor, para );
30}
31
33{
35
36 editor_set_default_para_fmt( editor, &item->member.para.fmt );
37 item->member.para.nFlags = MEPF_REWRAP;
38
39 return &item->member.para;
40}
41
43{
44 if (para->nWidth == editor->nTotalWidth)
45 {
46 para->nWidth = 0;
47 editor->nTotalWidth = get_total_width(editor);
48 }
49 editor->total_rows -= para->nRows;
50 ME_DestroyString( para->text );
51 para_num_clear( &para->para_num );
52 para_mark_remove( editor, para );
54}
55
56/* Note para_next/prev will return the start and end doc nodes */
58{
59 if (para->next_para) return &para->next_para->member.para;
60 return NULL;
61}
62
64{
65 if (para->prev_para && para->prev_para->type == diParagraph) return &para->prev_para->member.para;
66 return NULL;
67}
68
70{
71 ME_Paragraph *para;
72 int total_width = 0;
73
74 if (editor->pBuffer->pFirst && editor->pBuffer->pLast)
75 {
76 para = &editor->pBuffer->pFirst->next->member.para;
77 while (para != &editor->pBuffer->pLast->member.para && para->next_para)
78 {
79 total_width = max(total_width, para->nWidth);
80 para = &para->next_para->member.para;
81 }
82 }
83
84 return total_width;
85}
86
87static int para_mark_compare( const void *key, const struct wine_rb_entry *entry )
88{
89 ME_Paragraph *para = WINE_RB_ENTRY_VALUE( entry, ME_Paragraph, marked_entry );
90
91 return *(int *)key - para->nCharOfs;
92}
93
95{
96 wine_rb_remove_key( &editor->marked_paras, &para->nCharOfs );
97}
98
100{
101 wine_rb_put( &editor->marked_paras, &para->nCharOfs, &para->marked_entry );
102}
103
105{
106 ME_DisplayItem *di;
107
108 for (di = para_get_di( para ); di != para->next_para; di = di->next )
109 {
110 if (di->type != diRun) continue;
111 return &di->member.run;
112 }
113 ERR( "failed to find run in paragraph\n" );
114 return NULL;
115}
116
118{
119 return para->eop_run;
120}
121
123{
124 return para->fmt.wEffects & PFE_TABLE;
125}
126
128{
129 return para->cell;
130}
131
133{
135
137 if (!item || item->type != diStartRow) return NULL;
138 return &item->member.row;
139}
140
142{
144
145 para = para_next( para );
147 if (!item || item->type != diStartRow) return NULL;
148 return &item->member.row;
149}
150
152{
155 const CHARFORMATW *host_cf;
156 LOGFONTW lf;
157 HFONT hf;
158 ME_TextBuffer *text = editor->pBuffer;
159 ME_Paragraph *para = para_create( editor );
160 ME_Run *run;
162 int eol_len;
163
164 ME_InitContext( &c, editor, hdc );
165
167 assert(hf);
168 GetObjectW(hf, sizeof(LOGFONTW), &lf);
169 ZeroMemory(&cf, sizeof(cf));
170 cf.cbSize = sizeof(cf);
177
178 cf.dwEffects = CFE_AUTOCOLOR | CFE_AUTOBACKCOLOR;
179 lstrcpyW(cf.szFaceName, lf.lfFaceName);
180 /* Convert system font height from logical units to twips for cf.yHeight */
181 cf.yHeight = (lf.lfHeight * 72 * 1440) / (c.dpi.cy * c.dpi.cy);
182 if (lf.lfWeight > FW_NORMAL) cf.dwEffects |= CFE_BOLD;
183 cf.wWeight = lf.lfWeight;
184 if (lf.lfItalic) cf.dwEffects |= CFE_ITALIC;
185 if (lf.lfUnderline) cf.dwEffects |= CFE_UNDERLINE;
186 cf.bUnderlineType = CFU_UNDERLINE;
187 if (lf.lfStrikeOut) cf.dwEffects |= CFE_STRIKEOUT;
188 cf.bPitchAndFamily = lf.lfPitchAndFamily;
189 cf.bCharSet = lf.lfCharSet;
190 cf.lcid = GetSystemDefaultLCID();
191
193 text->pDefaultStyle = style;
194
195 if (ITextHost_TxGetCharFormat(editor->texthost, &host_cf) == S_OK)
196 {
197 ZeroMemory(&cf, sizeof(cf));
198 cf.cbSize = sizeof(cf);
199 cfany_to_cf2w(&cf, (CHARFORMAT2W *)host_cf);
200 ME_SetDefaultCharFormat(editor, &cf);
201 }
202
203 eol_len = editor->bEmulateVersion10 ? 2 : 1;
204 para->text = ME_MakeStringN( L"\r\n", eol_len );
205
206 run = run_create( style, MERF_ENDPARA );
207 run->nCharOfs = 0;
208 run->len = eol_len;
209 run->para = para;
210 para->eop_run = run;
211
212 ME_InsertBefore( text->pLast, para_get_di( para) );
213 ME_InsertBefore( text->pLast, run_get_di( run ) );
214 para->prev_para = text->pFirst;
215 para->next_para = text->pLast;
216 text->pFirst->member.para.next_para = para_get_di( para );
217 text->pLast->member.para.prev_para = para_get_di( para );
218
219 text->pLast->member.para.nCharOfs = editor->bEmulateVersion10 ? 2 : 1;
220
222 para_mark_add( editor, para );
224}
225
227{
228 while (first != end)
229 {
230 para_mark_rewrap( editor, first );
231 first = para_next( first );
232 }
233}
234
236{
237 para_mark_rewrap_paras( editor, editor_first_para( editor ), editor_end_para( editor ) );
238}
239
241{
243
244 if (para_cell( para )) para->nFlags |= MEPF_CELL;
245 else para->nFlags &= ~MEPF_CELL;
246
248 else para->fmt.wEffects &= ~PFE_TABLEROWDELIMITER;
249
250 if (para->nFlags & (MEPF_ROWSTART | MEPF_CELL | MEPF_ROWEND))
251 para->fmt.wEffects |= PFE_TABLE;
252 else
253 para->fmt.wEffects &= ~PFE_TABLE;
254}
255
257{
258 return item->wNumbering == base->wNumbering &&
259 item->wNumberingStart == base->wNumberingStart &&
260 item->wNumberingStyle == base->wNumberingStyle &&
261 !(item->wNumberingStyle & PFNS_NEWNUMBER);
262}
263
265{
266 ME_DisplayItem *prev;
267 int num = para->fmt.wNumberingStart;
268
269 for (prev = para->prev_para; prev->type == diParagraph;
270 para = &prev->member.para, prev = prev->member.para.prev_para, num++)
271 {
272 if (!para_num_same_list( &prev->member.para.fmt, &para->fmt )) break;
273 }
274 return num;
275}
276
278{
279 /* max 4 Roman letters (representing '8') / decade + '(' + ')' */
280 ME_String *str = ME_MakeStringEmpty( 20 + 2 );
281 WCHAR *p;
282 static const WORD letter_base[] = { 1, 26, 26 * 26, 26 * 26 * 26 };
283 /* roman_base should start on a '5' not a '1', otherwise the 'total' code will need adjusting.
284 'N' and 'O' are what MS uses for 5000 and 10000, their version doesn't work well above 30000,
285 but we'll use 'P' as the obvious extension, this gets us up to 2^16, which is all we care about. */
286 static const struct
287 {
288 int base;
289 char letter;
290 }
291 roman_base[] =
292 {
293 {50000, 'P'}, {10000, 'O'}, {5000, 'N'}, {1000, 'M'},
294 {500, 'D'}, {100, 'C'}, {50, 'L'}, {10, 'X'}, {5, 'V'}, {1, 'I'}
295 };
296 int i, len;
297 WORD letter, total, char_offset = 0;
298
299 if (!str) return NULL;
300
301 p = str->szData;
302
303 if ((para->fmt.wNumberingStyle & 0xf00) == PFNS_PARENS)
304 *p++ = '(';
305
306 switch (para->fmt.wNumbering)
307 {
308 case PFN_ARABIC:
309 default:
310 p += swprintf( p, 20, L"%d", num );
311 break;
312
313 case PFN_LCLETTER:
314 char_offset = 'a' - 'A';
315 /* fall through */
316 case PFN_UCLETTER:
317 if (!num) num = 1;
318
319 /* This is not base-26 (or 27) as zeros don't count unless they are leading zeros.
320 It's simplest to start with the least significant letter, so first calculate how many letters are needed. */
321 for (i = 0, total = 0; i < ARRAY_SIZE( letter_base ); i++)
322 {
323 total += letter_base[i];
324 if (num < total) break;
325 }
326 len = i;
327 for (i = 0; i < len; i++)
328 {
329 num -= letter_base[i];
330 letter = (num / letter_base[i]) % 26;
331 p[len - i - 1] = letter + 'A' + char_offset;
332 }
333 p += len;
334 *p = 0;
335 break;
336
337 case PFN_LCROMAN:
338 char_offset = 'a' - 'A';
339 /* fall through */
340 case PFN_UCROMAN:
341 if (!num) num = 1;
342
343 for (i = 0; i < ARRAY_SIZE( roman_base ); i++)
344 {
345 if (i > 0)
346 {
347 if (i % 2 == 0) /* eg 5000, check for 9000 */
348 total = roman_base[i].base + 4 * roman_base[i + 1].base;
349 else /* eg 1000, check for 4000 */
350 total = 4 * roman_base[i].base;
351
352 if (num / total)
353 {
354 *p++ = roman_base[(i & ~1) + 1].letter + char_offset;
355 *p++ = roman_base[i - 1].letter + char_offset;
356 num -= total;
357 continue;
358 }
359 }
360
361 len = num / roman_base[i].base;
362 while (len--)
363 {
364 *p++ = roman_base[i].letter + char_offset;
365 num -= roman_base[i].base;
366 }
367 }
368 *p = 0;
369 break;
370 }
371
372 switch (para->fmt.wNumberingStyle & 0xf00)
373 {
374 case PFNS_PARENS:
375 case PFNS_PAREN:
376 *p++ = ')';
377 *p = 0;
378 break;
379
380 case PFNS_PERIOD:
381 *p++ = '.';
382 *p = 0;
383 break;
384 }
385
386 str->nLen = p - str->szData;
387 return str;
388}
389
391{
394 SIZE sz;
395
396 if (!para->fmt.wNumbering) return;
397 if (para->para_num.style && para->para_num.text) return;
398
399 if (!para->para_num.style)
400 {
401 style = para->eop_run->style;
402
403 if (para->fmt.wNumbering == PFN_BULLET)
404 {
405 cf.cbSize = sizeof(cf);
406 cf.dwMask = CFM_FACE | CFM_CHARSET;
407 lstrcpyW( cf.szFaceName, L"Symbol" );
408 cf.bCharSet = SYMBOL_CHARSET;
409 style = ME_ApplyStyle( c->editor, style, &cf );
410 }
411 else
412 {
414 }
415
416 para->para_num.style = style;
417 }
418
419 if (!para->para_num.text)
420 {
421 if (para->fmt.wNumbering != PFN_BULLET)
422 para->para_num.text = para_num_get_str( para, para_num_get_num( para ) );
423 else
424 para->para_num.text = ME_MakeStringConst( L"\x00b7", 1 );
425 }
426
427 select_style( c, para->para_num.style );
428 GetTextExtentPointW( c->hDC, para->para_num.text->szData, para->para_num.text->nLen, &sz );
429 para->para_num.width = sz.cx;
430 GetTextExtentPointW( c->hDC, L" ", 1, &sz );
431 para->para_num.width += sz.cx;
432}
433
435{
436 if (pn->style)
437 {
438 ME_ReleaseStyle( pn->style );
439 pn->style = NULL;
440 }
441 ME_DestroyString( pn->text );
442 pn->text = NULL;
443}
444
445static void para_num_clear_list( ME_TextEditor *editor, ME_Paragraph *para, const PARAFORMAT2 *orig_fmt )
446{
447 do
448 {
449 para_mark_rewrap( editor, para );
450 para_num_clear( &para->para_num );
451 if (para->next_para->type != diParagraph) break;
452 para = &para->next_para->member.para;
453 } while (para_num_same_list( &para->fmt, orig_fmt ));
454}
455
456static BOOL para_set_fmt( ME_TextEditor *editor, ME_Paragraph *para, const PARAFORMAT2 *pFmt )
457{
459 DWORD dwMask;
460
461 assert(para->fmt.cbSize == sizeof(PARAFORMAT2));
462 dwMask = pFmt->dwMask;
463 if (pFmt->cbSize < sizeof(PARAFORMAT))
464 return FALSE;
465 else if (pFmt->cbSize < sizeof(PARAFORMAT2))
466 dwMask &= PFM_ALL;
467 else
468 dwMask &= PFM_ALL2;
469
470 add_undo_set_para_fmt( editor, para );
471
472 copy = para->fmt;
473
474#define COPY_FIELD(m, f) \
475 if (dwMask & (m)) { \
476 para->fmt.dwMask |= m; \
477 para->fmt.f = pFmt->f; \
478 }
479
480 COPY_FIELD(PFM_NUMBERING, wNumbering);
481 COPY_FIELD(PFM_STARTINDENT, dxStartIndent);
482 if (dwMask & PFM_OFFSETINDENT)
483 para->fmt.dxStartIndent += pFmt->dxStartIndent;
484 COPY_FIELD(PFM_RIGHTINDENT, dxRightIndent);
485 COPY_FIELD(PFM_OFFSET, dxOffset);
486 COPY_FIELD(PFM_ALIGNMENT, wAlignment);
487 if (dwMask & PFM_TABSTOPS)
488 {
489 /* Clamp between 0 and MAX_TAB_STOPS */
490 para->fmt.cTabCount = max(0, min(pFmt->cTabCount, MAX_TAB_STOPS));
491 memcpy(para->fmt.rgxTabs, pFmt->rgxTabs, para->fmt.cTabCount * sizeof(LONG));
492 }
493
494#define EFFECTS_MASK (PFM_RTLPARA|PFM_KEEP|PFM_KEEPNEXT|PFM_PAGEBREAKBEFORE| \
495 PFM_NOLINENUMBER|PFM_NOWIDOWCONTROL|PFM_DONOTHYPHEN|PFM_SIDEBYSIDE| \
496 PFM_TABLE)
497 /* we take for granted that PFE_xxx is the hiword of the corresponding PFM_xxx */
498 if (dwMask & EFFECTS_MASK)
499 {
500 para->fmt.dwMask |= dwMask & EFFECTS_MASK;
501 para->fmt.wEffects &= ~HIWORD(dwMask);
502 para->fmt.wEffects |= pFmt->wEffects & HIWORD(dwMask);
503 }
504#undef EFFECTS_MASK
505
506 COPY_FIELD(PFM_SPACEBEFORE, dySpaceBefore);
507 COPY_FIELD(PFM_SPACEAFTER, dySpaceAfter);
508 COPY_FIELD(PFM_LINESPACING, dyLineSpacing);
509 COPY_FIELD(PFM_STYLE, sStyle);
510 COPY_FIELD(PFM_LINESPACING, bLineSpacingRule);
511 COPY_FIELD(PFM_SHADING, wShadingWeight);
512 COPY_FIELD(PFM_SHADING, wShadingStyle);
513 COPY_FIELD(PFM_NUMBERINGSTART, wNumberingStart);
514 COPY_FIELD(PFM_NUMBERINGSTYLE, wNumberingStyle);
515 COPY_FIELD(PFM_NUMBERINGTAB, wNumberingTab);
516 COPY_FIELD(PFM_BORDER, wBorderSpace);
517 COPY_FIELD(PFM_BORDER, wBorderWidth);
518 COPY_FIELD(PFM_BORDER, wBorders);
519
520 para->fmt.dwMask |= dwMask;
521#undef COPY_FIELD
522
523 if (memcmp(&copy, &para->fmt, sizeof(PARAFORMAT2)))
524 {
525 para_mark_rewrap( editor, para );
526 if (((dwMask & PFM_NUMBERING) && (copy.wNumbering != para->fmt.wNumbering)) ||
527 ((dwMask & PFM_NUMBERINGSTART) && (copy.wNumberingStart != para->fmt.wNumberingStart)) ||
528 ((dwMask & PFM_NUMBERINGSTYLE) && (copy.wNumberingStyle != para->fmt.wNumberingStyle)))
529 {
530 para_num_clear_list( editor, para, &copy );
531 }
532 }
533
534 return TRUE;
535}
536
537/* split paragraph at the beginning of the run */
539 const WCHAR *eol_str, int eol_len, int paraFlags )
540{
541 ME_Paragraph *new_para = para_create( editor ), *old_para, *next_para;
542 ME_Run *end_run, *next_run;
543 int ofs, i;
544 int run_flags = MERF_ENDPARA;
545
546 if (!editor->bEmulateVersion10) /* v4.1 */
547 {
548 /* At most 1 of MEPF_CELL, MEPF_ROWSTART, or MEPF_ROWEND should be set. */
549 assert( !(paraFlags & ~(MEPF_CELL | MEPF_ROWSTART | MEPF_ROWEND)) );
550 assert( !(paraFlags & (paraFlags-1)) );
551 if (paraFlags == MEPF_CELL)
552 run_flags |= MERF_ENDCELL;
553 else if (paraFlags == MEPF_ROWSTART)
554 run_flags |= MERF_TABLESTART | MERF_HIDDEN;
555 }
556 else /* v1.0 - v3.0 */
557 assert( !(paraFlags & (MEPF_CELL |MEPF_ROWSTART | MEPF_ROWEND)) );
558
559 old_para = run->para;
560 assert( old_para->fmt.cbSize == sizeof(PARAFORMAT2) );
561
562 /* Clear any cached para numbering following this paragraph */
563 if (old_para->fmt.wNumbering)
564 para_num_clear_list( editor, old_para, &old_para->fmt );
565
566 new_para->text = ME_VSplitString( old_para->text, run->nCharOfs );
567
568 end_run = run_create( style, run_flags );
569 ofs = end_run->nCharOfs = run->nCharOfs;
570 end_run->len = eol_len;
571 end_run->para = run->para;
572 ME_AppendString( old_para->text, eol_str, eol_len );
573 next_para = &old_para->next_para->member.para;
574
575 add_undo_join_paras( editor, old_para->nCharOfs + ofs );
576
577 /* Update selection cursors to point to the correct paragraph. */
578 for (i = 0; i < editor->nCursors; i++)
579 {
580 if (editor->pCursors[i].para == old_para &&
581 run->nCharOfs <= editor->pCursors[i].run->nCharOfs)
582 {
583 editor->pCursors[i].para = new_para;
584 }
585 }
586
587 /* the new paragraph will have a different starting offset, so update its runs */
588 for (next_run = run; next_run; next_run = run_next( next_run ))
589 {
590 next_run->nCharOfs -= ofs;
591 next_run->para = new_para;
592 }
593
594 new_para->nCharOfs = old_para->nCharOfs + ofs;
595 new_para->nCharOfs += eol_len;
596 new_para->nFlags = 0;
597 para_mark_rewrap( editor, new_para );
598
599 /* FIXME initialize format style and call ME_SetParaFormat blah blah */
600 new_para->fmt = old_para->fmt;
601 new_para->border = old_para->border;
602
603 /* insert paragraph into paragraph double linked list */
604 new_para->prev_para = para_get_di( old_para );
605 new_para->next_para = para_get_di( next_para );
606 old_para->next_para = para_get_di( new_para );
607 next_para->prev_para = para_get_di( new_para );
608
609 /* insert end run of the old paragraph, and new paragraph, into DI double linked list */
610 ME_InsertBefore( run_get_di( run ), para_get_di( new_para ) );
611 ME_InsertBefore( para_get_di( new_para ), run_get_di( end_run ) );
612
613 /* Fix up the paras' eop_run ptrs */
614 new_para->eop_run = old_para->eop_run;
615 old_para->eop_run = end_run;
616
617 if (!editor->bEmulateVersion10) /* v4.1 */
618 {
619 if (paraFlags & (MEPF_ROWSTART | MEPF_CELL))
620 {
621 ME_Cell *cell = cell_create();
622 ME_InsertBefore( para_get_di( new_para ), cell_get_di( cell ) );
623 new_para->cell = cell;
624 cell->next_cell = NULL;
625 if (paraFlags & MEPF_ROWSTART)
626 {
627 old_para->nFlags |= MEPF_ROWSTART;
628 cell->prev_cell = NULL;
629 cell->parent_cell = old_para->cell;
630 if (para_cell( old_para ))
631 cell->nNestingLevel = para_cell( old_para )->nNestingLevel + 1;
632 else
633 cell->nNestingLevel = 1;
634 }
635 else
636 {
637 cell->prev_cell = old_para->cell;
638 cell_prev( cell )->next_cell = cell;
639 assert( old_para->nFlags & MEPF_CELL );
640 assert( !(old_para->nFlags & MEPF_ROWSTART) );
641 cell->nNestingLevel = cell_prev( cell )->nNestingLevel;
642 cell->parent_cell = cell_prev( cell )->parent_cell;
643 }
644 }
645 else if (paraFlags & MEPF_ROWEND)
646 {
647 old_para->nFlags |= MEPF_ROWEND;
648 old_para->cell = old_para->cell->parent_cell;
649 new_para->cell = old_para->cell;
650 assert( para_prev( old_para )->nFlags & MEPF_CELL );
651 assert( !(para_prev( old_para )->nFlags & MEPF_ROWSTART) );
652 if (new_para->cell != para_next( new_para )->cell
653 && para_next( new_para )->cell
654 && !cell_prev( para_next( new_para )->cell ))
655 {
656 /* Row starts just after the row that was ended. */
657 new_para->nFlags |= MEPF_ROWSTART;
658 }
659 }
660 else new_para->cell = old_para->cell;
661
662 table_update_flags( old_para );
663 table_update_flags( new_para );
664 }
665
666 /* force rewrap of the */
667 if (old_para->prev_para->type == diParagraph)
668 para_mark_rewrap( editor, &old_para->prev_para->member.para );
669
670 para_mark_rewrap( editor, &new_para->prev_para->member.para );
671
672 /* we've added the end run, so we need to modify nCharOfs in the next paragraphs */
673 editor_propagate_char_ofs( editor, next_para, NULL, eol_len );
674 editor->nParagraphs++;
675
676 return new_para;
677}
678
679/* join para with the next para keeping para's style using the paragraph fmt
680 specified in use_first_fmt */
681ME_Paragraph *para_join( ME_TextEditor *editor, ME_Paragraph *para, BOOL use_first_fmt )
682{
683 ME_Paragraph *next = para_next( para );
684 ME_Run *end_run, *next_first_run, *tmp_run;
685 ME_Cell *cell = NULL;
686 int i, end_len;
688 ME_Cursor startCur, endCur;
689 ME_String *eol_str;
690
691 assert( next && para_next( next ) );
692
693 /* Clear any cached para numbering following this paragraph */
694 if (para->fmt.wNumbering) para_num_clear_list( editor, para, &para->fmt );
695
696 end_run = para_end_run( para );
697 next_first_run = para_first_run( next );
698
699 end_len = end_run->len;
700 eol_str = ME_VSplitString( para->text, end_run->nCharOfs );
701 ME_AppendString( para->text, next->text->szData, next->text->nLen );
702
703 /* null char format operation to store the original char format for the ENDPARA run */
705 startCur.para = para;
706 startCur.run = end_run;
707 endCur.para = next;
708 endCur.run = next_first_run;
709 startCur.nOffset = endCur.nOffset = 0;
710
711 ME_SetCharFormat(editor, &startCur, &endCur, &fmt);
712
713 if (!editor->bEmulateVersion10) /* v4.1 */
714 {
715 /* Remove cell boundary if it is between the end paragraph run and the next
716 * paragraph display item. */
717 if (para->cell != next->cell) cell = next->cell;
718
719 /* Table cell/row properties are always moved over from the removed para. */
720 para->nFlags = next->nFlags;
721 para->cell = next->cell;
722 }
723
724 add_undo_split_para( editor, next, eol_str, cell );
725
726 if (cell)
727 {
728 ME_Remove( cell_get_di( cell ) );
729 if (cell_prev( cell )) cell_prev( cell )->next_cell = cell_next( cell );
730 if (cell_next( cell )) cell_next( cell )->prev_cell = cell_prev( cell );
732 }
733
734 if (!use_first_fmt)
735 {
736 add_undo_set_para_fmt( editor, para );
737 para->fmt = next->fmt;
738 para->border = next->border;
739 }
740
741 /* Update selection cursors so they don't point to the removed end
742 * paragraph run, and point to the correct paragraph. */
743 for (i = 0; i < editor->nCursors; i++)
744 {
745 if (editor->pCursors[i].run == end_run)
746 {
747 editor->pCursors[i].run = next_first_run;
748 editor->pCursors[i].nOffset = 0;
749 }
750 else if (editor->pCursors[i].para == next)
751 editor->pCursors[i].para = para;
752 }
753
754 for (tmp_run = next_first_run; tmp_run; tmp_run = run_next( tmp_run ))
755 {
756 tmp_run->nCharOfs += next->nCharOfs - para->nCharOfs - end_len;
757 tmp_run->para = para;
758 }
759
760 /* Fix up the para's eop_run ptr */
761 para->eop_run = next->eop_run;
762
763 ME_Remove( run_get_di( end_run ) );
765
766 if (editor->last_sel_start_para == next)
767 editor->last_sel_start_para = para;
768 if (editor->last_sel_end_para == next)
769 editor->last_sel_end_para = para;
770
771 para->next_para = next->next_para;
772 next->next_para->member.para.prev_para = para_get_di( para );
774 para_destroy( editor, next );
775
776 editor_propagate_char_ofs( editor, para_next( para ), NULL, -end_len );
777
778 ME_CheckCharOffsets(editor);
779
780 editor->nParagraphs--;
781 para_mark_rewrap( editor, para );
782 return para;
783}
784
785void ME_DumpParaStyleToBuf(const PARAFORMAT2 *pFmt, char buf[2048])
786{
787 char *p;
788 p = buf;
789
790#define DUMP(mask, name, fmt, field) \
791 if (pFmt->dwMask & (mask)) p += sprintf(p, "%-22s" fmt "\n", name, pFmt->field); \
792 else p += sprintf(p, "%-22sN/A\n", name);
793
794/* we take for granted that PFE_xxx is the hiword of the corresponding PFM_xxx */
795#define DUMP_EFFECT(mask, name) \
796 p += sprintf(p, "%-22s%s\n", name, (pFmt->dwMask & (mask)) ? ((pFmt->wEffects & ((mask) >> 16)) ? "yes" : "no") : "N/A");
797
798 DUMP(PFM_NUMBERING, "Numbering:", "%u", wNumbering);
799 DUMP_EFFECT(PFM_DONOTHYPHEN, "Disable auto-hyphen:");
800 DUMP_EFFECT(PFM_KEEP, "No page break in para:");
801 DUMP_EFFECT(PFM_KEEPNEXT, "No page break in para & next:");
802 DUMP_EFFECT(PFM_NOLINENUMBER, "No line number:");
803 DUMP_EFFECT(PFM_NOWIDOWCONTROL, "No widow & orphan:");
804 DUMP_EFFECT(PFM_PAGEBREAKBEFORE, "Page break before:");
805 DUMP_EFFECT(PFM_RTLPARA, "RTL para:");
806 DUMP_EFFECT(PFM_SIDEBYSIDE, "Side by side:");
807 DUMP_EFFECT(PFM_TABLE, "Table:");
808 DUMP(PFM_OFFSETINDENT, "Offset indent:", "%ld", dxStartIndent);
809 DUMP(PFM_STARTINDENT, "Start indent:", "%ld", dxStartIndent);
810 DUMP(PFM_RIGHTINDENT, "Right indent:", "%ld", dxRightIndent);
811 DUMP(PFM_OFFSET, "Offset:", "%ld", dxOffset);
812 if (pFmt->dwMask & PFM_ALIGNMENT) {
813 switch (pFmt->wAlignment) {
814 case PFA_LEFT : p += sprintf(p, "Alignment: left\n"); break;
815 case PFA_RIGHT : p += sprintf(p, "Alignment: right\n"); break;
816 case PFA_CENTER : p += sprintf(p, "Alignment: center\n"); break;
817 case PFA_JUSTIFY: p += sprintf(p, "Alignment: justify\n"); break;
818 default : p += sprintf(p, "Alignment: incorrect %d\n", pFmt->wAlignment); break;
819 }
820 }
821 else p += sprintf(p, "Alignment: N/A\n");
822 DUMP(PFM_TABSTOPS, "Tab Stops:", "%d", cTabCount);
823 if (pFmt->dwMask & PFM_TABSTOPS) {
824 int i;
825 p += sprintf(p, "\t");
826 for (i = 0; i < pFmt->cTabCount; i++) p += sprintf(p, "%lx ", pFmt->rgxTabs[i]);
827 p += sprintf(p, "\n");
828 }
829 DUMP(PFM_SPACEBEFORE, "Space Before:", "%ld", dySpaceBefore);
830 DUMP(PFM_SPACEAFTER, "Space After:", "%ld", dySpaceAfter);
831 DUMP(PFM_LINESPACING, "Line spacing:", "%ld", dyLineSpacing);
832 DUMP(PFM_STYLE, "Text style:", "%d", sStyle);
833 DUMP(PFM_LINESPACING, "Line spacing rule:", "%u", bLineSpacingRule);
834 /* bOutlineLevel should be 0 */
835 DUMP(PFM_SHADING, "Shading Weight:", "%u", wShadingWeight);
836 DUMP(PFM_SHADING, "Shading Style:", "%u", wShadingStyle);
837 DUMP(PFM_NUMBERINGSTART, "Numbering Start:", "%u", wNumberingStart);
838 DUMP(PFM_NUMBERINGSTYLE, "Numbering Style:", "0x%x", wNumberingStyle);
839 DUMP(PFM_NUMBERINGTAB, "Numbering Tab:", "%u", wNumberingStyle);
840 DUMP(PFM_BORDER, "Border Space:", "%u", wBorderSpace);
841 DUMP(PFM_BORDER, "Border Width:", "%u", wBorderWidth);
842 DUMP(PFM_BORDER, "Borders:", "%u", wBorders);
843
844#undef DUMP
845#undef DUMP_EFFECT
846}
847
849{
850 ME_Cursor *pEndCursor = &editor->pCursors[1];
851
852 *para = editor->pCursors[0].para;
853 *para_end = editor->pCursors[1].para;
854 if (*para == *para_end)
855 return;
856
857 if ((*para_end)->nCharOfs < (*para)->nCharOfs)
858 {
859 ME_Paragraph *tmp = *para;
860
861 *para = *para_end;
862 *para_end = tmp;
863 pEndCursor = &editor->pCursors[0];
864 }
865
866 /* The paragraph at the end of a non-empty selection isn't included
867 * if the selection ends at the start of the paragraph. */
868 if (!pEndCursor->run->nCharOfs && !pEndCursor->nOffset)
869 *para_end = para_prev( *para_end );
870}
871
872
874{
875 ME_Paragraph *para, *para_end;
876
877 editor_get_selection_paras( editor, &para, &para_end );
878
879 do
880 {
881 para_set_fmt( editor, para, fmt );
882 if (para == para_end) break;
883 para = para_next( para );
884 } while(1);
885
886 return TRUE;
887}
888
889static void para_copy_fmt( const ME_Paragraph *para, PARAFORMAT2 *fmt )
890{
891 UINT size = fmt->cbSize;
892
893 if (fmt->cbSize >= sizeof(PARAFORMAT2))
894 *fmt = para->fmt;
895 else
896 {
897 memcpy( fmt, &para->fmt, fmt->cbSize );
898 fmt->dwMask &= PFM_ALL;
899 }
900 fmt->cbSize = size;
901}
902
904{
905 ME_Paragraph *para, *para_end;
906
907 if (fmt->cbSize < sizeof(PARAFORMAT))
908 {
909 fmt->dwMask = 0;
910 return;
911 }
912
913 editor_get_selection_paras( editor, &para, &para_end );
914
915 para_copy_fmt( para, fmt );
916
917 /* Invalidate values that change across the selected paragraphs. */
918 while (para != para_end)
919 {
920 para = para_next( para );
921
922#define CHECK_FIELD(m, f) \
923 if (fmt->f != para->fmt.f) fmt->dwMask &= ~(m);
924
925 CHECK_FIELD(PFM_NUMBERING, wNumbering);
926 CHECK_FIELD(PFM_STARTINDENT, dxStartIndent);
927 CHECK_FIELD(PFM_RIGHTINDENT, dxRightIndent);
928 CHECK_FIELD(PFM_OFFSET, dxOffset);
929 CHECK_FIELD(PFM_ALIGNMENT, wAlignment);
930 if (fmt->dwMask & PFM_TABSTOPS)
931 {
932 if (fmt->cTabCount != para->fmt.cTabCount ||
933 memcmp(fmt->rgxTabs, para->fmt.rgxTabs, para->fmt.cTabCount * sizeof(int) ))
934 fmt->dwMask &= ~PFM_TABSTOPS;
935 }
936
937 if (fmt->cbSize >= sizeof(PARAFORMAT2))
938 {
939 fmt->dwMask &= ~((fmt->wEffects ^ para->fmt.wEffects) << 16);
940 CHECK_FIELD(PFM_SPACEBEFORE, dySpaceBefore);
941 CHECK_FIELD(PFM_SPACEAFTER, dySpaceAfter);
942 CHECK_FIELD(PFM_LINESPACING, dyLineSpacing);
943 CHECK_FIELD(PFM_STYLE, sStyle);
944 CHECK_FIELD(PFM_SPACEAFTER, bLineSpacingRule);
945 CHECK_FIELD(PFM_SHADING, wShadingWeight);
946 CHECK_FIELD(PFM_SHADING, wShadingStyle);
947 CHECK_FIELD(PFM_NUMBERINGSTART, wNumberingStart);
948 CHECK_FIELD(PFM_NUMBERINGSTYLE, wNumberingStyle);
949 CHECK_FIELD(PFM_NUMBERINGTAB, wNumberingTab);
950 CHECK_FIELD(PFM_BORDER, wBorderSpace);
951 CHECK_FIELD(PFM_BORDER, wBorderWidth);
952 CHECK_FIELD(PFM_BORDER, wBorders);
953 }
954#undef CHECK_FIELD
955 }
956}
957
959{
960 const PARAFORMAT2 *host_fmt;
961 HRESULT hr;
962
963 ZeroMemory(pFmt, sizeof(PARAFORMAT2));
964 pFmt->cbSize = sizeof(PARAFORMAT2);
965 pFmt->dwMask = PFM_ALL2;
966 pFmt->wAlignment = PFA_LEFT;
967 pFmt->sStyle = -1;
968 pFmt->bOutlineLevel = TRUE;
969
970 hr = ITextHost_TxGetParaFormat( editor->texthost, (const PARAFORMAT **)&host_fmt );
971 if (SUCCEEDED(hr))
972 {
973 /* Just use the alignment for now */
974 if (host_fmt->dwMask & PFM_ALIGNMENT)
975 pFmt->wAlignment = host_fmt->wAlignment;
977 }
978}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
Arabic default style
Definition: afstyles.h:94
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define ARRAY_SIZE(A)
Definition: main.h:20
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
Definition: copy.c:51
#define ERR(fmt,...)
Definition: precomp.h:57
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define lstrcpyW
Definition: compat.h:749
LCID WINAPI GetSystemDefaultLCID(void)
Definition: locale.c:1235
const WCHAR * text
Definition: package.c:1794
void ME_DestroyContext(ME_Context *c)
Definition: context.c:44
void ME_InitContext(ME_Context *c, ME_TextEditor *editor, HDC hDC)
Definition: context.c:23
ME_Paragraph * editor_first_para(ME_TextEditor *editor)
Definition: editor.c:276
ME_Paragraph * editor_end_para(ME_TextEditor *editor)
Definition: editor.c:282
#define swprintf
Definition: precomp.h:40
#define assert(x)
Definition: debug.h:53
#define L(x)
Definition: resources.c:13
ME_Run * run_next(ME_Run *run)
Definition: run.c:68
#define ITextHost_OnTxParaFormatChange(This, a)
Definition: editor.h:365
void ME_AddRefStyle(ME_Style *item)
Definition: style.c:454
void ME_Remove(ME_DisplayItem *diWhere)
Definition: list.c:35
ME_Cell * cell_next(ME_Cell *cell)
Definition: table.c:192
void ME_SetCharFormat(ME_TextEditor *editor, ME_Cursor *start, ME_Cursor *end, CHARFORMAT2W *pFmt)
Definition: run.c:782
void ME_ReleaseStyle(ME_Style *item)
Definition: style.c:462
void ME_DestroyString(ME_String *s)
Definition: string.c:96
ME_Cell * cell_prev(ME_Cell *cell)
Definition: table.c:197
ME_DisplayItem * ME_FindItemBack(ME_DisplayItem *di, ME_DIType nTypeOrClass)
Definition: list.c:66
static ME_DisplayItem * para_get_di(ME_Paragraph *para)
Definition: editor.h:236
BOOL ME_AppendString(ME_String *s, const WCHAR *append, int len)
Definition: string.c:126
void editor_propagate_char_ofs(ME_TextEditor *editor, ME_Paragraph *para, ME_Run *run, int shift)
Definition: run.c:147
ME_Run * run_create(ME_Style *s, int nFlags)
Definition: run.c:348
BOOL cfany_to_cf2w(CHARFORMAT2W *to, const CHARFORMAT2W *from)
Definition: style.c:36
ME_Style * ME_ApplyStyle(ME_TextEditor *ed, ME_Style *sSrc, CHARFORMAT2W *style)
Definition: style.c:156
ME_String * ME_MakeStringN(LPCWSTR szText, int nMaxChars)
Definition: string.c:75
BOOL add_undo_join_paras(ME_TextEditor *, int pos)
Definition: undo.c:176
#define ITextHost_TxGetParaFormat(This, a)
Definition: editor.h:356
ME_String * ME_VSplitString(ME_String *orig, int nVPos)
Definition: string.c:131
BOOL add_undo_set_para_fmt(ME_TextEditor *, const ME_Paragraph *para)
Definition: undo.c:152
ME_Style * ME_MakeStyle(CHARFORMAT2W *style)
Definition: style.c:121
static ME_DisplayItem * run_get_di(ME_Run *run)
Definition: editor.h:162
void ME_InitCharFormat2W(CHARFORMAT2W *pFmt)
Definition: style.c:150
BOOL add_undo_split_para(ME_TextEditor *, const ME_Paragraph *para, ME_String *eol_str, const ME_Cell *cell)
Definition: undo.c:185
static ME_DisplayItem * cell_get_di(ME_Cell *cell)
Definition: editor.h:318
ME_Cell * cell_create(void)
Definition: table.c:186
ME_String * ME_MakeStringConst(const WCHAR *str, int len)
Definition: string.c:41
ME_DisplayItem * ME_FindItemFwd(ME_DisplayItem *di, ME_DIType nTypeOrClass)
Definition: list.c:89
ME_String * ME_MakeStringEmpty(int len)
Definition: string.c:58
void ME_SetDefaultCharFormat(ME_TextEditor *editor, CHARFORMAT2W *mod)
Definition: style.c:524
void ME_InsertBefore(ME_DisplayItem *diWhere, ME_DisplayItem *diWhat)
Definition: list.c:26
void select_style(ME_Context *c, ME_Style *s)
Definition: style.c:369
void ME_DestroyDisplayItem(ME_DisplayItem *item)
Definition: list.c:115
void ME_CheckCharOffsets(ME_TextEditor *editor)
Definition: run.c:178
#define ITextHost_TxGetCharFormat(This, a)
Definition: editor.h:355
ME_DisplayItem * ME_MakeDI(ME_DIType type)
Definition: list.c:133
#define MERF_ENDPARA
Definition: editstr.h:120
#define MERF_HIDDEN
Definition: editstr.h:124
#define MERF_ENDCELL
Definition: editstr.h:107
#define MEPF_CELL
Definition: editstr.h:141
#define MEPF_ROWSTART
Definition: editstr.h:142
#define MEPF_ROWEND
Definition: editstr.h:143
@ diStartRow
Definition: editstr.h:86
@ diRun
Definition: editstr.h:85
@ diStartRowOrParagraph
Definition: editstr.h:90
@ diParagraph
Definition: editstr.h:83
#define MERF_TABLESTART
Definition: editstr.h:126
#define MEPF_REWRAP
Definition: editstr.h:139
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
size_t total
GLuint GLuint end
Definition: gl.h:1545
GLsizeiptr size
Definition: glext.h:5919
const GLubyte * c
Definition: glext.h:8905
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
const GLint * first
Definition: glext.h:5794
GLfloat GLfloat p
Definition: glext.h:8902
GLuint GLuint num
Definition: glext.h:9618
GLenum GLsizei len
Definition: glext.h:6722
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
uint32_t entry
Definition: isohybrid.c:63
#define c
Definition: ke_i.h:80
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define sprintf(buf, format,...)
Definition: sprintf.c:55
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:88
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
static int pints_t pn[]
Definition: server.c:129
#define min(a, b)
Definition: monoChain.cc:55
unsigned int UINT
Definition: ndis.h:50
ME_Row * para_first_row(ME_Paragraph *para)
Definition: para.c:132
void editor_get_selection_para_fmt(ME_TextEditor *editor, PARAFORMAT2 *fmt)
Definition: para.c:903
static void para_mark_rewrap_paras(ME_TextEditor *editor, ME_Paragraph *first, const ME_Paragraph *end)
Definition: para.c:226
void editor_set_default_para_fmt(ME_TextEditor *editor, PARAFORMAT2 *pFmt)
Definition: para.c:958
static ME_String * para_num_get_str(ME_Paragraph *para, WORD num)
Definition: para.c:277
#define DUMP(mask, name, fmt, field)
#define EFFECTS_MASK
ME_Row * para_end_row(ME_Paragraph *para)
Definition: para.c:141
ME_Paragraph * para_split(ME_TextEditor *editor, ME_Run *run, ME_Style *style, const WCHAR *eol_str, int eol_len, int paraFlags)
Definition: para.c:538
void para_num_init(ME_Context *c, ME_Paragraph *para)
Definition: para.c:390
void ME_DumpParaStyleToBuf(const PARAFORMAT2 *pFmt, char buf[2048])
Definition: para.c:785
void para_mark_remove(ME_TextEditor *editor, ME_Paragraph *para)
Definition: para.c:94
static ME_Paragraph * para_create(ME_TextEditor *editor)
Definition: para.c:32
ME_Run * para_end_run(ME_Paragraph *para)
Definition: para.c:117
static int para_num_get_num(ME_Paragraph *para)
Definition: para.c:264
ME_Cell * para_cell(ME_Paragraph *para)
Definition: para.c:127
void para_num_clear(struct para_num *pn)
Definition: para.c:434
BOOL editor_set_selection_para_fmt(ME_TextEditor *editor, const PARAFORMAT2 *fmt)
Definition: para.c:873
void para_mark_add(ME_TextEditor *editor, ME_Paragraph *para)
Definition: para.c:99
#define CHECK_FIELD(m, f)
void editor_get_selection_paras(ME_TextEditor *editor, ME_Paragraph **para, ME_Paragraph **para_end)
Definition: para.c:848
ME_Paragraph * para_join(ME_TextEditor *editor, ME_Paragraph *para, BOOL use_first_fmt)
Definition: para.c:681
BOOL para_in_table(ME_Paragraph *para)
Definition: para.c:122
#define DUMP_EFFECT(mask, name)
void editor_mark_rewrap_all(ME_TextEditor *editor)
Definition: para.c:235
static BOOL para_set_fmt(ME_TextEditor *editor, ME_Paragraph *para, const PARAFORMAT2 *pFmt)
Definition: para.c:456
void para_mark_rewrap(ME_TextEditor *editor, ME_Paragraph *para)
Definition: para.c:26
void ME_MakeFirstParagraph(ME_TextEditor *editor, HDC hdc)
Definition: para.c:151
int get_total_width(ME_TextEditor *editor)
Definition: para.c:69
static void table_update_flags(ME_Paragraph *para)
Definition: para.c:240
ME_Run * para_first_run(ME_Paragraph *para)
Definition: para.c:104
static int para_mark_compare(const void *key, const struct wine_rb_entry *entry)
Definition: para.c:87
ME_Paragraph * para_prev(ME_Paragraph *para)
Definition: para.c:63
static BOOL para_num_same_list(const PARAFORMAT2 *item, const PARAFORMAT2 *base)
Definition: para.c:256
ME_Paragraph * para_next(ME_Paragraph *para)
Definition: para.c:57
void para_destroy(ME_TextEditor *editor, ME_Paragraph *para)
Definition: para.c:42
static void para_copy_fmt(const ME_Paragraph *para, PARAFORMAT2 *fmt)
Definition: para.c:889
#define COPY_FIELD(m, f)
static void para_num_clear_list(ME_TextEditor *editor, ME_Paragraph *para, const PARAFORMAT2 *orig_fmt)
Definition: para.c:445
long LONG
Definition: pedump.c:60
static unsigned __int64 next
Definition: rand_nt.c:6
#define PFN_UCLETTER
Definition: richedit.h:908
#define PFM_SPACEBEFORE
Definition: richedit.h:847
#define MAX_TAB_STOPS
Definition: richedit.h:218
#define CFM_PROTECTED
Definition: richedit.h:336
#define PFA_RIGHT
Definition: richedit.h:922
#define PFA_CENTER
Definition: richedit.h:923
#define PFM_OFFSETINDENT
Definition: richedit.h:844
#define PFM_NUMBERING
Definition: richedit.h:843
#define CFM_STRIKEOUT
Definition: richedit.h:335
#define CFM_SMALLCAPS
Definition: richedit.h:338
#define PFN_ARABIC
Definition: richedit.h:906
#define CFE_STRIKEOUT
Definition: richedit.h:409
#define CFE_BOLD
Definition: richedit.h:406
#define CFM_SHADOW
Definition: richedit.h:342
#define CFM_STYLE
Definition: richedit.h:351
#define PFA_LEFT
Definition: richedit.h:921
#define CFE_AUTOCOLOR
Definition: richedit.h:414
#define CFM_IMPRINT
Definition: richedit.h:344
#define PFM_NOLINENUMBER
Definition: richedit.h:860
#define PFM_KEEPNEXT
Definition: richedit.h:858
#define PFM_NUMBERINGSTYLE
Definition: richedit.h:853
#define PFM_DONOTHYPHEN
Definition: richedit.h:862
#define CFM_OFFSET
Definition: richedit.h:359
#define CFM_WEIGHT
Definition: richedit.h:354
#define CFE_ITALIC
Definition: richedit.h:407
#define PFNS_NEWNUMBER
Definition: richedit.h:918
#define PFM_LINESPACING
Definition: richedit.h:849
#define CFM_OUTLINE
Definition: richedit.h:341
#define PFM_OFFSET
Definition: richedit.h:840
#define PFN_LCLETTER
Definition: richedit.h:907
#define CFM_SPACING
Definition: richedit.h:353
#define CFM_EMBOSS
Definition: richedit.h:343
#define CFM_SUBSCRIPT
Definition: richedit.h:348
#define PFN_UCROMAN
Definition: richedit.h:910
#define PFM_ALL2
Definition: richedit.h:892
#define CFM_CHARSET
Definition: richedit.h:358
#define CFM_HIDDEN
Definition: richedit.h:340
#define PFM_SHADING
Definition: richedit.h:852
#define PFM_RIGHTINDENT
Definition: richedit.h:839
#define CFE_UNDERLINE
Definition: richedit.h:408
#define CFM_BACKCOLOR
Definition: richedit.h:357
#define CFM_DISABLED
Definition: richedit.h:345
#define CFM_KERNING
Definition: richedit.h:352
#define PFM_TABLE
Definition: richedit.h:870
#define PFNS_PAREN
Definition: richedit.h:913
#define PFN_BULLET
Definition: richedit.h:905
#define CFM_ITALIC
Definition: richedit.h:333
#define CFU_UNDERLINE
Definition: richedit.h:428
struct _paraformat2 PARAFORMAT2
#define CFM_LCID
Definition: richedit.h:356
#define CFM_LINK
Definition: richedit.h:337
#define CFM_SIZE
Definition: richedit.h:362
#define PFM_NOWIDOWCONTROL
Definition: richedit.h:861
#define PFM_PAGEBREAKBEFORE
Definition: richedit.h:859
#define PFE_TABLE
Definition: richedit.h:944
#define CFM_REVISED
Definition: richedit.h:346
#define PFM_BORDER
Definition: richedit.h:851
#define PFM_ALIGNMENT
Definition: richedit.h:841
#define CFE_AUTOBACKCOLOR
Definition: richedit.h:425
#define CFM_REVAUTHOR
Definition: richedit.h:347
#define PFM_SIDEBYSIDE
Definition: richedit.h:863
#define PFA_JUSTIFY
Definition: richedit.h:924
#define CFM_ANIMATION
Definition: richedit.h:350
#define PFM_TABSTOPS
Definition: richedit.h:842
#define PFM_TABLEROWDELIMITER
Definition: richedit.h:868
#define PFN_LCROMAN
Definition: richedit.h:909
#define PFM_STYLE
Definition: richedit.h:850
#define PFNS_PARENS
Definition: richedit.h:914
#define PFM_ALL
Definition: richedit.h:872
#define CFM_BOLD
Definition: richedit.h:332
#define CFM_UNDERLINETYPE
Definition: richedit.h:355
#define PFM_KEEP
Definition: richedit.h:857
#define CFM_FACE
Definition: richedit.h:360
#define PFM_RTLPARA
Definition: richedit.h:856
#define PFM_SPACEAFTER
Definition: richedit.h:848
#define CFM_UNDERLINE
Definition: richedit.h:334
#define PFE_TABLEROWDELIMITER
Definition: richedit.h:942
#define CFM_COLOR
Definition: richedit.h:361
#define CFM_ALLCAPS
Definition: richedit.h:339
#define PFM_STARTINDENT
Definition: richedit.h:838
#define PFNS_PERIOD
Definition: richedit.h:915
#define PFM_NUMBERINGSTART
Definition: richedit.h:855
#define PFM_NUMBERINGTAB
Definition: richedit.h:854
const WCHAR * str
#define wine_rb_entry
Definition: rbtree.h:404
#define WINE_RB_ENTRY_VALUE
Definition: rbtree.h:414
#define wine_rb_put
Definition: rbtree.h:410
#define wine_rb_remove_key
Definition: rbtree.h:412
#define wine_rb_init
Definition: rbtree.h:406
HRESULT hr
Definition: shlfolder.c:183
BYTE lfStrikeOut
Definition: dimm.idl:66
BYTE lfItalic
Definition: dimm.idl:64
LONG lfHeight
Definition: dimm.idl:59
LONG lfWeight
Definition: dimm.idl:63
WCHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:72
BYTE lfUnderline
Definition: dimm.idl:65
BYTE lfCharSet
Definition: dimm.idl:67
BYTE lfPitchAndFamily
Definition: dimm.idl:71
LONG cx
Definition: kdterminal.h:27
BYTE bOutlineLevel
Definition: richedit.h:678
WORD wNumberingStart
Definition: richedit.h:680
WORD wAlignment
Definition: richedit.h:673
DWORD dwMask
Definition: richedit.h:667
SHORT sStyle
Definition: richedit.h:677
WORD wNumberingStyle
Definition: richedit.h:680
UINT cbSize
Definition: richedit.h:666
LONG rgxTabs[MAX_TAB_STOPS]
Definition: richedit.h:675
WORD wNumbering
Definition: richedit.h:668
SHORT cTabCount
Definition: richedit.h:674
WORD wEffects
Definition: richedit.h:669
LONG dxStartIndent
Definition: richedit.h:670
Definition: dsound.c:943
uacpi_u8 type
Definition: interpreter.c:38
Definition: copy.c:22
struct tagME_Cell * parent_cell
Definition: editstr.h:229
struct tagME_Cell * next_cell
Definition: editstr.h:229
struct tagME_Cell * prev_cell
Definition: editstr.h:229
int nNestingLevel
Definition: editstr.h:223
ME_Paragraph * para
Definition: editstr.h:275
int nOffset
Definition: editstr.h:277
ME_Run * run
Definition: editstr.h:276
ME_DIType type
Definition: editstr.h:256
union tagME_DisplayItem::@595 member
struct tagME_DisplayItem * next
Definition: editstr.h:257
ME_Paragraph para
Definition: editstr.h:262
struct tagME_DisplayItem * next_para
Definition: editstr.h:217
struct para_num para_num
Definition: editstr.h:215
ME_String * text
Definition: editstr.h:205
struct tagME_Cell * cell
Definition: editstr.h:207
struct wine_rb_entry marked_entry
Definition: editstr.h:218
ME_BorderRect border
Definition: editstr.h:208
struct tagME_DisplayItem * prev_para
Definition: editstr.h:217
PARAFORMAT2 fmt
Definition: editstr.h:204
ME_Run * eop_run
Definition: editstr.h:216
int nCharOfs
Definition: editstr.h:162
struct tagME_Paragraph * para
Definition: editstr.h:161
ME_Style * style
Definition: editstr.h:160
int len
Definition: editstr.h:163
ME_DisplayItem * pFirst
Definition: editstr.h:268
ME_DisplayItem * pLast
Definition: editstr.h:268
ME_Paragraph * last_sel_end_para
Definition: editstr.h:419
ITextHost2 * texthost
Definition: editstr.h:391
ME_Paragraph * last_sel_start_para
Definition: editstr.h:419
ME_Cursor * pCursors
Definition: editstr.h:396
ME_TextBuffer * pBuffer
Definition: editstr.h:395
struct wine_rb_tree marked_paras
Definition: editstr.h:460
unsigned int bEmulateVersion10
Definition: editstr.h:392
#define max(a, b)
Definition: svc.c:63
#define HIWORD(l)
Definition: typedefs.h:247
#define ZeroMemory
Definition: winbase.h:1753
HGDIOBJ WINAPI GetStockObject(_In_ int)
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
BOOL WINAPI GetTextExtentPointW(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpString, _In_ int c, _Out_ LPSIZE lpsz)
#define FW_NORMAL
Definition: wingdi.h:373
#define SYSTEM_FONT
Definition: wingdi.h:911
#define SYMBOL_CHARSET
Definition: wingdi.h:385
__wchar_t WCHAR
Definition: xmlstorage.h:180