From a350f901924f532c85c3b3a64cceb445ec900cce Mon Sep 17 00:00:00 2001 From: Nikita Khromov Date: Tue, 14 Oct 2025 16:11:34 +0700 Subject: [PATCH 1/2] [pdf] Fix bug #77600 --- pdf/src/textSelectTrackHandler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdf/src/textSelectTrackHandler.js b/pdf/src/textSelectTrackHandler.js index 4c424d0a46..f02ef2ba95 100644 --- a/pdf/src/textSelectTrackHandler.js +++ b/pdf/src/textSelectTrackHandler.js @@ -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; } From d92cd22e8085f4acb46fc2c32067ff684536d6cd Mon Sep 17 00:00:00 2001 From: Nikita Khromov Date: Tue, 14 Oct 2025 16:12:15 +0700 Subject: [PATCH 2/2] [pdf] Fix dbl click on text --- pdf/src/file.js | 12 ++++++++++++ pdf/src/viewer.js | 13 ++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/pdf/src/file.js b/pdf/src/file.js index 87d1b153d3..4d77bb5b9a 100644 --- a/pdf/src/file.js +++ b/pdf/src/file.js @@ -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() { diff --git a/pdf/src/viewer.js b/pdf/src/viewer.js index d24063c43b..68bb1719ff 100644 --- a/pdf/src/viewer.js +++ b/pdf/src/viewer.js @@ -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; + } } // если было нажатие - то отжимаем