-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ApiRange.GetAllParagraphs - Returns more paragraphs than actually in the range. #2920
Comments
Hi, @hdijkema! I created a table and added bookmarks for two cells in column 2 (I used scripts below for it) var oDocument = Api.GetDocument();
var oRange = oDocument.GetRangeBySelect();
oRange.SetHighlight('yellow')
oRange.AddBookmark('Bookmark1'); var oDocument = Api.GetDocument();
var oRange = oDocument.GetRangeBySelect();
oRange.SetHighlight('green')
oRange.AddBookmark('Bookmark2'); After that I selected a text in the third cell and checked intersections in Colsole tab in DevTools. oDocument.GetAllBookmarksNames();
oRange1 = oDocument.GetBookmarkRange('Bookmark1');
oRange2 = oDocument.GetBookmarkRange('Bookmark2');
oRange3 = oDocument.GetRangeBySelect();
oRange1.IntersectWith(oRange2);
oRange1.IntersectWith(oRange3);
oRange2.IntersectWith(oRange1);
oRange2.IntersectWith(oRange3);
oRange3.IntersectWith(oRange1);
oRange3.IntersectWith(oRange2); All intersections returned null Could you send a more details about your issue? Attach your script if possible. |
I see what you have done, but this is not exactly the situation I tried to make clear. Please look at the picture below: I integrated a plugin that when you click on the element in the "flower" at the right, the bookmark is 'selected' in the document at the left. You can see that the selected range, i.e. the bookmark, consists of text in two cells of the table. You created two bookmarks in two different cells. I created one bookmark that ranges text in two cells. (You also see a green rectangle, that is a hack on the caret position that blinks on and of green when the document scrolls to the selected bookmark, to make more clear where the selected bookmark is on the screen). |
Hi, @hdijkema! |
See also #2990 |
This issue is unique.
Operating System of DocumentServer
Windows Server, Linux (DEB package), Docker
Version information
8.0.1
Expected Behavior
Look at the picture below.
The highlighted text is a bookmark. This bookmark has a range and if I select that range, I'll get the highlighted text selected.
Also the range has been highlighted and that goes well.
Now, I want to check if the range of the bookmark intersects with the selected text ('And' in the picture).
If I check that with the Intersect method, I do not get 'null' as an output.. Instead, I get a new range.
I requested all paragraphs of the range and suddenly, this paragraph with 'And' in it is part of the range.
That's inconsistent. When I highlight the range it works as expected. When I select the range, it will only select the tow cells, however, when I try to check if some selected range is part of the range, it will incorrectly report it is part of the range.
Actual Behavior
Expected is that the selected range does not intersect with the highlighted range (i.e. the bookmark range).
Reproduction Steps
Additional information
No response
The text was updated successfully, but these errors were encountered: