mirror of
https://github.com/gnustep/libs-back.git
synced 2025-02-24 04:11:28 +00:00
[XPbOwner xSelectionNotify:] and [XPbOwner xProvideSelection:]
explicit conversion of transferd strings from/to NSISOLatin1StringEncoding. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@17229 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
71cd037415
commit
a08ee18c50
1 changed files with 14 additions and 5 deletions
19
Tools/xpbs.m
19
Tools/xpbs.m
|
@ -804,8 +804,13 @@ xErrorHandler(Display *d, XErrorEvent *e)
|
||||||
NSData *d;
|
NSData *d;
|
||||||
NSString *s;
|
NSString *s;
|
||||||
|
|
||||||
s = [NSString stringWithCString: data];
|
d = [[NSData alloc] initWithBytes: (void*)data
|
||||||
|
length: number_items];
|
||||||
|
s = [[NSString alloc] initWithData: d
|
||||||
|
encoding: NSISOLatin1StringEncoding];
|
||||||
|
RELEASE(d);
|
||||||
d = [NSSerializer serializePropertyList: s];
|
d = [NSSerializer serializePropertyList: s];
|
||||||
|
RELEASE(s);
|
||||||
[self setData: d];
|
[self setData: d];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -959,12 +964,16 @@ xErrorHandler(Display *d, XErrorEvent *e)
|
||||||
if ([osType isEqualToString: NSStringPboardType])
|
if ([osType isEqualToString: NSStringPboardType])
|
||||||
{
|
{
|
||||||
NSString *s = [_pb stringForType: NSStringPboardType];
|
NSString *s = [_pb stringForType: NSStringPboardType];
|
||||||
|
NSData *d = [s dataUsingEncoding: NSISOLatin1StringEncoding];
|
||||||
|
|
||||||
format = 8;
|
format = 8;
|
||||||
numItems = [s cStringLength];
|
if (d != nil)
|
||||||
data = malloc(numItems + 1);
|
{
|
||||||
if (data)
|
numItems = [d length];
|
||||||
[s getCString: data];
|
data = malloc(numItems + 1);
|
||||||
|
if (data)
|
||||||
|
[d getBytes: data];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue