vcl/qt5/QtWidget.cxx |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 2a00c4ce1edc6d09fc770f0af6ec4d823419afbb
Author:     Rafael Lima <rafael.palma.l...@gmail.com>
AuthorDate: Sun Jun 1 23:34:08 2025 +0200
Commit:     Rafael Lima <rafael.palma.l...@gmail.com>
CommitDate: Wed Jun 4 13:40:09 2025 +0200

    tdf#166805 Escape characters in tooltips (qt5/qt6)
    
    Since we're using styles for tooltips in qt5/qt6, we need to escape the 
message that will be shown.
    
    Change-Id: I1441363980629fd01e176261d3a00ac3a79310ce
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186117
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins

diff --git a/vcl/qt5/QtWidget.cxx b/vcl/qt5/QtWidget.cxx
index 84170a87efad..be77aa331c44 100644
--- a/vcl/qt5/QtWidget.cxx
+++ b/vcl/qt5/QtWidget.cxx
@@ -490,10 +490,10 @@ bool QtWidget::handleEvent(QEvent* pEvent)
         const QtFrame* pPopupFrame = GetQtInstance().activePopup();
         if (!m_rFrame.m_aTooltipText.isEmpty() && (!pPopupFrame || pPopupFrame 
== &m_rFrame))
         {
-            // tdf#162297 Use a dummy style to ensure the tooltip is wrapped
-            QString sTooltipText("<font font-weight=normal>");
-            sTooltipText += toQString(m_rFrame.m_aTooltipText);
-            sTooltipText += "</font>";
+            // tdf#162297 and tdf#166805: Use an html tag to ensure the 
tooltip is wrapped
+            QString sTooltipText("<html>");
+            sTooltipText += toQString(m_rFrame.m_aTooltipText).toHtmlEscaped();
+            sTooltipText += "</html>";
             QToolTip::showText(QCursor::pos(), sTooltipText, this, 
m_rFrame.m_aTooltipArea);
         }
         else

Reply via email to