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
4e56a3cd
Commit
4e56a3cd
authored
Aug 04, 2008
by
Dylan Smith
Committed by
Alexandre Julliard
Aug 05, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
richedit: Joined paragraph format depends on number of characters deleted.
parent
11c80396
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
11 deletions
+22
-11
caret.c
dlls/riched20/caret.c
+5
-1
editor.h
dlls/riched20/editor.h
+2
-1
para.c
dlls/riched20/para.c
+8
-4
undo.c
dlls/riched20/undo.c
+7
-5
No files found.
dlls/riched20/caret.c
View file @
4e56a3cd
...
...
@@ -267,6 +267,7 @@ void ME_InternalDeleteText(ME_TextEditor *editor, int nOfs,
{
ME_Cursor
c
;
int
shift
=
0
;
int
totalChars
=
nChars
;
while
(
nChars
>
0
)
{
...
...
@@ -275,12 +276,15 @@ void ME_InternalDeleteText(ME_TextEditor *editor, int nOfs,
run
=
&
c
.
pRun
->
member
.
run
;
if
(
run
->
nFlags
&
MERF_ENDPARA
)
{
int
eollen
=
run
->
nCR
+
run
->
nLF
;
BOOL
keepFirstParaFormat
;
if
(
!
ME_FindItemFwd
(
c
.
pRun
,
diParagraph
))
{
return
;
}
ME_JoinParagraphs
(
editor
,
ME_GetParagraph
(
c
.
pRun
));
keepFirstParaFormat
=
(
totalChars
==
nChars
&&
nChars
<=
eollen
&&
run
->
nCharOfs
);
ME_JoinParagraphs
(
editor
,
ME_GetParagraph
(
c
.
pRun
),
keepFirstParaFormat
);
/* ME_SkipAndPropagateCharOffset(p->pRun, shift); */
ME_CheckCharOffsets
(
editor
);
nChars
-=
(
eollen
<
nChars
)
?
eollen
:
nChars
;
...
...
dlls/riched20/editor.h
View file @
4e56a3cd
...
...
@@ -218,7 +218,8 @@ ME_DisplayItem *ME_GetParagraph(ME_DisplayItem *run);
void
ME_GetSelectionParas
(
ME_TextEditor
*
editor
,
ME_DisplayItem
**
para
,
ME_DisplayItem
**
para_end
);
void
ME_MakeFirstParagraph
(
ME_TextEditor
*
editor
);
ME_DisplayItem
*
ME_SplitParagraph
(
ME_TextEditor
*
editor
,
ME_DisplayItem
*
rp
,
ME_Style
*
style
,
int
numCR
,
int
numLF
);
ME_DisplayItem
*
ME_JoinParagraphs
(
ME_TextEditor
*
editor
,
ME_DisplayItem
*
tp
);
ME_DisplayItem
*
ME_JoinParagraphs
(
ME_TextEditor
*
editor
,
ME_DisplayItem
*
tp
,
BOOL
keepFirstParaFormat
);
void
ME_DumpParaStyle
(
ME_Paragraph
*
s
);
void
ME_DumpParaStyleToBuf
(
const
PARAFORMAT2
*
pFmt
,
char
buf
[
2048
]);
void
ME_SetParaFormat
(
ME_TextEditor
*
editor
,
ME_DisplayItem
*
para
,
const
PARAFORMAT2
*
pFmt
);
...
...
dlls/riched20/para.c
View file @
4e56a3cd
...
...
@@ -167,7 +167,8 @@ ME_DisplayItem *ME_SplitParagraph(ME_TextEditor *editor, ME_DisplayItem *run, ME
/* join tp with tp->member.para.next_para, keeping tp's style; this
* is consistent with the original */
ME_DisplayItem
*
ME_JoinParagraphs
(
ME_TextEditor
*
editor
,
ME_DisplayItem
*
tp
)
ME_DisplayItem
*
ME_JoinParagraphs
(
ME_TextEditor
*
editor
,
ME_DisplayItem
*
tp
,
BOOL
keepFirstParaFormat
)
{
ME_DisplayItem
*
pNext
,
*
pFirstRunInNext
,
*
pRun
,
*
pTmp
;
int
i
,
shift
;
...
...
@@ -195,14 +196,17 @@ ME_DisplayItem *ME_JoinParagraphs(ME_TextEditor *editor, ME_DisplayItem *tp)
ME_InitCharFormat2W
(
&
fmt
);
ME_SetCharFormat
(
editor
,
pNext
->
member
.
para
.
nCharOfs
-
end_len
,
end_len
,
&
fmt
);
}
undo
=
ME_AddUndoItem
(
editor
,
diUndoSplitParagraph
,
NULL
);
undo
=
ME_AddUndoItem
(
editor
,
diUndoSplitParagraph
,
pNext
);
if
(
undo
)
{
undo
->
nStart
=
pNext
->
member
.
para
.
nCharOfs
-
end_len
;
undo
->
nCR
=
pRun
->
member
.
run
.
nCR
;
undo
->
nLF
=
pRun
->
member
.
run
.
nLF
;
assert
(
pNext
->
member
.
para
.
pFmt
->
cbSize
==
sizeof
(
PARAFORMAT2
));
*
undo
->
di
.
member
.
para
.
pFmt
=
*
pNext
->
member
.
para
.
pFmt
;
}
if
(
!
keepFirstParaFormat
)
{
ME_AddUndoItem
(
editor
,
diUndoSetParagraphFormat
,
tp
);
*
tp
->
member
.
para
.
pFmt
=
*
pNext
->
member
.
para
.
pFmt
;
}
shift
=
pNext
->
member
.
para
.
nCharOfs
-
tp
->
member
.
para
.
nCharOfs
-
end_len
;
...
...
dlls/riched20/undo.c
View file @
4e56a3cd
...
...
@@ -89,10 +89,9 @@ ME_UndoItem *ME_AddUndoItem(ME_TextEditor *editor, ME_DIType type, const ME_Disp
case
diUndoJoinParagraphs
:
break
;
case
diUndoSplitParagraph
:
assert
(
pdi
->
member
.
para
.
pFmt
->
cbSize
==
sizeof
(
PARAFORMAT2
));
pItem
->
member
.
para
.
pFmt
=
ALLOC_OBJ
(
PARAFORMAT2
);
pItem
->
member
.
para
.
pFmt
->
cbSize
=
sizeof
(
PARAFORMAT2
);
pItem
->
member
.
para
.
pFmt
->
dwMask
=
0
;
*
pItem
->
member
.
para
.
pFmt
=
*
pdi
->
member
.
para
.
pFmt
;
break
;
default:
assert
(
0
==
"AddUndoItem, unsupported item type"
);
...
...
@@ -282,8 +281,11 @@ static void ME_PlayUndoItem(ME_TextEditor *editor, ME_DisplayItem *pItem)
case
diUndoSetParagraphFormat
:
{
ME_Cursor
tmp
;
ME_DisplayItem
*
para
;
ME_CursorFromCharOfs
(
editor
,
pItem
->
member
.
para
.
nCharOfs
,
&
tmp
);
ME_SetParaFormat
(
editor
,
ME_FindItemBack
(
tmp
.
pRun
,
diParagraph
),
pItem
->
member
.
para
.
pFmt
);
para
=
ME_FindItemBack
(
tmp
.
pRun
,
diParagraph
);
ME_AddUndoItem
(
editor
,
diUndoSetParagraphFormat
,
para
);
*
para
->
member
.
para
.
pFmt
=
*
pItem
->
member
.
para
.
pFmt
;
break
;
}
case
diUndoSetCharFormat
:
...
...
@@ -306,7 +308,7 @@ static void ME_PlayUndoItem(ME_TextEditor *editor, ME_DisplayItem *pItem)
ME_Cursor
tmp
;
ME_CursorFromCharOfs
(
editor
,
pUItem
->
nStart
,
&
tmp
);
/* the only thing that's needed is paragraph offset, so no need to split runs */
ME_JoinParagraphs
(
editor
,
ME_GetParagraph
(
tmp
.
pRun
));
ME_JoinParagraphs
(
editor
,
ME_GetParagraph
(
tmp
.
pRun
)
,
TRUE
);
break
;
}
case
diUndoSplitParagraph
:
...
...
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