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
5cc8c9fe
Commit
5cc8c9fe
authored
Aug 21, 2017
by
Huw Davies
Committed by
Alexandre Julliard
Aug 24, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Retrieve the default paragraph alignment from the text host.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4cb7578d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
13 deletions
+30
-13
editor.c
dlls/riched20/editor.c
+2
-7
editor.h
dlls/riched20/editor.h
+1
-1
editstr.h
dlls/riched20/editstr.h
+0
-1
para.c
dlls/riched20/para.c
+13
-1
txthost.c
dlls/riched20/txthost.c
+13
-2
txtsrv.c
dlls/riched20/txtsrv.c
+1
-1
No files found.
dlls/riched20/editor.c
View file @
5cc8c9fe
...
...
@@ -2884,7 +2884,7 @@ static BOOL ME_ShowContextMenu(ME_TextEditor *editor, int x, int y)
return
TRUE
;
}
ME_TextEditor
*
ME_MakeEditor
(
ITextHost
*
texthost
,
BOOL
bEmulateVersion10
,
DWORD
csStyle
)
ME_TextEditor
*
ME_MakeEditor
(
ITextHost
*
texthost
,
BOOL
bEmulateVersion10
)
{
ME_TextEditor
*
ed
=
ALLOC_OBJ
(
ME_TextEditor
);
int
i
;
...
...
@@ -2898,11 +2898,6 @@ ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10, DWORD
ed
->
reOle
=
NULL
;
ed
->
bEmulateVersion10
=
bEmulateVersion10
;
ed
->
styleFlags
=
0
;
ed
->
alignStyle
=
PFA_LEFT
;
if
(
csStyle
&
ES_RIGHT
)
ed
->
alignStyle
=
PFA_RIGHT
;
if
(
csStyle
&
ES_CENTER
)
ed
->
alignStyle
=
PFA_CENTER
;
ITextHost_TxGetPropertyBits
(
texthost
,
(
TXTBIT_RICHTEXT
|
TXTBIT_MULTILINE
|
TXTBIT_READONLY
|
TXTBIT_USEPASSWORD
|
...
...
@@ -4799,7 +4794,7 @@ static BOOL create_windowed_editor(HWND hwnd, CREATESTRUCTW *create, BOOL emulat
if
(
!
host
)
return
FALSE
;
editor
=
ME_MakeEditor
(
host
,
emulate_10
,
create
->
style
);
editor
=
ME_MakeEditor
(
host
,
emulate_10
);
if
(
!
editor
)
{
ITextHost_Release
(
host
);
...
...
dlls/riched20/editor.h
View file @
5cc8c9fe
...
...
@@ -255,7 +255,7 @@ void ME_DeleteReObject(REOBJECT* reo) DECLSPEC_HIDDEN;
void
ME_GetITextDocumentInterface
(
IRichEditOle
*
iface
,
LPVOID
*
ppvObj
)
DECLSPEC_HIDDEN
;
/* editor.c */
ME_TextEditor
*
ME_MakeEditor
(
ITextHost
*
texthost
,
BOOL
bEmulateVersion10
,
DWORD
csStyle
)
DECLSPEC_HIDDEN
;
ME_TextEditor
*
ME_MakeEditor
(
ITextHost
*
texthost
,
BOOL
bEmulateVersion10
)
DECLSPEC_HIDDEN
;
void
ME_DestroyEditor
(
ME_TextEditor
*
editor
)
DECLSPEC_HIDDEN
;
LRESULT
ME_HandleMessage
(
ME_TextEditor
*
editor
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
,
BOOL
unicode
,
HRESULT
*
phresult
)
DECLSPEC_HIDDEN
;
...
...
dlls/riched20/editstr.h
View file @
5cc8c9fe
...
...
@@ -382,7 +382,6 @@ typedef struct tagME_TextEditor
ME_TextBuffer
*
pBuffer
;
ME_Cursor
*
pCursors
;
DWORD
styleFlags
;
DWORD
alignStyle
;
DWORD
exStyleFlags
;
int
nCursors
;
SIZE
sizeWindow
;
...
...
dlls/riched20/para.c
View file @
5cc8c9fe
...
...
@@ -863,10 +863,22 @@ void ME_GetSelectionParaFormat(ME_TextEditor *editor, PARAFORMAT2 *pFmt)
void
ME_SetDefaultParaFormat
(
ME_TextEditor
*
editor
,
PARAFORMAT2
*
pFmt
)
{
const
PARAFORMAT2
*
host_fmt
;
HRESULT
hr
;
ZeroMemory
(
pFmt
,
sizeof
(
PARAFORMAT2
));
pFmt
->
cbSize
=
sizeof
(
PARAFORMAT2
);
pFmt
->
dwMask
=
PFM_ALL2
;
pFmt
->
wAlignment
=
editor
->
alignStyle
;
pFmt
->
wAlignment
=
PFA_LEFT
;
pFmt
->
sStyle
=
-
1
;
pFmt
->
bOutlineLevel
=
TRUE
;
hr
=
ITextHost_TxGetParaFormat
(
editor
->
texthost
,
(
const
PARAFORMAT
**
)
&
host_fmt
);
if
(
SUCCEEDED
(
hr
))
{
/* Just use the alignment for now */
if
(
host_fmt
->
dwMask
&
PFM_ALIGNMENT
)
pFmt
->
wAlignment
=
host_fmt
->
wAlignment
;
ITextHost_OnTxParaFormatChange
(
editor
->
texthost
,
(
PARAFORMAT
*
)
pFmt
);
}
}
dlls/riched20/txthost.c
View file @
5cc8c9fe
...
...
@@ -38,6 +38,7 @@ typedef struct ITextHostImpl {
LONG
ref
;
HWND
hWnd
;
BOOL
bEmulateVersion10
;
PARAFORMAT2
para_fmt
;
}
ITextHostImpl
;
static
const
ITextHostVtbl
textHostVtbl
;
...
...
@@ -53,6 +54,14 @@ ITextHost *ME_CreateTextHost(HWND hwnd, CREATESTRUCTW *cs, BOOL bEmulateVersion1
texthost
->
ref
=
1
;
texthost
->
hWnd
=
hwnd
;
texthost
->
bEmulateVersion10
=
bEmulateVersion10
;
memset
(
&
texthost
->
para_fmt
,
0
,
sizeof
(
texthost
->
para_fmt
)
);
texthost
->
para_fmt
.
cbSize
=
sizeof
(
texthost
->
para_fmt
);
texthost
->
para_fmt
.
dwMask
=
PFM_ALIGNMENT
;
texthost
->
para_fmt
.
wAlignment
=
PFA_LEFT
;
if
(
cs
->
style
&
ES_RIGHT
)
texthost
->
para_fmt
.
wAlignment
=
PFA_RIGHT
;
if
(
cs
->
style
&
ES_CENTER
)
texthost
->
para_fmt
.
wAlignment
=
PFA_CENTER
;
return
&
texthost
->
ITextHost_iface
;
}
...
...
@@ -260,9 +269,11 @@ DECLSPEC_HIDDEN HRESULT WINAPI ITextHostImpl_TxGetCharFormat(ITextHost *iface,
}
DECLSPEC_HIDDEN
HRESULT
WINAPI
ITextHostImpl_TxGetParaFormat
(
ITextHost
*
iface
,
const
PARAFORMAT
**
ppPF
)
const
PARAFORMAT
**
fmt
)
{
return
E_NOTIMPL
;
ITextHostImpl
*
This
=
impl_from_ITextHost
(
iface
);
*
fmt
=
(
const
PARAFORMAT
*
)
&
This
->
para_fmt
;
return
S_OK
;
}
DECLSPEC_HIDDEN
COLORREF
WINAPI
ITextHostImpl_TxGetSysColor
(
ITextHost
*
iface
,
...
...
dlls/riched20/txtsrv.c
View file @
5cc8c9fe
...
...
@@ -413,7 +413,7 @@ HRESULT WINAPI CreateTextServices(IUnknown *pUnkOuter, ITextHost *pITextHost, I
ITextImpl
->
pMyHost
=
pITextHost
;
ITextImpl
->
IUnknown_inner
.
lpVtbl
=
&
textservices_inner_vtbl
;
ITextImpl
->
ITextServices_iface
.
lpVtbl
=
&
textservices_vtbl
;
ITextImpl
->
editor
=
ME_MakeEditor
(
pITextHost
,
FALSE
,
ES_LEFT
);
ITextImpl
->
editor
=
ME_MakeEditor
(
pITextHost
,
FALSE
);
ITextImpl
->
editor
->
exStyleFlags
=
0
;
SetRectEmpty
(
&
ITextImpl
->
editor
->
rcFormat
);
...
...
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