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
39aa3bea
Commit
39aa3bea
authored
Jan 01, 2008
by
Eric Pouech
Committed by
Alexandre Julliard
Jan 02, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
richedit: Simplify first para style handling by creating a context.
parent
d5478118
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
10 deletions
+15
-10
editor.c
dlls/riched20/editor.c
+2
-5
editor.h
dlls/riched20/editor.h
+1
-1
para.c
dlls/riched20/para.c
+12
-4
No files found.
dlls/riched20/editor.c
View file @
39aa3bea
...
@@ -1159,14 +1159,12 @@ static BOOL ME_ShowContextMenu(ME_TextEditor *editor, int x, int y)
...
@@ -1159,14 +1159,12 @@ static BOOL ME_ShowContextMenu(ME_TextEditor *editor, int x, int y)
ME_TextEditor
*
ME_MakeEditor
(
HWND
hWnd
)
{
ME_TextEditor
*
ME_MakeEditor
(
HWND
hWnd
)
{
ME_TextEditor
*
ed
=
ALLOC_OBJ
(
ME_TextEditor
);
ME_TextEditor
*
ed
=
ALLOC_OBJ
(
ME_TextEditor
);
HDC
hDC
;
int
i
;
int
i
;
ed
->
hWnd
=
hWnd
;
ed
->
hWnd
=
hWnd
;
ed
->
bEmulateVersion10
=
FALSE
;
ed
->
bEmulateVersion10
=
FALSE
;
ed
->
pBuffer
=
ME_MakeText
();
ed
->
pBuffer
=
ME_MakeText
();
hDC
=
GetDC
(
hWnd
);
ed
->
nZoomNumerator
=
ed
->
nZoomDenominator
=
0
;
ME_MakeFirstParagraph
(
hDC
,
ed
->
pBuffer
);
ME_MakeFirstParagraph
(
ed
);
ReleaseDC
(
hWnd
,
hDC
);
ed
->
bCaretShown
=
FALSE
;
ed
->
bCaretShown
=
FALSE
;
ed
->
nCursors
=
4
;
ed
->
nCursors
=
4
;
ed
->
pCursors
=
ALLOC_N_OBJ
(
ME_Cursor
,
ed
->
nCursors
);
ed
->
pCursors
=
ALLOC_N_OBJ
(
ME_Cursor
,
ed
->
nCursors
);
...
@@ -1191,7 +1189,6 @@ ME_TextEditor *ME_MakeEditor(HWND hWnd) {
...
@@ -1191,7 +1189,6 @@ ME_TextEditor *ME_MakeEditor(HWND hWnd) {
ed
->
nParagraphs
=
1
;
ed
->
nParagraphs
=
1
;
ed
->
nLastSelStart
=
ed
->
nLastSelEnd
=
0
;
ed
->
nLastSelStart
=
ed
->
nLastSelEnd
=
0
;
ed
->
pLastSelStartPara
=
ed
->
pLastSelEndPara
=
ME_FindItemFwd
(
ed
->
pBuffer
->
pFirst
,
diParagraph
);
ed
->
pLastSelStartPara
=
ed
->
pLastSelEndPara
=
ME_FindItemFwd
(
ed
->
pBuffer
->
pFirst
,
diParagraph
);
ed
->
nZoomNumerator
=
ed
->
nZoomDenominator
=
0
;
ed
->
bRedraw
=
TRUE
;
ed
->
bRedraw
=
TRUE
;
ed
->
bHideSelection
=
FALSE
;
ed
->
bHideSelection
=
FALSE
;
ed
->
nInvalidOfs
=
-
1
;
ed
->
nInvalidOfs
=
-
1
;
...
...
dlls/riched20/editor.h
View file @
39aa3bea
...
@@ -219,7 +219,7 @@ int ME_twips2pointsY(ME_Context *c, int y);
...
@@ -219,7 +219,7 @@ int ME_twips2pointsY(ME_Context *c, int y);
/* para.c */
/* para.c */
ME_DisplayItem
*
ME_GetParagraph
(
ME_DisplayItem
*
run
);
ME_DisplayItem
*
ME_GetParagraph
(
ME_DisplayItem
*
run
);
void
ME_GetSelectionParas
(
ME_TextEditor
*
editor
,
ME_DisplayItem
**
para
,
ME_DisplayItem
**
para_end
);
void
ME_GetSelectionParas
(
ME_TextEditor
*
editor
,
ME_DisplayItem
**
para
,
ME_DisplayItem
**
para_end
);
void
ME_MakeFirstParagraph
(
HDC
hDC
,
ME_TextBuffe
r
*
editor
);
void
ME_MakeFirstParagraph
(
ME_TextEdito
r
*
editor
);
ME_DisplayItem
*
ME_SplitParagraph
(
ME_TextEditor
*
editor
,
ME_DisplayItem
*
rp
,
ME_Style
*
style
);
ME_DisplayItem
*
ME_SplitParagraph
(
ME_TextEditor
*
editor
,
ME_DisplayItem
*
rp
,
ME_Style
*
style
);
ME_DisplayItem
*
ME_JoinParagraphs
(
ME_TextEditor
*
editor
,
ME_DisplayItem
*
tp
);
ME_DisplayItem
*
ME_JoinParagraphs
(
ME_TextEditor
*
editor
,
ME_DisplayItem
*
tp
);
void
ME_DumpParaStyle
(
ME_Paragraph
*
s
);
void
ME_DumpParaStyle
(
ME_Paragraph
*
s
);
...
...
dlls/riched20/para.c
View file @
39aa3bea
...
@@ -25,16 +25,22 @@ WINE_DEFAULT_DEBUG_CHANNEL(richedit);
...
@@ -25,16 +25,22 @@ WINE_DEFAULT_DEBUG_CHANNEL(richedit);
static
const
WCHAR
wszParagraphSign
[]
=
{
0xB6
,
0
};
static
const
WCHAR
wszParagraphSign
[]
=
{
0xB6
,
0
};
void
ME_MakeFirstParagraph
(
HDC
hDC
,
ME_TextBuffer
*
text
)
void
ME_MakeFirstParagraph
(
ME_TextEditor
*
editor
)
{
{
ME_Context
c
;
HDC
hDC
;
PARAFORMAT2
fmt
;
PARAFORMAT2
fmt
;
CHARFORMAT2W
cf
;
CHARFORMAT2W
cf
;
LOGFONTW
lf
;
LOGFONTW
lf
;
HFONT
hf
;
HFONT
hf
;
ME_TextBuffer
*
text
=
editor
->
pBuffer
;
ME_DisplayItem
*
para
=
ME_MakeDI
(
diParagraph
);
ME_DisplayItem
*
para
=
ME_MakeDI
(
diParagraph
);
ME_DisplayItem
*
run
;
ME_DisplayItem
*
run
;
ME_Style
*
style
;
ME_Style
*
style
;
hDC
=
GetDC
(
editor
->
hWnd
);
ME_InitContext
(
&
c
,
editor
,
hDC
);
hf
=
(
HFONT
)
GetStockObject
(
SYSTEM_FONT
);
hf
=
(
HFONT
)
GetStockObject
(
SYSTEM_FONT
);
assert
(
hf
);
assert
(
hf
);
GetObjectW
(
hf
,
sizeof
(
LOGFONTW
),
&
lf
);
GetObjectW
(
hf
,
sizeof
(
LOGFONTW
),
&
lf
);
...
@@ -48,9 +54,8 @@ void ME_MakeFirstParagraph(HDC hDC, ME_TextBuffer *text)
...
@@ -48,9 +54,8 @@ void ME_MakeFirstParagraph(HDC hDC, ME_TextBuffer *text)
cf
.
dwEffects
=
CFE_AUTOCOLOR
|
CFE_AUTOBACKCOLOR
;
cf
.
dwEffects
=
CFE_AUTOCOLOR
|
CFE_AUTOBACKCOLOR
;
lstrcpyW
(
cf
.
szFaceName
,
lf
.
lfFaceName
);
lstrcpyW
(
cf
.
szFaceName
,
lf
.
lfFaceName
);
cf
.
yHeight
=
lf
.
lfHeight
*
1440
/
GetDeviceCaps
(
hDC
,
LOGPIXELSY
);
cf
.
yHeight
=
ME_twips2pointsY
(
&
c
,
lf
.
lfHeight
);
if
(
lf
.
lfWeight
>=
700
)
/* FIXME correct weight ? */
if
(
lf
.
lfWeight
>=
700
)
cf
.
dwEffects
|=
CFE_BOLD
;
cf
.
dwEffects
|=
CFE_BOLD
;
cf
.
wWeight
=
lf
.
lfWeight
;
cf
.
wWeight
=
lf
.
lfWeight
;
if
(
lf
.
lfItalic
)
cf
.
dwEffects
|=
CFE_ITALIC
;
if
(
lf
.
lfItalic
)
cf
.
dwEffects
|=
CFE_ITALIC
;
cf
.
bUnderlineType
=
(
lf
.
lfUnderline
)
?
CFU_CF1UNDERLINE
:
CFU_UNDERLINENONE
;
cf
.
bUnderlineType
=
(
lf
.
lfUnderline
)
?
CFU_CF1UNDERLINE
:
CFU_UNDERLINENONE
;
...
@@ -79,6 +84,9 @@ void ME_MakeFirstParagraph(HDC hDC, ME_TextBuffer *text)
...
@@ -79,6 +84,9 @@ void ME_MakeFirstParagraph(HDC hDC, ME_TextBuffer *text)
text
->
pLast
->
member
.
para
.
prev_para
=
para
;
text
->
pLast
->
member
.
para
.
prev_para
=
para
;
text
->
pLast
->
member
.
para
.
nCharOfs
=
1
;
text
->
pLast
->
member
.
para
.
nCharOfs
=
1
;
ME_DestroyContext
(
&
c
);
ReleaseDC
(
editor
->
hWnd
,
hDC
);
}
}
void
ME_MarkAllForWrapping
(
ME_TextEditor
*
editor
)
void
ME_MarkAllForWrapping
(
ME_TextEditor
*
editor
)
...
...
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