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
3d1d65bc
Commit
3d1d65bc
authored
Jul 04, 2016
by
Huw Davies
Committed by
Alexandre Julliard
Jul 04, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Add an option to constrain the run search to the current para.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b05aa34f
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
17 deletions
+21
-17
caret.c
dlls/riched20/caret.c
+2
-2
editor.c
dlls/riched20/editor.c
+5
-5
editor.h
dlls/riched20/editor.h
+2
-2
list.c
dlls/riched20/list.c
+10
-6
para.c
dlls/riched20/para.c
+1
-1
writer.c
dlls/riched20/writer.c
+1
-1
No files found.
dlls/riched20/caret.c
View file @
3d1d65bc
...
...
@@ -331,7 +331,7 @@ BOOL ME_InternalDeleteText(ME_TextEditor *editor, ME_Cursor *start,
{
/* We aren't deleting anything in this run, so we will go back to the
* last run we are deleting text in. */
ME_PrevRun
(
&
c
.
pPara
,
&
c
.
pRun
);
ME_PrevRun
(
&
c
.
pPara
,
&
c
.
pRun
,
TRUE
);
c
.
nOffset
=
c
.
pRun
->
member
.
run
.
len
;
}
run
=
&
c
.
pRun
->
member
.
run
;
...
...
@@ -1245,7 +1245,7 @@ ME_MoveCursorLines(ME_TextEditor *editor, ME_Cursor *pCursor, int nRelOfs)
int
x
=
ME_GetXForArrow
(
editor
,
pCursor
);
if
(
editor
->
bCaretAtEnd
&&
!
pCursor
->
nOffset
)
if
(
!
ME_PrevRun
(
&
pOldPara
,
&
pRun
))
if
(
!
ME_PrevRun
(
&
pOldPara
,
&
pRun
,
TRUE
))
return
;
if
(
nRelOfs
==
-
1
)
...
...
dlls/riched20/editor.c
View file @
3d1d65bc
...
...
@@ -1863,7 +1863,7 @@ ME_FindText(ME_TextEditor *editor, DWORD flags, const CHARRANGE *chrg, const WCH
cursor
.
nOffset
++
;
if
(
cursor
.
nOffset
==
cursor
.
pRun
->
member
.
run
.
len
)
{
ME_NextRun
(
&
cursor
.
pPara
,
&
cursor
.
pRun
);
ME_NextRun
(
&
cursor
.
pPara
,
&
cursor
.
pRun
,
TRUE
);
cursor
.
nOffset
=
0
;
}
}
...
...
@@ -1889,7 +1889,7 @@ ME_FindText(ME_TextEditor *editor, DWORD flags, const CHARRANGE *chrg, const WCH
if
(
nCurEnd
==
0
)
{
ME_PrevRun
(
&
pCurPara
,
&
pCurItem
);
ME_PrevRun
(
&
pCurPara
,
&
pCurItem
,
TRUE
);
nCurEnd
=
pCurItem
->
member
.
run
.
len
;
}
...
...
@@ -1938,7 +1938,7 @@ ME_FindText(ME_TextEditor *editor, DWORD flags, const CHARRANGE *chrg, const WCH
}
if
(
nCurEnd
-
nMatched
==
0
)
{
ME_PrevRun
(
&
pCurPara
,
&
pCurItem
);
ME_PrevRun
(
&
pCurPara
,
&
pCurItem
,
TRUE
);
/* Don't care about pCurItem becoming NULL here; it's already taken
* care of in the exterior loop condition */
nCurEnd
=
pCurItem
->
member
.
run
.
len
+
nMatched
;
...
...
@@ -1952,7 +1952,7 @@ ME_FindText(ME_TextEditor *editor, DWORD flags, const CHARRANGE *chrg, const WCH
cursor
.
nOffset
--
;
if
(
cursor
.
nOffset
<
0
)
{
ME_PrevRun
(
&
cursor
.
pPara
,
&
cursor
.
pRun
);
ME_PrevRun
(
&
cursor
.
pPara
,
&
cursor
.
pRun
,
TRUE
);
cursor
.
nOffset
=
cursor
.
pRun
->
member
.
run
.
len
;
}
}
...
...
@@ -5109,7 +5109,7 @@ static BOOL ME_FindNextURLCandidate(ME_TextEditor *editor,
}
cursor
.
nOffset
=
0
;
if
(
!
ME_NextRun
(
&
cursor
.
pPara
,
&
cursor
.
pRun
))
if
(
!
ME_NextRun
(
&
cursor
.
pPara
,
&
cursor
.
pRun
,
TRUE
))
goto
done
;
}
...
...
dlls/riched20/editor.h
View file @
3d1d65bc
...
...
@@ -88,8 +88,8 @@ void ME_CharFormatFromLogFont(HDC hDC, const LOGFONTW *lf, CHARFORMAT2W *fmt) DE
/* list.c */
void
ME_InsertBefore
(
ME_DisplayItem
*
diWhere
,
ME_DisplayItem
*
diWhat
)
DECLSPEC_HIDDEN
;
void
ME_Remove
(
ME_DisplayItem
*
diWhere
)
DECLSPEC_HIDDEN
;
BOOL
ME_NextRun
(
ME_DisplayItem
**
para
,
ME_DisplayItem
**
run
)
DECLSPEC_HIDDEN
;
BOOL
ME_PrevRun
(
ME_DisplayItem
**
para
,
ME_DisplayItem
**
run
)
DECLSPEC_HIDDEN
;
BOOL
ME_NextRun
(
ME_DisplayItem
**
para
,
ME_DisplayItem
**
run
,
BOOL
all_para
)
DECLSPEC_HIDDEN
;
BOOL
ME_PrevRun
(
ME_DisplayItem
**
para
,
ME_DisplayItem
**
run
,
BOOL
all_para
)
DECLSPEC_HIDDEN
;
ME_DisplayItem
*
ME_FindItemBack
(
ME_DisplayItem
*
di
,
ME_DIType
nTypeOrClass
)
DECLSPEC_HIDDEN
;
ME_DisplayItem
*
ME_FindItemFwd
(
ME_DisplayItem
*
di
,
ME_DIType
nTypeOrClass
)
DECLSPEC_HIDDEN
;
ME_DisplayItem
*
ME_FindItemBackOrHere
(
ME_DisplayItem
*
di
,
ME_DIType
nTypeOrClass
)
DECLSPEC_HIDDEN
;
...
...
dlls/riched20/list.c
View file @
3d1d65bc
...
...
@@ -63,16 +63,18 @@ static BOOL ME_DITypesEqual(ME_DIType type, ME_DIType nTypeOrClass)
}
}
/* Modifies run pointer to point to the next run, and modify the
* paragraph pointer if moving into the next paragraph.
/* Modifies run pointer to point to the next run.
* If all_para is FALSE constrain the search to the current para,
* otherwise modify the paragraph pointer if moving into the next paragraph.
*
* Returns TRUE if next run is found, otherwise returns FALSE. */
BOOL
ME_NextRun
(
ME_DisplayItem
**
para
,
ME_DisplayItem
**
run
)
BOOL
ME_NextRun
(
ME_DisplayItem
**
para
,
ME_DisplayItem
**
run
,
BOOL
all_para
)
{
ME_DisplayItem
*
p
=
(
*
run
)
->
next
;
while
(
p
->
type
!=
diTextEnd
)
{
if
(
p
->
type
==
diParagraph
)
{
if
(
!
all_para
)
return
FALSE
;
*
para
=
p
;
}
else
if
(
p
->
type
==
diRun
)
{
*
run
=
p
;
...
...
@@ -83,16 +85,18 @@ BOOL ME_NextRun(ME_DisplayItem **para, ME_DisplayItem **run)
return
FALSE
;
}
/* Modifies run pointer to point to the previous run, and modify the
* paragraph pointer if moving into the previous paragraph.
/* Modifies run pointer to point to the previous run.
* If all_para is FALSE constrain the search to the current para,
* otherwise modify the paragraph pointer if moving into the previous paragraph.
*
* Returns TRUE if previous run is found, otherwise returns FALSE. */
BOOL
ME_PrevRun
(
ME_DisplayItem
**
para
,
ME_DisplayItem
**
run
)
BOOL
ME_PrevRun
(
ME_DisplayItem
**
para
,
ME_DisplayItem
**
run
,
BOOL
all_para
)
{
ME_DisplayItem
*
p
=
(
*
run
)
->
prev
;
while
(
p
->
type
!=
diTextStart
)
{
if
(
p
->
type
==
diParagraph
)
{
if
(
!
all_para
)
return
FALSE
;
if
(
p
->
member
.
para
.
prev_para
->
type
==
diParagraph
)
*
para
=
p
->
member
.
para
.
prev_para
;
}
else
if
(
p
->
type
==
diRun
)
{
...
...
dlls/riched20/para.c
View file @
3d1d65bc
...
...
@@ -364,7 +364,7 @@ ME_DisplayItem *ME_JoinParagraphs(ME_TextEditor *editor, ME_DisplayItem *tp,
endCur
.
pRun
=
ME_FindItemFwd
(
pNext
,
diRun
);
endCur
.
nOffset
=
0
;
startCur
=
endCur
;
ME_PrevRun
(
&
startCur
.
pPara
,
&
startCur
.
pRun
);
ME_PrevRun
(
&
startCur
.
pPara
,
&
startCur
.
pRun
,
TRUE
);
ME_SetCharFormat
(
editor
,
&
startCur
,
&
endCur
,
&
fmt
);
if
(
!
editor
->
bEmulateVersion10
)
{
/* v4.1 */
...
...
dlls/riched20/writer.c
View file @
3d1d65bc
...
...
@@ -981,7 +981,7 @@ static BOOL ME_StreamOutRTF(ME_TextEditor *editor, ME_OutStream *pStream,
if
(
!
ME_StreamOutPrint
(
pStream
,
"}"
))
return
FALSE
;
}
}
while
(
cursor
.
pRun
!=
endCur
.
pRun
&&
ME_NextRun
(
&
cursor
.
pPara
,
&
cursor
.
pRun
));
}
while
(
cursor
.
pRun
!=
endCur
.
pRun
&&
ME_NextRun
(
&
cursor
.
pPara
,
&
cursor
.
pRun
,
TRUE
));
if
(
!
ME_StreamOutMove
(
pStream
,
"}
\0
"
,
2
))
return
FALSE
;
...
...
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