Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
88cfc04b
Commit
88cfc04b
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 ME_Paragraph ptrs for the update range.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
efa45652
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
23 deletions
+22
-23
editor.h
dlls/riched20/editor.h
+1
-1
paint.c
dlls/riched20/paint.c
+1
-1
wrap.c
dlls/riched20/wrap.c
+20
-21
No files found.
dlls/riched20/editor.h
View file @
88cfc04b
...
...
@@ -189,7 +189,7 @@ void ME_DestroyContext(ME_Context *c) DECLSPEC_HIDDEN;
/* wrap.c */
BOOL
ME_WrapMarkedParagraphs
(
ME_TextEditor
*
editor
)
DECLSPEC_HIDDEN
;
void
ME_InvalidateParagraphRange
(
ME_TextEditor
*
editor
,
ME_DisplayItem
*
start_para
,
ME_DisplayItem
*
last_para
)
DECLSPEC_HIDDEN
;
void
para_range_invalidate
(
ME_TextEditor
*
editor
,
ME_Paragraph
*
start_para
,
ME_Paragraph
*
last_para
)
DECLSPEC_HIDDEN
;
void
ME_SendRequestResize
(
ME_TextEditor
*
editor
,
BOOL
force
)
DECLSPEC_HIDDEN
;
/* para.c */
...
...
dlls/riched20/paint.c
View file @
88cfc04b
...
...
@@ -1356,7 +1356,7 @@ ME_InvalidateSelection(ME_TextEditor *editor)
}
if
(
repaint_start
)
ME_InvalidateParagraphRange
(
editor
,
repaint_start
,
repaint_end
);
para_range_invalidate
(
editor
,
&
repaint_start
->
member
.
para
,
&
repaint_end
->
member
.
para
);
/* remember the last invalidated position */
ME_GetSelectionOfs
(
editor
,
&
editor
->
nLastSelStart
,
&
editor
->
nLastSelEnd
);
ME_GetSelectionParas
(
editor
,
&
editor
->
pLastSelStartPara
,
&
editor
->
pLastSelEndPara
);
...
...
dlls/riched20/wrap.c
View file @
88cfc04b
...
...
@@ -905,10 +905,10 @@ static void ME_WrapTextParagraph( ME_TextEditor *editor, ME_Context *c, ME_Parag
struct
repaint_range
{
ME_
DisplayItem
*
start
,
*
end
;
ME_
Paragraph
*
start
,
*
end
;
};
static
void
update_repaint
(
ME_
DisplayItem
*
para
,
struct
repaint_range
*
repaint
)
static
void
update_repaint
(
ME_
Paragraph
*
para
,
struct
repaint_range
*
repaint
)
{
if
(
!
repaint
->
start
)
repaint
->
start
=
para
;
repaint
->
end
=
para
;
...
...
@@ -987,11 +987,11 @@ static void adjust_para_y( ME_Paragraph *para, ME_Context *c, struct repaint_ran
{
/* The height of the cells has grown, so invalidate the bottom of
* the cells. */
update_repaint
(
para
_get_di
(
para
)
,
repaint
);
update_repaint
(
para
,
repaint
);
cell
=
ME_FindItemBack
(
para_get_di
(
para
),
diCell
);
while
(
cell
)
{
update_repaint
(
ME_FindItemBack
(
cell
,
diParagraph
)
,
repaint
);
update_repaint
(
&
ME_FindItemBack
(
cell
,
diParagraph
)
->
member
.
para
,
repaint
);
cell
=
cell
->
member
.
cell
.
prev_cell
;
}
}
...
...
@@ -1054,22 +1054,22 @@ BOOL ME_WrapMarkedParagraphs(ME_TextEditor *editor)
totalWidth
=
max
(
totalWidth
,
para
->
nWidth
);
if
(
!
para
->
nCharOfs
)
update_repaint
(
para
->
prev_para
,
&
repaint
);
update_repaint
(
para
_get_di
(
para
)
,
&
repaint
);
update_repaint
(
para
_prev
(
para
)
,
&
repaint
);
update_repaint
(
para
,
&
repaint
);
adjust_para_y
(
para
,
&
c
,
&
repaint
);
if
(
para
->
next_para
)
if
(
para
_next
(
para
)
)
{
if
(
c
.
pt
.
y
!=
para
->
next_para
->
member
.
para
.
pt
.
y
)
if
(
c
.
pt
.
y
!=
para
_next
(
para
)
->
pt
.
y
)
{
next
=
para
;
while
(
next
->
next_para
&&
&
next
->
marked_entry
!=
next_entry
&&
while
(
para_next
(
next
)
&&
&
next
->
marked_entry
!=
next_entry
&&
next
!=
&
editor
->
pBuffer
->
pLast
->
member
.
para
)
{
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
);
next
=
&
next
->
next_para
->
member
.
para
;
update_repaint
(
para_next
(
next
)
,
&
repaint
);
para_next
(
next
)
->
pt
.
y
=
c
.
pt
.
y
;
adjust_para_y
(
para_next
(
next
)
,
&
c
,
&
repaint
);
next
=
para_next
(
next
)
;
}
}
}
...
...
@@ -1086,13 +1086,12 @@ BOOL ME_WrapMarkedParagraphs(ME_TextEditor *editor)
ME_DestroyContext
(
&
c
);
if
(
repaint
.
start
||
editor
->
nTotalLength
<
editor
->
nLastTotalLength
)
ME_InvalidateParagraphRange
(
editor
,
repaint
.
start
,
repaint
.
end
);
para_range_invalidate
(
editor
,
repaint
.
start
,
repaint
.
end
);
return
!!
repaint
.
start
;
}
void
ME_InvalidateParagraphRange
(
ME_TextEditor
*
editor
,
ME_DisplayItem
*
start_para
,
ME_DisplayItem
*
last_para
)
void
para_range_invalidate
(
ME_TextEditor
*
editor
,
ME_Paragraph
*
start_para
,
ME_Paragraph
*
last_para
)
{
RECT
rc
;
int
ofs
;
...
...
@@ -1102,16 +1101,16 @@ void ME_InvalidateParagraphRange(ME_TextEditor *editor,
if
(
start_para
)
{
start_para
=
para_get_di
(
table_outer_para
(
&
start_para
->
member
.
para
)
);
last_para
=
para_get_di
(
table_outer_para
(
&
last_para
->
member
.
para
)
);
rc
.
top
+=
start_para
->
member
.
para
.
pt
.
y
-
ofs
;
start_para
=
table_outer_para
(
start_para
);
last_para
=
table_outer_para
(
last_para
);
rc
.
top
+=
start_para
->
pt
.
y
-
ofs
;
}
else
{
rc
.
top
+=
editor
->
nTotalLength
-
ofs
;
}
if
(
editor
->
nTotalLength
<
editor
->
nLastTotalLength
)
rc
.
bottom
=
editor
->
rcFormat
.
top
+
editor
->
nLastTotalLength
-
ofs
;
else
rc
.
bottom
=
editor
->
rcFormat
.
top
+
last_para
->
member
.
para
.
pt
.
y
+
last_para
->
member
.
para
.
nHeight
-
ofs
;
rc
.
bottom
=
editor
->
rcFormat
.
top
+
last_para
->
pt
.
y
+
last_para
->
nHeight
-
ofs
;
ITextHost_TxInvalidateRect
(
editor
->
texthost
,
&
rc
,
TRUE
);
}
...
...
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