Oobranch g : add actions#7792
Conversation
Brings oobranch-E up to 89b0968 @ origin/improve-reversibility-rebased-03 Merge remote-tracking branch 'upstream/main' into improve-reversibility-rebased-03
commit cb13256 (HEAD -> improve-reversibility-rebased-03, origin/improve-reversibility-rebased-03) Author: Antal K <antalk2@gmail.com> Date: Fri Aug 20 11:39:39 2021 +0200 align dots
|
Sorry @antalk2 for taking so long reading through your PRs. |
|
OK. Thank you. |
|
One general preliminary issue I see is that we don't have all the open office actions integrated in our command infrastructure, so we cannot see any telemetry on this or undo/redo this in the gui. |
calixtus
left a comment
There was a problem hiding this comment.
Finally had time to do some reviewing. Got some smaller issues. Thanks for your work!
|
|
||
| List<String> citationKeys = OOListUtil.map(entries, EditInsert::insertEntryGetCitationKey); | ||
|
|
||
| final int nEntries = entries.size(); |
There was a problem hiding this comment.
Please avoid abbreviations for variables.
| final int nEntries = entries.size(); | |
| final int totalEntries = entries.size(); |
| OOText citeText = | ||
| (style.isNumberEntries() | ||
| ? OOText.fromString("[-]") // A dash only. Only refresh later. | ||
| : style.createCitationMarker(citations, | ||
| citationType.inParenthesis(), | ||
| NonUniqueCitationMarker.FORGIVEN)); |
There was a problem hiding this comment.
On more complex if clauses, please avoid ? : for better readability
There was a problem hiding this comment.
Changed to
OOText citeText = null;
if (style.isNumberEntries()) {
citeText = OOText.fromString("[-]"); // A dash only. Only refresh later.
} else {
citeText = style.createCitationMarker(citations,
citationType.inParenthesis(),
NonUniqueCitationMarker.FORGIVEN);
}
| citationType.inParenthesis(), | ||
| NonUniqueCitationMarker.FORGIVEN)); | ||
|
|
||
| if ("".equals(OOText.toString(citeText))) { |
|
|
||
| for (JoinableGroupData joinableGroupData : joinableGroups) { | ||
|
|
||
| List<CitationGroup> cgs = joinableGroupData.group; |
There was a problem hiding this comment.
ok. Renamed to groups
|
|
||
| // assume: currentGroupCursor.getEnd() == cursorBetween.getEnd() | ||
| if (UnoTextRange.compareEnds(state.cursorBetween, state.currentGroupCursor) != 0) { | ||
| String msg = ("MergeCitationGroups: cursorBetween.end != currentGroupCursor.end"); |
There was a problem hiding this comment.
Can be inlined.
Please avoid technical details in error messages, thats up for debug or logger. End user must be able to understand why this fails.
There was a problem hiding this comment.
Changed to
LOGGER.warn("MergeCitationGroups: cursorBetween.end != currentGroupCursor.end (during expand)");
throw new IllegalStateException("MergeCitationGroups failed");
End user must be able to understand why this fails.
It would be nice, if I did. Failures around here happened due to
using visual order with two-column layout and/or viewing two pages side-by-side.
This could provide an order of groups that did not respect XText boundaries and/or the textual order within.
Now this should not happen, scan calls frontend.getCitationGroupsSortedWithinPartitions(doc, false) to
get the groups.
- Turning on "Record changes" with or without "Show changes" can result in behaviour I do not really understand.
OOBibBase2.checkIfOpenOfficeIsRecordingChangesis intended to check against this. - Something else? There might be, I am not sure. I hope not, but testing anyway, so we get at least a warning
if the assumptions fail here.
In the end, I cannot tell why did the test fail, only that it did.
| frontend.citationGroups.lookupCitations(databases); | ||
| frontend.citationGroups.imposeLocalOrder(OOProcess.comparatorForMulticite(style)); | ||
|
|
||
| List<CitationGroup> cgs = frontend.citationGroups.getCitationGroupsUnordered(); |
There was a problem hiding this comment.
changed cgs to groups
| .orElseThrow(IllegalStateException::new)); | ||
| XTextCursor textCursor = range1.getText().createTextCursorByRange(range1); | ||
|
|
||
| List<Citation> cits = group.citationsInStorageOrder; |
There was a problem hiding this comment.
cits -> citations
cit -> citation
| CitedKeys cks = frontend.citationGroups.getCitedKeysUnordered(); | ||
| cks.lookupInDatabases(databases); |
| List<BibEntry> entriesToInsert = new ArrayList<>(); | ||
| Set<String> seen = new HashSet<>(); // Only add crossReference once. | ||
|
|
||
| for (CitedKey ck : cks.values()) { |
There was a problem hiding this comment.
| for (CitedKey ck : cks.values()) { | |
| for (CitedKey citation : citationKeys.values()) { |
| WrappedTargetException, | ||
| com.sun.star.lang.IllegalArgumentException { | ||
|
|
||
| final boolean useLockControllers = true; |
There was a problem hiding this comment.
If this is a debug constant, it should be
| final boolean useLockControllers = true; | |
| static final boolean USE_LOCK_CONTROLLERS = true; |
|
Grobid test fails, not related |
|
Sorry, that it took us so long to review your code. We will continue reviewing the other branches now |
* upstream/main: (181 commits) Add of ADRs 22 and 23 (#8256) [Bot] Update CSL styles (#8245) Replace styfle/cancel-workflow-action@0.9.1 by GitHub's "concurrency" feature (#8243) Bump gittools/actions from 0.9.10 to 0.9.11 (#8248) Bump commons-cli from 1.4 to 1.5.0 (#8250) Bump byte-buddy-parent from 1.12.0 to 1.12.1 (#8249) Bump antlr4 from 4.9.2 to 4.9.3 (#8251) Bump archunit-junit5-api from 0.21.0 to 0.22.0 (#8252) Fix search: NOT binds more than AND (#8241) New Crowdin updates (#8240) Make PdfGrobiImporterTest as FetcherTest Oobranch g : add actions (#7792) Fix mixed CRLF / CR (#8238) Fix "Library has changed externally" with CRLF markers (#8239) Fix for issue 8198, 8133 (#8229) Added more unit tests in AuthorTest (#8214) Add confirmation dialog for empty entries in JabRef (#8218) Fix entry editor column visibility (#8232) Use regexp to remove non-ASCII characters from DOI and inform user when data for valid DOI does not exist #8127 (#8228) Fix exception for search flags (#8237) ...
Adds actions: GUI independent part of actions to be provided from the GUI.