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
aa4b29b9
Commit
aa4b29b9
authored
Sep 27, 2016
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Always go through Unicode for clipboard strings.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8493fc78
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
48 deletions
+11
-48
clipboard.c
dlls/winex11.drv/clipboard.c
+11
-48
No files found.
dlls/winex11.drv/clipboard.c
View file @
aa4b29b9
...
...
@@ -152,8 +152,10 @@ static const struct
EXPORTFUNC
export
;
}
builtin_formats
[]
=
{
{
0
,
CF_TEXT
,
XA_STRING
,
import_string
,
export_string
},
{
0
,
CF_TEXT
,
XATOM_text_plain
,
import_string
,
export_string
},
{
0
,
CF_UNICODETEXT
,
XATOM_UTF8_STRING
,
import_utf8_string
,
export_utf8_string
},
{
0
,
CF_UNICODETEXT
,
XATOM_COMPOUND_TEXT
,
import_compound_text
,
export_compound_text
},
{
0
,
CF_UNICODETEXT
,
XA_STRING
,
import_string
,
export_string
},
{
0
,
CF_UNICODETEXT
,
XATOM_text_plain
,
import_string
,
export_string
},
{
0
,
CF_BITMAP
,
XATOM_WCF_BITMAP
,
import_data
,
NULL
},
{
0
,
CF_METAFILEPICT
,
XATOM_WCF_METAFILEPICT
,
import_metafile
,
export_metafile
},
{
0
,
CF_SYLK
,
XATOM_WCF_SYLK
,
import_data
,
export_data
},
...
...
@@ -165,8 +167,6 @@ static const struct
{
0
,
CF_PENDATA
,
XATOM_WCF_PENDATA
,
import_data
,
export_data
},
{
0
,
CF_RIFF
,
XATOM_WCF_RIFF
,
import_data
,
export_data
},
{
0
,
CF_WAVE
,
XATOM_WCF_WAVE
,
import_data
,
export_data
},
{
0
,
CF_UNICODETEXT
,
XATOM_UTF8_STRING
,
import_utf8_string
,
export_utf8_string
},
{
0
,
CF_UNICODETEXT
,
XATOM_COMPOUND_TEXT
,
import_compound_text
,
export_compound_text
},
{
0
,
CF_ENHMETAFILE
,
XATOM_WCF_ENHMETAFILE
,
import_enhmetafile
,
export_enhmetafile
},
{
0
,
CF_HDROP
,
XATOM_text_uri_list
,
import_text_uri_list
,
export_hdrop
},
{
0
,
CF_LOCALE
,
XATOM_WCF_LOCALE
,
import_data
,
export_data
},
...
...
@@ -683,32 +683,11 @@ static HANDLE unicode_text_from_string( UINT codepage, const void *data, size_t
/**************************************************************************
* import_string
*
*
Import XA_STRING, converting the string to CF_
TEXT.
*
Import XA_STRING, converting the string to CF_UNICODE
TEXT.
*/
static
HANDLE
import_string
(
Atom
type
,
const
void
*
data
,
size_t
size
)
{
const
char
*
lpdata
=
data
;
LPSTR
lpstr
;
size_t
i
,
inlcount
=
0
;
for
(
i
=
0
;
i
<
size
;
i
++
)
{
if
(
lpdata
[
i
]
==
'\n'
)
inlcount
++
;
}
if
((
lpstr
=
GlobalAlloc
(
GMEM_FIXED
,
size
+
inlcount
+
1
)))
{
for
(
i
=
0
,
inlcount
=
0
;
i
<
size
;
i
++
)
{
if
(
lpdata
[
i
]
==
'\n'
)
lpstr
[
inlcount
++
]
=
'\r'
;
lpstr
[
inlcount
++
]
=
lpdata
[
i
];
}
lpstr
[
inlcount
]
=
0
;
}
return
lpstr
;
return
unicode_text_from_string
(
28591
,
data
,
size
);
}
...
...
@@ -1130,32 +1109,16 @@ static char *string_from_unicode_text( UINT codepage, HANDLE handle, UINT *size
/**************************************************************************
* export_string
*
*
Export CF_
TEXT converting the string to XA_STRING.
*
Export CF_UNICODE
TEXT converting the string to XA_STRING.
*/
static
BOOL
export_string
(
Display
*
display
,
Window
win
,
Atom
prop
,
Atom
target
,
HANDLE
handle
)
{
UINT
i
,
j
;
UINT
size
;
LPSTR
text
,
lpstr
=
NULL
;
text
=
GlobalLock
(
handle
);
size
=
strlen
(
text
);
char
*
text
=
string_from_unicode_text
(
28591
,
handle
,
&
size
);
/* remove carriage returns */
lpstr
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
size
+
1
);
if
(
lpstr
==
NULL
)
{
GlobalUnlock
(
handle
);
return
FALSE
;
}
for
(
i
=
0
,
j
=
0
;
i
<
size
&&
text
[
i
];
i
++
)
{
if
(
text
[
i
]
==
'\r'
&&
(
text
[
i
+
1
]
==
'\n'
||
text
[
i
+
1
]
==
'\0'
))
continue
;
lpstr
[
j
++
]
=
text
[
i
];
}
put_property
(
display
,
win
,
prop
,
target
,
8
,
lpstr
,
j
);
HeapFree
(
GetProcessHeap
(),
0
,
lpstr
);
if
(
!
text
)
return
FALSE
;
put_property
(
display
,
win
,
prop
,
target
,
8
,
text
,
size
);
HeapFree
(
GetProcessHeap
(),
0
,
text
);
GlobalUnlock
(
handle
);
return
TRUE
;
}
...
...
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