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
Hide 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)
ME_TextEditor
*
ME_MakeEditor
(
HWND
hWnd
)
{
ME_TextEditor
*
ed
=
ALLOC_OBJ
(
ME_TextEditor
);
HDC
hDC
;
int
i
;
ed
->
hWnd
=
hWnd
;
ed
->
bEmulateVersion10
=
FALSE
;
ed
->
pBuffer
=
ME_MakeText
();
hDC
=
GetDC
(
hWnd
);
ME_MakeFirstParagraph
(
hDC
,
ed
->
pBuffer
);
ReleaseDC
(
hWnd
,
hDC
);
ed
->
nZoomNumerator
=
ed
->
nZoomDenominator
=
0
;
ME_MakeFirstParagraph
(
ed
);
ed
->
bCaretShown
=
FALSE
;
ed
->
nCursors
=
4
;
ed
->
pCursors
=
ALLOC_N_OBJ
(
ME_Cursor
,
ed
->
nCursors
);
...
...
@@ -1191,7 +1189,6 @@ ME_TextEditor *ME_MakeEditor(HWND hWnd) {
ed
->
nParagraphs
=
1
;
ed
->
nLastSelStart
=
ed
->
nLastSelEnd
=
0
;
ed
->
pLastSelStartPara
=
ed
->
pLastSelEndPara
=
ME_FindItemFwd
(
ed
->
pBuffer
->
pFirst
,
diParagraph
);
ed
->
nZoomNumerator
=
ed
->
nZoomDenominator
=
0
;
ed
->
bRedraw
=
TRUE
;
ed
->
bHideSelection
=
FALSE
;
ed
->
nInvalidOfs
=
-
1
;
...
...
dlls/riched20/editor.h
View file @
39aa3bea
...
...
@@ -219,7 +219,7 @@ int ME_twips2pointsY(ME_Context *c, int y);
/* para.c */
ME_DisplayItem
*
ME_GetParagraph
(
ME_DisplayItem
*
run
);
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_JoinParagraphs
(
ME_TextEditor
*
editor
,
ME_DisplayItem
*
tp
);
void
ME_DumpParaStyle
(
ME_Paragraph
*
s
);
...
...
dlls/riched20/para.c
View file @
39aa3bea
...
...
@@ -25,16 +25,22 @@ WINE_DEFAULT_DEBUG_CHANNEL(richedit);
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
;
CHARFORMAT2W
cf
;
LOGFONTW
lf
;
HFONT
hf
;
ME_TextBuffer
*
text
=
editor
->
pBuffer
;
ME_DisplayItem
*
para
=
ME_MakeDI
(
diParagraph
);
ME_DisplayItem
*
run
;
ME_Style
*
style
;
hDC
=
GetDC
(
editor
->
hWnd
);
ME_InitContext
(
&
c
,
editor
,
hDC
);
hf
=
(
HFONT
)
GetStockObject
(
SYSTEM_FONT
);
assert
(
hf
);
GetObjectW
(
hf
,
sizeof
(
LOGFONTW
),
&
lf
);
...
...
@@ -48,9 +54,8 @@ void ME_MakeFirstParagraph(HDC hDC, ME_TextBuffer *text)
cf
.
dwEffects
=
CFE_AUTOCOLOR
|
CFE_AUTOBACKCOLOR
;
lstrcpyW
(
cf
.
szFaceName
,
lf
.
lfFaceName
);
cf
.
yHeight
=
lf
.
lfHeight
*
1440
/
GetDeviceCaps
(
hDC
,
LOGPIXELSY
);
if
(
lf
.
lfWeight
>=
700
)
/* FIXME correct weight ? */
cf
.
dwEffects
|=
CFE_BOLD
;
cf
.
yHeight
=
ME_twips2pointsY
(
&
c
,
lf
.
lfHeight
);
if
(
lf
.
lfWeight
>=
700
)
cf
.
dwEffects
|=
CFE_BOLD
;
cf
.
wWeight
=
lf
.
lfWeight
;
if
(
lf
.
lfItalic
)
cf
.
dwEffects
|=
CFE_ITALIC
;
cf
.
bUnderlineType
=
(
lf
.
lfUnderline
)
?
CFU_CF1UNDERLINE
:
CFU_UNDERLINENONE
;
...
...
@@ -79,6 +84,9 @@ void ME_MakeFirstParagraph(HDC hDC, ME_TextBuffer *text)
text
->
pLast
->
member
.
para
.
prev_para
=
para
;
text
->
pLast
->
member
.
para
.
nCharOfs
=
1
;
ME_DestroyContext
(
&
c
);
ReleaseDC
(
editor
->
hWnd
,
hDC
);
}
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