Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
efa45652
Commit
efa45652
authored
Oct 12, 2020
by
Huw Davies
Committed by
Alexandre Julliard
Oct 12, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Use a structure to hold the repaint range.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1829c196
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
18 deletions
+20
-18
wrap.c
dlls/riched20/wrap.c
+20
-18
No files found.
dlls/riched20/wrap.c
View file @
efa45652
...
...
@@ -903,16 +903,18 @@ static void ME_WrapTextParagraph( ME_TextEditor *editor, ME_Context *c, ME_Parag
editor
->
total_rows
+=
wc
.
nRow
;
}
static
void
ME_MarkRepaintEnd
(
ME_DisplayItem
*
para
,
ME_DisplayItem
**
repaint_start
,
ME_DisplayItem
**
repaint_end
)
struct
repaint_range
{
if
(
!*
repaint_start
)
*
repaint_start
=
para
;
*
repaint_end
=
para
;
ME_DisplayItem
*
start
,
*
end
;
};
static
void
update_repaint
(
ME_DisplayItem
*
para
,
struct
repaint_range
*
repaint
)
{
if
(
!
repaint
->
start
)
repaint
->
start
=
para
;
repaint
->
end
=
para
;
}
static
void
adjust_para_y
(
ME_Paragraph
*
para
,
ME_Context
*
c
,
ME_DisplayItem
*
repaint_start
,
ME_DisplayItem
*
repaint_end
)
static
void
adjust_para_y
(
ME_Paragraph
*
para
,
ME_Context
*
c
,
struct
repaint_range
*
repaint
)
{
if
(
para
->
nFlags
&
MEPF_ROWSTART
)
{
...
...
@@ -985,11 +987,11 @@ static void adjust_para_y(ME_Paragraph *para, ME_Context *c, ME_DisplayItem *rep
{
/* The height of the cells has grown, so invalidate the bottom of
* the cells. */
ME_MarkRepaintEnd
(
para_get_di
(
para
)
,
&
repaint_start
,
&
repaint_end
);
update_repaint
(
para_get_di
(
para
),
repaint
);
cell
=
ME_FindItemBack
(
para_get_di
(
para
),
diCell
);
while
(
cell
)
{
ME_MarkRepaintEnd
(
ME_FindItemBack
(
cell
,
diParagraph
),
&
repaint_start
,
&
repaint_end
);
update_repaint
(
ME_FindItemBack
(
cell
,
diParagraph
),
repaint
);
cell
=
cell
->
member
.
cell
.
prev_cell
;
}
}
...
...
@@ -1031,7 +1033,7 @@ BOOL ME_WrapMarkedParagraphs(ME_TextEditor *editor)
struct
wine_rb_entry
*
entry
,
*
next_entry
;
ME_Context
c
;
int
totalWidth
=
editor
->
nTotalWidth
,
prev_width
;
ME_DisplayItem
*
repaint_start
=
NULL
,
*
repaint_end
=
NULL
;
struct
repaint_range
repaint
=
{
NULL
,
NULL
}
;
if
(
!
editor
->
marked_paras
.
root
)
return
FALSE
;
...
...
@@ -1052,9 +1054,9 @@ BOOL ME_WrapMarkedParagraphs(ME_TextEditor *editor)
totalWidth
=
max
(
totalWidth
,
para
->
nWidth
);
if
(
!
para
->
nCharOfs
)
ME_MarkRepaintEnd
(
para
->
prev_para
,
&
repaint_start
,
&
repaint_end
);
ME_MarkRepaintEnd
(
para_get_di
(
para
),
&
repaint_start
,
&
repaint_end
);
adjust_para_y
(
para
,
&
c
,
repaint_start
,
repaint_end
);
update_repaint
(
para
->
prev_para
,
&
repaint
);
update_repaint
(
para_get_di
(
para
),
&
repaint
);
adjust_para_y
(
para
,
&
c
,
&
repaint
);
if
(
para
->
next_para
)
{
...
...
@@ -1064,9 +1066,9 @@ BOOL ME_WrapMarkedParagraphs(ME_TextEditor *editor)
while
(
next
->
next_para
&&
&
next
->
marked_entry
!=
next_entry
&&
next
!=
&
editor
->
pBuffer
->
pLast
->
member
.
para
)
{
ME_MarkRepaintEnd
(
next
->
next_para
,
&
repaint_start
,
&
repaint_end
);
update_repaint
(
next
->
next_para
,
&
repaint
);
next
->
next_para
->
member
.
para
.
pt
.
y
=
c
.
pt
.
y
;
adjust_para_y
(
&
next
->
next_para
->
member
.
para
,
&
c
,
repaint_start
,
repaint_end
);
adjust_para_y
(
&
next
->
next_para
->
member
.
para
,
&
c
,
&
repaint
);
next
=
&
next
->
next_para
->
member
.
para
;
}
}
...
...
@@ -1083,9 +1085,9 @@ BOOL ME_WrapMarkedParagraphs(ME_TextEditor *editor)
ME_DestroyContext
(
&
c
);
if
(
repaint
_
start
||
editor
->
nTotalLength
<
editor
->
nLastTotalLength
)
ME_InvalidateParagraphRange
(
editor
,
repaint
_start
,
repaint_
end
);
return
!!
repaint
_
start
;
if
(
repaint
.
start
||
editor
->
nTotalLength
<
editor
->
nLastTotalLength
)
ME_InvalidateParagraphRange
(
editor
,
repaint
.
start
,
repaint
.
end
);
return
!!
repaint
.
start
;
}
void
ME_InvalidateParagraphRange
(
ME_TextEditor
*
editor
,
...
...
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