[Libreoffice-commits] core.git: sfx2/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Apr 4 13:30:01 UTC 2019


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

New commits:
commit 9db7130e05b79fdcb9a60a3f1f4801e5401427de
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Apr 4 13:09:17 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Apr 4 15:29:27 2019 +0200

    Resolves: tdf#122780 limit massive template names in ui to a sane length
    
    Change-Id: I053b30b00dbda67819af68020e2f6fa4a5b5134e
    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>

diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 5e411b37fb82..a3d0fedd6531 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -948,8 +948,14 @@ void SfxDocumentPage::Reset( const SfxItemSet* rSet )
     const SfxDocumentInfoItem& rInfoItem = rSet->Get(SID_DOCINFO);
 
     // template data
-    if ( rInfoItem.HasTemplate() )
-        m_xTemplValFt->set_label( rInfoItem.getTemplateName() );
+    if (rInfoItem.HasTemplate())
+    {
+        const OUString& rName = rInfoItem.getTemplateName();
+        if (rName.getLength() > SAL_MAX_INT16) // tdf#122780 pick some ~arbitrary max size
+            m_xTemplValFt->set_label(rName.copy(0, SAL_MAX_INT16));
+        else
+            m_xTemplValFt->set_label(rName);
+    }
     else
     {
         m_xTemplFt->hide();


More information about the Libreoffice-commits mailing list