Merge pull request 'fix/pdf-bugs' (#1562) from fix/pdf-bugs into release/v9.1.0

Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/sdkjs/pulls/1562
This commit is contained in:
Oleg Korshul
2025-10-14 09:17:02 +00:00
3 changed files with 23 additions and 4 deletions

View File

@ -854,6 +854,8 @@ void main() {\n\
return;
}
let oDoc = this.viewer.getPDFDoc();
stream.pos = ret.LinePos;
let _lineText = "";
@ -914,10 +916,13 @@ void main() {\n\
}
}
oDoc.TextSelectTrackHandler.Update(true);
this.onUpdateSelection();
this.onUpdateOverlay();
};
CFile.prototype.selectWholeRow = function(pageIndex, x, y) {
let ret = this.getNearestPos(pageIndex, x, y);
let oDoc = this.viewer.getPDFDoc();
let sel = this.Selection;
sel.Glyph1 = -2;
@ -929,6 +934,8 @@ void main() {\n\
sel.Page2 = pageIndex;
sel.quads = [];
oDoc.TextSelectTrackHandler.Update(true);
this.onUpdateSelection();
this.onUpdateOverlay();
};
CFile.prototype.selectWholePage = function(pageIndex) {
@ -937,6 +944,9 @@ void main() {\n\
if (!stream) {
return;
}
let oDoc = this.viewer.getPDFDoc();
while (stream.pos < stream.size)
{
_numLine++;
@ -957,6 +967,8 @@ void main() {\n\
sel.Page2 = pageIndex;
sel.quads = [];
oDoc.TextSelectTrackHandler.Update(true);
this.onUpdateSelection();
this.onUpdateOverlay();
};
CFile.prototype.selectAll = function() {

View File

@ -50,7 +50,7 @@
};
CTextSelectTrackHandler.prototype.OnChangePosition = function(bCheckMouseUpPos) {
let oFile = Asc.editor.getDocumentRenderer().file;
if (oFile.Selection.IsSelection || false === Asc.editor.NeedShowTextSelectPanel()) {
if (false == oFile.isSelectionUse() || false === Asc.editor.NeedShowTextSelectPanel()) {
this.OnHide();
return;
}

View File

@ -2048,12 +2048,19 @@
if (!pageObjectLogic) {
return false;
}
if (global_mouseEvent.ClickCount == 2)
if (global_mouseEvent.ClickCount == 2) {
oThis.file.selectWholeWord(pageObjectLogic.index, pageObjectLogic.x, pageObjectLogic.y);
else if (global_mouseEvent.ClickCount == 3)
return;
}
else if (global_mouseEvent.ClickCount == 3) {
oThis.file.selectWholeRow(pageObjectLogic.index, pageObjectLogic.x, pageObjectLogic.y);
else if (global_mouseEvent.ClickCount == 4)
return;
}
else if (global_mouseEvent.ClickCount == 4) {
oThis.file.selectWholePage(pageObjectLogic.index);
return;
}
}
// если было нажатие - то отжимаем