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/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; } 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; + } } // если было нажатие - то отжимаем