From d45a58e1baaa99cfa53798ddba8f74f318cfddf9 Mon Sep 17 00:00:00 2001 From: eg3p Date: Fri, 25 Oct 2002 17:34:30 +0000 Subject: [PATCH] Changed paste so that if (isRomanEnabled = false), it will assume the text is Wylie and convert it to Tibetan. --- source/org/thdl/tib/input/DuffPane.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/source/org/thdl/tib/input/DuffPane.java b/source/org/thdl/tib/input/DuffPane.java index 040da92..923da1f 100644 --- a/source/org/thdl/tib/input/DuffPane.java +++ b/source/org/thdl/tib/input/DuffPane.java @@ -930,7 +930,13 @@ public void paste(int offset) { return; try { Transferable contents = rtfBoard.getContents(this); - if (contents.isDataFlavorSupported(rtfFlavor)) { + + if (!isRomanEnabled || !contents.isDataFlavorSupported(rtfFlavor)) { + if (contents.isDataFlavorSupported(DataFlavor.stringFlavor)) { + String data = (String)contents.getTransferData(DataFlavor.stringFlavor); + doc.toTibetanMachineWeb(data, offset); + } + } else { InputStream in = (InputStream)contents.getTransferData(rtfFlavor); int p1 = offset; @@ -942,6 +948,7 @@ public void paste(int offset) { ThdlDebug.verify(null != in); rtfEd.read(in, sd, 0); + for (int i=0; i