[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - sfx2/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Mon Apr 8 18:29:08 UTC 2019


 sfx2/source/dialog/dinfdlg.cxx |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 386b9a1bebb56367977ebc276d85f5f10d252be6
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Apr 4 13:09:17 2019 +0100
Commit:     Xisco Faulí <xiscofauli at libreoffice.org>
CommitDate: Mon Apr 8 20:28:44 2019 +0200

    Resolves: tdf#122780 limit massive template names in ui to a sane length
    
    Reviewed-on: https://gerrit.libreoffice.org/70255
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit 9db7130e05b79fdcb9a60a3f1f4801e5401427de)
    
    Change-Id: I053b30b00dbda67819af68020e2f6fa4a5b5134e
    Reviewed-on: https://gerrit.libreoffice.org/70259
    Tested-by: Jenkins
    Reviewed-by: Xisco Faulí <xiscofauli at libreoffice.org>

diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 296fda7cc639..128f7f8c3192 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -969,8 +969,14 @@ void SfxDocumentPage::Reset( const SfxItemSet* rSet )
     const SfxDocumentInfoItem& rInfoItem = rSet->Get(SID_DOCINFO);
 
     // template data
-    if ( rInfoItem.HasTemplate() )
-        m_pTemplValFt->SetText( rInfoItem.getTemplateName() );
+    if (rInfoItem.HasTemplate())
+    {
+        const OUString& rName = rInfoItem.getTemplateName();
+        if (rName.getLength() > SAL_MAX_INT16) // tdf#122780 pick some ~arbitrary max size
+            m_pTemplValFt->SetText(rName.copy(0, SAL_MAX_INT16));
+        else
+            m_pTemplValFt->SetText(rName);
+    }
     else
     {
         m_pTemplFt->Hide();


More information about the Libreoffice-commits mailing list