提交 7e500f20 编写于 作者: S son

6607163: Linux: Cannot copy image from Java to OpenOffice

Summary: TARGETS should have type ATOM
Reviewed-by: denis
上级 6d4eea74
/* /*
* Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -281,8 +281,10 @@ public class XSelection { ...@@ -281,8 +281,10 @@ public class XSelection {
if (targetsGetter.isExecuted() && !targetsGetter.isDisposed() && if (targetsGetter.isExecuted() && !targetsGetter.isDisposed() &&
(targetsGetter.getActualType() == XAtom.XA_ATOM || (targetsGetter.getActualType() == XAtom.XA_ATOM ||
targetsGetter.getActualType() == XDataTransferer.TARGETS_ATOM.getAtom()) && targetsGetter.getActualType() == XDataTransferer.TARGETS_ATOM.getAtom()) &&
targetsGetter.getActualFormat() == 32) { targetsGetter.getActualFormat() == 32)
{
// we accept property with TARGETS type to be compatible with old jdks
// see 6607163
int count = (int)targetsGetter.getNumberOfItems(); int count = (int)targetsGetter.getNumberOfItems();
if (count > 0) { if (count > 0) {
long atoms = targetsGetter.getData(); long atoms = targetsGetter.getData();
...@@ -687,7 +689,7 @@ public class XSelection { ...@@ -687,7 +689,7 @@ public class XSelection {
XToolkit.awtLock(); XToolkit.awtLock();
try { try {
XlibWrapper.XChangeProperty(XToolkit.getDisplay(), requestor, XlibWrapper.XChangeProperty(XToolkit.getDisplay(), requestor,
property, format, dataFormat, property, XAtom.XA_ATOM, dataFormat,
XlibWrapper.PropModeReplace, XlibWrapper.PropModeReplace,
nativeDataPtr, count); nativeDataPtr, count);
} finally { } finally {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册