mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
E-book viewer: Fix occasional false warning about highlight being overwritten. Fixes #2003916 [Overlapping highlights not detected properly (inconsistent)](https://bugs.launchpad.net/calibre/+bug/2003916)
all_annots_in_selection should return a list of unique uuids.
This commit is contained in:
parent
40ca12ff39
commit
1fb7f72fd0
@ -65,17 +65,17 @@ def all_annots_in_range(r, annot_id_uuid_map, ans):
|
|||||||
if node.dataset and node.dataset.calibreRangeWrapper:
|
if node.dataset and node.dataset.calibreRangeWrapper:
|
||||||
annot_id = annot_id_uuid_map[node.dataset.calibreRangeWrapper]
|
annot_id = annot_id_uuid_map[node.dataset.calibreRangeWrapper]
|
||||||
if annot_id:
|
if annot_id:
|
||||||
ans.push(annot_id)
|
ans[annot_id] = True
|
||||||
if not is_full_tree and node.isSameNode(r.endContainer):
|
if not is_full_tree and node.isSameNode(r.endContainer):
|
||||||
break
|
break
|
||||||
return ans
|
return ans
|
||||||
|
|
||||||
|
|
||||||
def all_annots_in_selection(sel, annot_id_uuid_map):
|
def all_annots_in_selection(sel, annot_id_uuid_map):
|
||||||
ans = v'[]'
|
ans = v'{}'
|
||||||
for i in range(sel.rangeCount):
|
for i in range(sel.rangeCount):
|
||||||
all_annots_in_range(sel.getRangeAt(i), annot_id_uuid_map, ans)
|
all_annots_in_range(sel.getRangeAt(i), annot_id_uuid_map, ans)
|
||||||
return ans
|
return Object.keys(ans)
|
||||||
|
|
||||||
|
|
||||||
def remove(node):
|
def remove(node):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user