vcl/source/app/salvtables.cxx |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit d76a932e7b98cfcc955911321116bb396c3cb790
Author:     Michael Weghorn <[email protected]>
AuthorDate: Fri Aug 2 21:55:05 2024 +0200
Commit:     Michael Weghorn <[email protected]>
CommitDate: Tue Aug 6 06:52:30 2024 +0200

    tdf#150397 vcl: Don't select SalInstanceTextView text on focus
    
    Disable selecting the text view's text when receiving
    keyboard focus (see `TextWindow::GetFocus`) for the
    `SalInstanceTextView` implementation.
    
    This aligns this with the GTK implementation
    (`GtkInstanceTextView`) that also doesn't do that.
    
    This e.g. prevents selecting the full license
    text in the license dialog when installing a
    new extension when the qt6 or gen VCL plugins
    are used on Linux.
    
    Change-Id: I2f57848f441387fe03abb6d6163416c830cebc4e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171438
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index f97e2561f566..c609a8ae582e 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -5986,6 +5986,10 @@ 
SalInstanceTextView::SalInstanceTextView(VclMultiLineEdit* pTextView, SalInstanc
     : SalInstanceWidget(pTextView, pBuilder, bTakeOwnership)
     , m_xTextView(pTextView)
 {
+    // tdf#150397 don't select text when receiving keyboard focus,
+    // GtkInstanceTextView also doesn't do it
+    m_xTextView->DisableSelectionOnFocus();
+
     m_xTextView->SetModifyHdl(LINK(this, SalInstanceTextView, ChangeHdl));
     ScrollBar& rVertScrollBar = m_xTextView->GetVScrollBar();
     m_aOrigVScrollHdl = rVertScrollBar.GetScrollHdl();

Reply via email to