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
15768f85
Commit
15768f85
authored
Oct 19, 2006
by
Huw Davies
Committed by
Alexandre Julliard
Oct 20, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oledlg: Update the result text.
parent
0019f3bb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
68 additions
and
1 deletion
+68
-1
pastespl.c
dlls/oledlg/pastespl.c
+68
-1
No files found.
dlls/oledlg/pastespl.c
View file @
15768f85
...
...
@@ -32,8 +32,10 @@
#include "oledlg.h"
#include "oledlg_private.h"
#include "resource.h"
#include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
ole
);
...
...
@@ -288,6 +290,60 @@ static void init_lists(HWND hdlg, ps_struct_t *ps_struct)
EnableWindow
(
GetDlgItem
(
hdlg
,
IDOK
),
0
);
}
static
void
update_result_text
(
HWND
hdlg
,
ps_struct_t
*
ps_struct
)
{
WCHAR
resource_txt
[
200
];
UINT
res_id
;
OLEUIPASTEENTRYW
*
pent
;
LONG
cur_sel
;
static
const
WCHAR
percent_s
[]
=
{
'%'
,
's'
,
0
};
WCHAR
*
result_txt
,
*
ptr
;
cur_sel
=
SendMessageW
(
GetDlgItem
(
hdlg
,
IDC_PS_DISPLAYLIST
),
LB_GETCURSEL
,
0
,
0
);
if
(
cur_sel
==
-
1
)
return
;
pent
=
(
OLEUIPASTEENTRYW
*
)
SendMessageW
(
GetDlgItem
(
hdlg
,
IDC_PS_DISPLAYLIST
),
LB_GETITEMDATA
,
cur_sel
,
0
);
if
(
ps_struct
->
flags
&
PSF_SELECTPASTE
)
{
if
(
ps_struct
->
flags
&
PSF_CHECKDISPLAYASICON
)
res_id
=
IDS_PS_PASTE_OBJECT_AS_ICON
;
else
res_id
=
IDS_PS_PASTE_DATA
;
}
else
{
if
(
ps_struct
->
flags
&
PSF_CHECKDISPLAYASICON
)
res_id
=
IDS_PS_PASTE_LINK_OBJECT_AS_ICON
;
else
res_id
=
IDS_PS_PASTE_LINK_DATA
;
}
LoadStringW
(
OLEDLG_hInstance
,
res_id
,
resource_txt
,
sizeof
(
resource_txt
)
/
sizeof
(
WCHAR
));
if
((
ptr
=
strstrW
(
resource_txt
,
percent_s
)))
{
/* FIXME handle %s in ResultText. Sub appname if IDS_PS_PASTE_OBJECT{_AS_ICON}. Else sub appropiate type name */
size_t
result_txt_len
=
strlenW
(
pent
->
lpstrResultText
);
ptrdiff_t
offs
=
(
char
*
)
ptr
-
(
char
*
)
resource_txt
;
result_txt
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
strlenW
(
resource_txt
)
+
result_txt_len
-
1
)
*
sizeof
(
WCHAR
));
memcpy
(
result_txt
,
resource_txt
,
offs
);
memcpy
((
char
*
)
result_txt
+
offs
,
pent
->
lpstrResultText
,
result_txt_len
*
sizeof
(
WCHAR
));
memcpy
((
char
*
)
result_txt
+
offs
+
result_txt_len
*
sizeof
(
WCHAR
),
ptr
+
2
,
(
strlenW
(
ptr
+
2
)
+
1
)
*
sizeof
(
WCHAR
));
}
else
result_txt
=
resource_txt
;
SetDlgItemTextW
(
hdlg
,
IDC_PS_RESULTTEXT
,
result_txt
);
if
(
result_txt
!=
resource_txt
)
HeapFree
(
GetProcessHeap
(),
0
,
result_txt
);
}
static
void
selection_change
(
HWND
hdlg
,
ps_struct_t
*
ps_struct
)
{
update_result_text
(
hdlg
,
ps_struct
);
}
static
void
post_help_msg
(
HWND
hdlg
,
ps_struct_t
*
ps_struct
)
{
PostMessageW
(
ps_struct
->
ps
->
hWndOwner
,
oleui_msg_help
,
(
WPARAM
)
hdlg
,
IDD_PASTESPECIAL
);
...
...
@@ -342,16 +398,27 @@ static INT_PTR CALLBACK ps_dlg_proc(HWND hdlg, UINT msg, WPARAM wp, LPARAM lp)
EnableWindow
(
GetDlgItem
(
hdlg
,
IDC_OLEUIHELP
),
0
);
}
if
(
ps_struct
->
ps
->
lpszCaption
)
if
(
ps_struct
->
ps
->
lpszCaption
)
SetWindowTextW
(
hdlg
,
ps_struct
->
ps
->
lpszCaption
);
init_lists
(
hdlg
,
ps_struct
);
selection_change
(
hdlg
,
ps_struct
);
return
TRUE
;
/* use default focus */
}
case
WM_COMMAND
:
switch
(
LOWORD
(
wp
))
{
case
IDC_PS_DISPLAYLIST
:
switch
(
HIWORD
(
wp
))
{
case
LBN_SELCHANGE
:
selection_change
(
hdlg
,
ps_struct
);
return
FALSE
;
default:
return
FALSE
;
}
case
IDC_OLEUIHELP
:
switch
(
HIWORD
(
wp
))
{
...
...
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