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
10d800b6
Commit
10d800b6
authored
May 18, 2012
by
Dylan Smith
Committed by
Alexandre Julliard
May 18, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
richedit: Invalidate a range of paragraphs without marking them.
parent
49b98b11
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
36 additions
and
44 deletions
+36
-44
editor.h
dlls/riched20/editor.h
+2
-3
editstr.h
dlls/riched20/editstr.h
+0
-1
paint.c
dlls/riched20/paint.c
+7
-10
para.c
dlls/riched20/para.c
+0
-9
table.c
dlls/riched20/table.c
+14
-0
wrap.c
dlls/riched20/wrap.c
+13
-21
No files found.
dlls/riched20/editor.h
View file @
10d800b6
...
...
@@ -187,7 +187,7 @@ void ME_DestroyContext(ME_Context *c) DECLSPEC_HIDDEN;
/* wrap.c */
BOOL
ME_WrapMarkedParagraphs
(
ME_TextEditor
*
editor
)
DECLSPEC_HIDDEN
;
void
ME_Invalidate
MarkedParagraphs
(
ME_TextEditor
*
editor
,
ME_DisplayItem
*
start_para
,
ME_DisplayItem
*
end
_para
)
DECLSPEC_HIDDEN
;
void
ME_Invalidate
ParagraphRange
(
ME_TextEditor
*
editor
,
ME_DisplayItem
*
start_para
,
ME_DisplayItem
*
last
_para
)
DECLSPEC_HIDDEN
;
void
ME_SendRequestResize
(
ME_TextEditor
*
editor
,
BOOL
force
)
DECLSPEC_HIDDEN
;
/* para.c */
...
...
@@ -201,8 +201,6 @@ void ME_DumpParaStyle(ME_Paragraph *s) DECLSPEC_HIDDEN;
void
ME_DumpParaStyleToBuf
(
const
PARAFORMAT2
*
pFmt
,
char
buf
[
2048
])
DECLSPEC_HIDDEN
;
BOOL
ME_SetSelectionParaFormat
(
ME_TextEditor
*
editor
,
const
PARAFORMAT2
*
pFmt
)
DECLSPEC_HIDDEN
;
void
ME_GetSelectionParaFormat
(
ME_TextEditor
*
editor
,
PARAFORMAT2
*
pFmt
)
DECLSPEC_HIDDEN
;
/* marks from first up to (but not including) last */
void
ME_MarkForPainting
(
ME_TextEditor
*
editor
,
ME_DisplayItem
*
first
,
const
ME_DisplayItem
*
last
)
DECLSPEC_HIDDEN
;
void
ME_MarkAllForWrapping
(
ME_TextEditor
*
editor
)
DECLSPEC_HIDDEN
;
void
ME_SetDefaultParaFormat
(
PARAFORMAT2
*
pFmt
)
DECLSPEC_HIDDEN
;
...
...
@@ -261,6 +259,7 @@ ME_DisplayItem *ME_InsertTableCellFromCursor(ME_TextEditor *editor) DECLSPEC_HID
ME_DisplayItem
*
ME_InsertTableRowEndFromCursor
(
ME_TextEditor
*
editor
)
DECLSPEC_HIDDEN
;
ME_DisplayItem
*
ME_GetTableRowEnd
(
ME_DisplayItem
*
para
)
DECLSPEC_HIDDEN
;
ME_DisplayItem
*
ME_GetTableRowStart
(
ME_DisplayItem
*
para
)
DECLSPEC_HIDDEN
;
ME_DisplayItem
*
ME_GetOuterParagraph
(
ME_DisplayItem
*
para
)
DECLSPEC_HIDDEN
;
void
ME_CheckTablesForCorruption
(
ME_TextEditor
*
editor
)
DECLSPEC_HIDDEN
;
void
ME_ProtectPartialTableDeletion
(
ME_TextEditor
*
editor
,
ME_Cursor
*
c
,
int
*
nChars
)
DECLSPEC_HIDDEN
;
ME_DisplayItem
*
ME_AppendTableRow
(
ME_TextEditor
*
editor
,
ME_DisplayItem
*
table_row
)
DECLSPEC_HIDDEN
;
...
...
dlls/riched20/editstr.h
View file @
10d800b6
...
...
@@ -138,7 +138,6 @@ typedef enum {
/* this paragraph was already wrapped and hasn't changed, every change resets that flag */
#define MEPF_REWRAP 0x01
#define MEPF_REPAINT 0x02
/* v4.1 */
#define MEPF_CELL 0x04
/* The paragraph is nested in a cell */
#define MEPF_ROWSTART 0x08
/* Hidden empty paragraph at the start of the row */
...
...
dlls/riched20/paint.c
View file @
10d800b6
...
...
@@ -1274,32 +1274,29 @@ ME_InvalidateSelection(ME_TextEditor *editor)
* they can point past the end of the document */
if
(
editor
->
nLastSelStart
>
len
||
editor
->
nLastSelEnd
>
len
)
{
repaint_start
=
ME_FindItemFwd
(
editor
->
pBuffer
->
pFirst
,
diParagraph
);
repaint_end
=
editor
->
pBuffer
->
pLast
;
ME_MarkForPainting
(
editor
,
repaint_start
,
repaint_end
);
repaint_end
=
editor
->
pBuffer
->
pLast
->
member
.
para
.
prev_para
;
}
else
{
/* if the start part of selection is being expanded or contracted... */
if
(
nStart
<
editor
->
nLastSelStart
)
{
repaint_start
=
sel_start
;
repaint_end
=
editor
->
pLastSelStartPara
->
member
.
para
.
next_para
;
repaint_end
=
editor
->
pLastSelStartPara
;
}
else
if
(
nStart
>
editor
->
nLastSelStart
)
{
repaint_start
=
editor
->
pLastSelStartPara
;
repaint_end
=
sel_start
->
member
.
para
.
next_para
;
repaint_end
=
sel_start
;
}
ME_MarkForPainting
(
editor
,
repaint_start
,
repaint_end
);
/* if the end part of selection is being contracted or expanded... */
if
(
nEnd
<
editor
->
nLastSelEnd
)
{
if
(
!
repaint_start
)
repaint_start
=
sel_end
;
repaint_end
=
editor
->
pLastSelEndPara
->
member
.
para
.
next_para
;
ME_MarkForPainting
(
editor
,
sel_end
,
repaint_end
);
repaint_end
=
editor
->
pLastSelEndPara
;
}
else
if
(
nEnd
>
editor
->
nLastSelEnd
)
{
if
(
!
repaint_start
)
repaint_start
=
editor
->
pLastSelEndPara
;
repaint_end
=
sel_end
->
member
.
para
.
next_para
;
ME_MarkForPainting
(
editor
,
editor
->
pLastSelEndPara
,
repaint_end
);
repaint_end
=
sel_end
;
}
}
ME_InvalidateMarkedParagraphs
(
editor
,
repaint_start
,
repaint_end
);
if
(
repaint_start
)
ME_InvalidateParagraphRange
(
editor
,
repaint_start
,
repaint_end
);
/* remember the last invalidated position */
ME_GetSelectionOfs
(
editor
,
&
editor
->
nLastSelStart
,
&
editor
->
nLastSelEnd
);
ME_GetSelectionParas
(
editor
,
&
editor
->
pLastSelStartPara
,
&
editor
->
pLastSelEndPara
);
...
...
dlls/riched20/para.c
View file @
10d800b6
...
...
@@ -94,15 +94,6 @@ void ME_MarkAllForWrapping(ME_TextEditor *editor)
ME_MarkForWrapping
(
editor
,
editor
->
pBuffer
->
pFirst
->
member
.
para
.
next_para
,
editor
->
pBuffer
->
pLast
);
}
void
ME_MarkForPainting
(
ME_TextEditor
*
editor
,
ME_DisplayItem
*
first
,
const
ME_DisplayItem
*
last
)
{
while
(
first
!=
last
&&
first
)
{
first
->
member
.
para
.
nFlags
|=
MEPF_REPAINT
;
first
=
first
->
member
.
para
.
next_para
;
}
}
static
void
ME_UpdateTableFlags
(
ME_DisplayItem
*
para
)
{
para
->
member
.
para
.
pFmt
->
dwMask
|=
PFM_TABLE
|
PFM_TABLEROWDELIMITER
;
...
...
dlls/riched20/table.c
View file @
10d800b6
...
...
@@ -172,6 +172,20 @@ ME_DisplayItem* ME_GetTableRowStart(ME_DisplayItem *para)
return
para
;
}
ME_DisplayItem
*
ME_GetOuterParagraph
(
ME_DisplayItem
*
para
)
{
if
(
para
->
member
.
para
.
nFlags
&
MEPF_ROWEND
)
para
=
para
->
member
.
para
.
prev_para
;
while
(
para
->
member
.
para
.
pCell
)
{
para
=
ME_GetTableRowStart
(
para
);
if
(
!
para
->
member
.
para
.
pCell
)
break
;
para
=
ME_FindItemBack
(
para
->
member
.
para
.
pCell
,
diParagraph
);
}
return
para
;
}
/* Make a bunch of assertions to make sure tables haven't been corrupted.
*
* These invariants may not hold true in the middle of streaming in rich text
...
...
dlls/riched20/wrap.c
View file @
10d800b6
...
...
@@ -589,8 +589,7 @@ static void ME_MarkRepaintEnd(ME_DisplayItem *para,
{
if
(
!*
repaint_start
)
*
repaint_start
=
para
;
*
repaint_end
=
para
->
member
.
para
.
next_para
;
para
->
member
.
para
.
nFlags
|=
MEPF_REPAINT
;
*
repaint_end
=
para
;
}
BOOL
ME_WrapMarkedParagraphs
(
ME_TextEditor
*
editor
)
...
...
@@ -738,42 +737,35 @@ BOOL ME_WrapMarkedParagraphs(ME_TextEditor *editor)
ME_DestroyContext
(
&
c
);
if
(
repaint_start
||
editor
->
nTotalLength
<
editor
->
nLastTotalLength
)
{
if
(
!
repaint_start
)
repaint_start
=
editor
->
pBuffer
->
pFirst
;
ME_InvalidateMarkedParagraphs
(
editor
,
repaint_start
,
repaint_end
);
}
ME_InvalidateParagraphRange
(
editor
,
repaint_start
,
repaint_end
);
return
!!
repaint_start
;
}
void
ME_Invalidate
MarkedParagraphs
(
ME_TextEditor
*
editor
,
void
ME_Invalidate
ParagraphRange
(
ME_TextEditor
*
editor
,
ME_DisplayItem
*
start_para
,
ME_DisplayItem
*
end
_para
)
ME_DisplayItem
*
last
_para
)
{
ME_Context
c
;
RECT
rc
;
int
ofs
;
ME_DisplayItem
*
item
;
ME_InitContext
(
&
c
,
editor
,
ITextHost_TxGetDC
(
editor
->
texthost
));
rc
=
c
.
rcView
;
ofs
=
editor
->
vert_si
.
nPos
;
item
=
start_para
;
while
(
item
&&
item
!=
end_para
)
{
if
(
item
->
member
.
para
.
nFlags
&
MEPF_REPAINT
)
{
rc
.
top
=
c
.
rcView
.
top
+
item
->
member
.
para
.
pt
.
y
-
ofs
;
rc
.
bottom
=
max
(
rc
.
top
+
item
->
member
.
para
.
nHeight
,
c
.
rcView
.
bottom
);
ITextHost_TxInvalidateRect
(
editor
->
texthost
,
&
rc
,
TRUE
);
item
->
member
.
para
.
nFlags
&=
~
MEPF_REPAINT
;
}
item
=
item
->
member
.
para
.
next_para
;
if
(
start_para
)
{
start_para
=
ME_GetOuterParagraph
(
start_para
);
last_para
=
ME_GetOuterParagraph
(
last_para
);
rc
.
top
=
c
.
rcView
.
top
+
start_para
->
member
.
para
.
pt
.
y
-
ofs
;
}
else
{
rc
.
top
=
c
.
rcView
.
top
+
editor
->
nTotalLength
-
ofs
;
}
if
(
editor
->
nTotalLength
<
editor
->
nLastTotalLength
)
{
rc
.
top
=
c
.
rcView
.
top
+
editor
->
nTotalLength
-
ofs
;
rc
.
bottom
=
c
.
rcView
.
top
+
editor
->
nLastTotalLength
-
ofs
;
else
rc
.
bottom
=
c
.
rcView
.
top
+
last_para
->
member
.
para
.
pt
.
y
+
last_para
->
member
.
para
.
nHeight
-
ofs
;
ITextHost_TxInvalidateRect
(
editor
->
texthost
,
&
rc
,
TRUE
);
}
ME_DestroyContext
(
&
c
);
}
...
...
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