fixing the copy-paste issue for the translation tool.

This commit is contained in:
amontano 2002-10-26 18:15:34 +00:00
parent b6b8cd73ff
commit 7336d27a33

View file

@ -954,6 +954,17 @@ public void paste(int offset) {
rtfEd.read(in, sd, 0);
/** Added by AM, to fix copy-paste issues for Translation Tool.
Assumes that if roman is disabled and you are pasting something
in RTF but is not TibetanMachineWeb it most be wylie.
*/
if (!sd.getFont((sd.getCharacterElement(0).getAttributes())).getFamily().equals("TibetanMachineWeb") && !isRomanEnabled && contents.isDataFlavorSupported(DataFlavor.stringFlavor))
{
String data = (String)contents.getTransferData(DataFlavor.stringFlavor);
toTibetanMachineWeb(data, offset);
}
else
{
for (int i=0; i<sd.getLength()-1; i++) { //getLength()-1 so that final newline is not included in paste
try {
String s = sd.getText(i,1);
@ -964,6 +975,7 @@ public void paste(int offset) {
ThdlDebug.noteIffyCode();
}
}
}
} else if (contents.isDataFlavorSupported(DataFlavor.stringFlavor))
{
if (!isRomanEnabled) {