From a2e8acca393a7be98e728edd8fcecbecf1dd7b3c Mon Sep 17 00:00:00 2001 From: amontano Date: Fri, 25 Oct 2002 17:59:27 +0000 Subject: [PATCH] almost working but not quite --- source/org/thdl/tib/input/DuffPane.java | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/source/org/thdl/tib/input/DuffPane.java b/source/org/thdl/tib/input/DuffPane.java index 923da1f..2e01e0c 100644 --- a/source/org/thdl/tib/input/DuffPane.java +++ b/source/org/thdl/tib/input/DuffPane.java @@ -931,12 +931,7 @@ public void paste(int offset) { try { Transferable contents = rtfBoard.getContents(this); - if (!isRomanEnabled || !contents.isDataFlavorSupported(rtfFlavor)) { - if (contents.isDataFlavorSupported(DataFlavor.stringFlavor)) { - String data = (String)contents.getTransferData(DataFlavor.stringFlavor); - doc.toTibetanMachineWeb(data, offset); - } - } else { + if (contents.isDataFlavorSupported(rtfFlavor)){ InputStream in = (InputStream)contents.getTransferData(rtfFlavor); int p1 = offset; @@ -959,9 +954,17 @@ public void paste(int offset) { ThdlDebug.noteIffyCode(); } } - } else if (contents.isDataFlavorSupported(DataFlavor.stringFlavor)) { - String s = (String)contents.getTransferData(DataFlavor.stringFlavor); - replaceSelection(s); + } else if (contents.isDataFlavorSupported(DataFlavor.stringFlavor)) + { + if (!isRomanEnabled) { + String data = (String)contents.getTransferData(DataFlavor.stringFlavor); + toTibetanMachineWeb(data, offset); + } + else + { + String s = (String)contents.getTransferData(DataFlavor.stringFlavor); + replaceSelection(s); + } } } catch (UnsupportedFlavorException ufe) { ufe.printStackTrace();