Skip to content

Commit

Permalink
Fix editing last footnote citation in a doc with a bibliography
Browse files Browse the repository at this point in the history
  • Loading branch information
simonster committed Aug 22, 2015
1 parent d17b99f commit 527380c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions build/zoteroWinWordIntegration/document.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,14 +358,14 @@ statusCode __stdcall cursorInField(document_t *doc, const wchar_t fieldType[],
long rangeStartIndex = range.get_Start();
long rangeEndIndex = rangeEnd.get_Start();
if (rangeStartIndex == selectionStart ||
rangeEndIndex == selectionEnd) {
rangeEndIndex <= selectionEnd) {
CStoryRanges storyRanges = doc->comDoc.get_StoryRanges();
CRange storyRange = storyRanges.Item(selectionStoryType);
range = storyRange.get_Duplicate();
if (rangeStartIndex != selectionStart) {
range.put_Start(rangeStartIndex);
}
if (rangeEndIndex == selectionEnd) {
if (rangeEndIndex <= selectionEnd) {
rangeEndIndex = range.get_End();
}
}
Expand Down Expand Up @@ -397,10 +397,7 @@ statusCode __stdcall cursorInField(document_t *doc, const wchar_t fieldType[],

// If there is no overlap, continue
if (testFieldCode.get_StoryType() != selectionStoryType ||
(testFieldStart > selectionStart && testFieldEnd > selectionEnd &&
testFieldStart > selectionEnd && testFieldEnd > selectionEnd) ||
(testFieldStart < selectionStart && testFieldEnd < selectionEnd &&
testFieldStart < selectionEnd && testFieldEnd < selectionEnd)) continue;
testFieldStart > selectionEnd || testFieldEnd < selectionStart) continue;

// Otherwise, check for an appropriate code
statusCode status = initField(doc, testField, -1, false, returnValue);
Expand Down
Binary file modified resource/libzoteroWinWordIntegration.dll
Binary file not shown.

0 comments on commit 527380c

Please sign in to comment.