|
1 | 1 | package org.jabref.gui.journals;
|
2 | 2 |
|
3 |
| -import java.nio.file.Path; |
4 | 3 | import java.util.ArrayList;
|
5 | 4 | import java.util.HashMap;
|
6 | 5 | import java.util.List;
|
@@ -143,17 +142,6 @@ private String unabbreviate(BibDatabaseContext databaseContext, List<BibEntry> e
|
143 | 142 |
|
144 | 143 | JournalAbbreviationRepository freshRepository = getRepository();
|
145 | 144 |
|
146 |
| - Map<String, Boolean> sourceEnabledStates = new HashMap<>(); |
147 |
| - String builtInId = JournalAbbreviationRepository.BUILTIN_LIST_ID; |
148 |
| - sourceEnabledStates.put(builtInId, journalAbbreviationPreferences.isSourceEnabled(builtInId)); |
149 |
| - |
150 |
| - for (String listPath : journalAbbreviationPreferences.getExternalJournalLists()) { |
151 |
| - if (listPath != null && !listPath.isBlank()) { |
152 |
| - String fileName = Path.of(listPath).getFileName().toString(); |
153 |
| - sourceEnabledStates.put(fileName, journalAbbreviationPreferences.isSourceEnabled(fileName)); |
154 |
| - } |
155 |
| - } |
156 |
| - |
157 | 145 | var allAbbreviationsWithSources = freshRepository.getAllAbbreviationsWithSources();
|
158 | 146 | Map<String, List<JournalAbbreviationRepository.AbbreviationWithSource>> textToSourceMap = new HashMap<>();
|
159 | 147 |
|
@@ -181,7 +169,7 @@ private String unabbreviate(BibDatabaseContext databaseContext, List<BibEntry> e
|
181 | 169 | boolean allSourcesDisabled = true;
|
182 | 170 | for (var abbrWithSource : possibleSources) {
|
183 | 171 | String source = abbrWithSource.getSource();
|
184 |
| - if (sourceEnabledStates.getOrDefault(source, true)) { |
| 172 | + if (freshRepository.isSourceEnabled(source)) { |
185 | 173 | allSourcesDisabled = false;
|
186 | 174 | break;
|
187 | 175 | }
|
|
0 commit comments