fixing the copy-paste issue for the translation tool.
This commit is contained in:
parent
b6b8cd73ff
commit
7336d27a33
1 changed files with 22 additions and 10 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue