diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-04-04 13:09:17 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-04-04 15:29:27 +0200 |
commit | 9db7130e05b79fdcb9a60a3f1f4801e5401427de (patch) | |
tree | 887be37569c2609bc831cc2bdc7e48f226a59407 | |
parent | 4a4b1df72909fe96acdbcb95f90e30bd1a79c5eb (diff) |
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@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sfx2/source/dialog/dinfdlg.cxx | 10 |
1 files changed, 8 insertions, 2 deletions
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(); |