1
0
mirror of https://github.com/elisspace/autopsy.git synced 2026-09-06 02:24:30 +00:00

text view use only up to 1024 chars to detect text direction

This commit is contained in:
adam-m
2012-11-29 16:30:37 -05:00
parent de01eb1485
commit 0b835ecd46

View File

@@ -356,8 +356,10 @@ class ExtractedContentPanel extends javax.swing.JPanel {
text = "";
}
//detect text direction and set it
extractedTextPane.applyComponentOrientation(TextUtil.getTextDirection(text));
//detect text direction using first 1024 chars and set it
final int maxOrientChars = Math.min(text.length(), 1024);
final String orientDetectText = text.substring(0, maxOrientChars);
extractedTextPane.applyComponentOrientation(TextUtil.getTextDirection(orientDetectText));
extractedTextPane.setText(text);
extractedTextPane.setCaretPosition(0);