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
245fbfe0
Commit
245fbfe0
authored
May 21, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
May 24, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac: Use CFSTR_INETURLW instead of deprecated CFSTR_SHELLURLW.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
parent
96e9359f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
83 deletions
+1
-83
clipboard.c
dlls/winemac.drv/clipboard.c
+1
-83
No files found.
dlls/winemac.drv/clipboard.c
View file @
245fbfe0
...
...
@@ -71,7 +71,6 @@ static HANDLE import_bmp_to_dib(CFDataRef data);
static
HANDLE
import_enhmetafile
(
CFDataRef
data
);
static
HANDLE
import_html
(
CFDataRef
data
);
static
HANDLE
import_nsfilenames_to_hdrop
(
CFDataRef
data
);
static
HANDLE
import_utf8_to_text
(
CFDataRef
data
);
static
HANDLE
import_utf8_to_unicodetext
(
CFDataRef
data
);
static
HANDLE
import_utf16_to_unicodetext
(
CFDataRef
data
);
...
...
@@ -80,7 +79,6 @@ static CFDataRef export_dib_to_bmp(HANDLE data);
static
CFDataRef
export_enhmetafile
(
HANDLE
data
);
static
CFDataRef
export_hdrop_to_filenames
(
HANDLE
data
);
static
CFDataRef
export_html
(
HANDLE
data
);
static
CFDataRef
export_text_to_utf8
(
HANDLE
data
);
static
CFDataRef
export_unicodetext_to_utf8
(
HANDLE
data
);
static
CFDataRef
export_unicodetext_to_utf16
(
HANDLE
data
);
...
...
@@ -182,7 +180,7 @@ static const struct
{
wszPNG
,
CFSTR
(
"public.png"
),
import_clipboard_data
,
export_clipboard_data
},
{
wszHTMLFormat
,
NULL
,
import_clipboard_data
,
export_clipboard_data
},
{
wszHTMLFormat
,
CFSTR
(
"public.html"
),
import_html
,
export_html
,
TRUE
},
{
CFSTR_
SHELLURLW
,
CFSTR
(
"public.url"
),
import_utf8_to_text
,
export_
text_to_utf8
},
{
CFSTR_
INETURLW
,
CFSTR
(
"public.url"
),
import_utf8_to_unicodetext
,
export_unicode
text_to_utf8
},
};
/* The prefix prepended to a Win32 clipboard format name to make a Mac pasteboard type. */
...
...
@@ -726,45 +724,6 @@ done:
/**************************************************************************
* import_utf8_to_text
*
* Import a UTF-8 string, converting the string to CF_TEXT.
*/
static
HANDLE
import_utf8_to_text
(
CFDataRef
data
)
{
HANDLE
ret
=
NULL
;
HANDLE
unicode_handle
=
import_utf8_to_unicodetext
(
data
);
LPWSTR
unicode_string
=
GlobalLock
(
unicode_handle
);
if
(
unicode_string
)
{
int
unicode_len
;
HANDLE
handle
;
char
*
p
;
INT
len
;
unicode_len
=
GlobalSize
(
unicode_handle
)
/
sizeof
(
WCHAR
);
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
unicode_string
,
unicode_len
,
NULL
,
0
,
NULL
,
NULL
);
if
(
!
unicode_len
||
unicode_string
[
unicode_len
-
1
])
len
+=
1
;
handle
=
GlobalAlloc
(
GMEM_FIXED
,
len
);
if
(
handle
&&
(
p
=
GlobalLock
(
handle
)))
{
WideCharToMultiByte
(
CP_ACP
,
0
,
unicode_string
,
unicode_len
,
p
,
len
,
NULL
,
NULL
);
p
[
len
-
1
]
=
0
;
GlobalUnlock
(
handle
);
ret
=
handle
;
}
GlobalUnlock
(
unicode_handle
);
}
GlobalFree
(
unicode_handle
);
return
ret
;
}
/**************************************************************************
* import_utf8_to_unicodetext
*
* Import a UTF-8 string, converting the string to CF_UNICODETEXT.
...
...
@@ -1084,47 +1043,6 @@ failed:
/**************************************************************************
* export_text_to_utf8
*
* Export CF_TEXT to UTF-8.
*/
static
CFDataRef
export_text_to_utf8
(
HANDLE
data
)
{
CFDataRef
ret
=
NULL
;
const
char
*
str
;
if
((
str
=
GlobalLock
(
data
)))
{
int
str_len
=
GlobalSize
(
data
);
int
wstr_len
;
WCHAR
*
wstr
;
HANDLE
unicode
;
char
*
p
;
wstr_len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
str_len
,
NULL
,
0
);
if
(
!
str_len
||
str
[
str_len
-
1
])
wstr_len
+=
1
;
wstr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
wstr_len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
str_len
,
wstr
,
wstr_len
);
wstr
[
wstr_len
-
1
]
=
0
;
unicode
=
GlobalAlloc
(
GMEM_FIXED
,
wstr_len
*
sizeof
(
WCHAR
));
if
(
unicode
&&
(
p
=
GlobalLock
(
unicode
)))
{
memcpy
(
p
,
wstr
,
wstr_len
*
sizeof
(
WCHAR
));
GlobalUnlock
(
unicode
);
}
ret
=
export_unicodetext_to_utf8
(
unicode
);
GlobalFree
(
unicode
);
GlobalUnlock
(
data
);
}
return
ret
;
}
/**************************************************************************
* export_unicodetext_to_utf8
*
* Export CF_UNICODETEXT to UTF-8.
...
...
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