Changed paste so that if (isRomanEnabled = false),

it will assume the text is Wylie and convert it to
Tibetan.
This commit is contained in:
eg3p 2002-10-25 17:34:30 +00:00
parent d211930e68
commit d45a58e1ba

View file

@ -930,7 +930,13 @@ public void paste(int offset) {
return; return;
try { try {
Transferable contents = rtfBoard.getContents(this); 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); InputStream in = (InputStream)contents.getTransferData(rtfFlavor);
int p1 = offset; int p1 = offset;
@ -942,6 +948,7 @@ public void paste(int offset) {
ThdlDebug.verify(null != in); ThdlDebug.verify(null != in);
rtfEd.read(in, sd, 0); rtfEd.read(in, sd, 0);
for (int i=0; i<sd.getLength()-1; i++) { //getLength()-1 so that final newline is not included in paste for (int i=0; i<sd.getLength()-1; i++) { //getLength()-1 so that final newline is not included in paste
try { try {
String s = sd.getText(i,1); String s = sd.getText(i,1);