changeset 4076:c9ddd8e0af54

7030632: Pasting HTML that was copied from MS Word results in IOException Reviewed-by: uta, denis
author dav
date Mon, 25 Apr 2011 21:08:14 +0400
parents c292ec06529f
children 673aa770a062
files src/windows/classes/sun/awt/windows/WDataTransferer.java
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/windows/classes/sun/awt/windows/WDataTransferer.java	Tue Apr 19 18:52:49 2011 +0400
+++ b/src/windows/classes/sun/awt/windows/WDataTransferer.java	Mon Apr 25 21:08:14 2011 +0400
@@ -830,7 +830,14 @@
         if( -1 == iStartOffset ){
             throw new IOException(FAILURE_MSG + "invalid HTML format.");
         }
-        iReadCount = bufferedStream.skip(iStartOffset);
+
+        int curOffset = 0;
+        while (curOffset < iStartOffset){
+            curOffset += bufferedStream.skip(iStartOffset - curOffset);
+        }
+
+        iReadCount = curOffset;
+
         if( iStartOffset != iReadCount ){
             throw new IOException(FAILURE_MSG + "Byte stream ends in description.");
         }