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
bc61a637
Commit
bc61a637
authored
Aug 07, 2008
by
Dylan Smith
Committed by
Alexandre Julliard
Aug 18, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
richedit: Reversed deletion direction so tables are inserted forwards.
parent
d29f671d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
13 deletions
+37
-13
caret.c
dlls/riched20/caret.c
+37
-13
No files found.
dlls/riched20/caret.c
View file @
bc61a637
...
...
@@ -268,6 +268,19 @@ BOOL ME_InternalDeleteText(ME_TextEditor *editor, int nOfs, int nChars,
ME_Cursor
c
;
int
shift
=
0
;
int
totalChars
=
nChars
;
ME_DisplayItem
*
start_para
;
{
/* Prevent deletion past last end of paragraph run. */
ME_DisplayItem
*
pTextEnd
=
editor
->
pBuffer
->
pLast
;
int
nMaxChars
=
pTextEnd
->
member
.
para
.
prev_para
->
member
.
para
.
nCharOfs
;
nMaxChars
+=
ME_FindItemBack
(
pTextEnd
,
diRun
)
->
member
.
run
.
nCharOfs
;
nMaxChars
-=
nOfs
;
nChars
=
min
(
nChars
,
nMaxChars
);
}
ME_CursorFromCharOfs
(
editor
,
nOfs
,
&
c
);
start_para
=
ME_GetParagraph
(
c
.
pRun
);
if
(
!
bForce
)
{
...
...
@@ -279,7 +292,19 @@ BOOL ME_InternalDeleteText(ME_TextEditor *editor, int nOfs, int nChars,
while
(
nChars
>
0
)
{
ME_Run
*
run
;
ME_CursorFromCharOfs
(
editor
,
nOfs
,
&
c
);
ME_CursorFromCharOfs
(
editor
,
nOfs
+
nChars
,
&
c
);
if
(
!
c
.
nOffset
&&
nOfs
+
nChars
==
(
c
.
pRun
->
member
.
run
.
nCharOfs
+
ME_GetParagraph
(
c
.
pRun
)
->
member
.
para
.
nCharOfs
))
{
/* We aren't deleting anything in this run, so we will go back to the
* last run we are deleting text in. */
c
.
pRun
=
ME_FindItemBack
(
c
.
pRun
,
diRun
);
if
(
c
.
pRun
->
member
.
run
.
nFlags
&
MERF_ENDPARA
)
c
.
nOffset
=
c
.
pRun
->
member
.
run
.
nCR
+
c
.
pRun
->
member
.
run
.
nLF
;
else
c
.
nOffset
=
c
.
pRun
->
member
.
run
.
strText
->
nLen
;
}
run
=
&
c
.
pRun
->
member
.
run
;
if
(
run
->
nFlags
&
MERF_ENDPARA
)
{
int
eollen
=
run
->
nCR
+
run
->
nLF
;
...
...
@@ -300,22 +325,21 @@ BOOL ME_InternalDeleteText(ME_TextEditor *editor, int nOfs, int nChars,
else
{
ME_Cursor
cursor
;
int
nIntendedChars
=
nChars
;
int
nCharsToDelete
=
nChars
;
int
nCharsToDelete
=
min
(
nChars
,
c
.
nOffset
);
int
i
;
int
loc
=
c
.
nOffset
;
c
.
nOffset
-=
nCharsToDelete
;
ME_FindItemBack
(
c
.
pRun
,
diParagraph
)
->
member
.
para
.
nFlags
|=
MEPF_REWRAP
;
cursor
=
c
;
ME_StrRelPos
(
run
->
strText
,
loc
,
&
nChars
);
/* nChars is the number of characters that should be deleted from the
FOLLOWING runs (these AFTER
cursor.pRun)
PRECEDING runs (these BEFORE
cursor.pRun)
nCharsToDelete is a number of chars to delete from THIS run */
nChars
ToDelete
-=
nChars
;
nChars
-=
nCharsToDelete
;
shift
-=
nCharsToDelete
;
TRACE
(
"Deleting %d (
intended %d-remaning %d) chars at %d in '%s' (%d)
\n
"
,
nCharsToDelete
,
n
IntendedChars
,
nChars
,
c
.
nOffset
,
TRACE
(
"Deleting %d (
remaning %d) chars at %d in '%s' (%d)
\n
"
,
nCharsToDelete
,
n
Chars
,
c
.
nOffset
,
debugstr_w
(
run
->
strText
->
szData
),
run
->
strText
->
nLen
);
if
(
!
c
.
nOffset
&&
ME_StrVLen
(
run
->
strText
)
==
nCharsToDelete
)
...
...
@@ -325,7 +349,7 @@ BOOL ME_InternalDeleteText(ME_TextEditor *editor, int nOfs, int nChars,
to the current (deleted) run */
ME_UndoItem
*
pUndo
=
ME_AddUndoItem
(
editor
,
diUndoInsertRun
,
c
.
pRun
);
if
(
pUndo
)
pUndo
->
di
.
member
.
run
.
nCharOfs
=
nOfs
;
pUndo
->
di
.
member
.
run
.
nCharOfs
=
nOfs
+
nChars
;
}
else
{
...
...
@@ -333,7 +357,7 @@ BOOL ME_InternalDeleteText(ME_TextEditor *editor, int nOfs, int nChars,
ME_UndoItem
*
pUndo
=
ME_AddUndoItem
(
editor
,
diUndoInsertRun
,
c
.
pRun
);
if
(
pUndo
)
{
ME_DestroyString
(
pUndo
->
di
.
member
.
run
.
strText
);
pUndo
->
di
.
member
.
run
.
nCharOfs
=
nOfs
;
pUndo
->
di
.
member
.
run
.
nCharOfs
=
nOfs
+
nChars
;
pUndo
->
di
.
member
.
run
.
strText
=
ME_MakeStringN
(
run
->
strText
->
szData
+
c
.
nOffset
,
nCharsToDelete
);
}
}
...
...
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