Skip to content

Commit

Permalink
[LO extension] grammar check dialog: solves a format problem at activ…
Browse files Browse the repository at this point in the history
…ate rule
  • Loading branch information
FredKruse committed Mar 3, 2023
1 parent 710349d commit f39b2a2
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ public class LtCheckDialog implements ActionListener {

private final static int dialogWidth = 640;
private final static int dialogHeight = 600;

private final static int MAX_ITEM_LENGTH = 28;
private UndoMarkupContainer undoMarkup;

private Color defaultForeground;
Expand Down Expand Up @@ -1755,7 +1755,11 @@ private void gotoNextError(boolean startAtBegin) {
activateRule.removeAllItems();
activateRule.addItem(messages.getString("loContextMenuActivateRule"));
for (String ruleId : deactivatedRulesMap.keySet()) {
activateRule.addItem(deactivatedRulesMap.get(ruleId));
String tmpStr = deactivatedRulesMap.get(ruleId);
if (tmpStr.length() > MAX_ITEM_LENGTH) {
tmpStr = tmpStr.substring(0, MAX_ITEM_LENGTH - 3) + "...";
}
activateRule.addItem(tmpStr);
}
activateRule.setVisible(true);
activateRule.setEnabled(true);
Expand Down Expand Up @@ -1836,7 +1840,11 @@ private void setUserDictionaries () {
userDictionaries = new String[tmpDictionaries.length + 1];
userDictionaries[0] = addToDictionaryName;
for (int i = 0; i < tmpDictionaries.length; i++) {
userDictionaries[i + 1] = tmpDictionaries[i];
String tmpStr = tmpDictionaries[i];
if (tmpStr.length() > MAX_ITEM_LENGTH) {
tmpStr = tmpStr.substring(0, MAX_ITEM_LENGTH - 3) + "...";
}
userDictionaries[i + 1] = tmpStr;
}
}

Expand Down

0 comments on commit f39b2a2

Please sign in to comment.