diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-04-04 13:09:17 +0100 |
---|---|---|
committer | Xisco Faulí <xiscofauli@libreoffice.org> | 2019-04-08 20:28:44 +0200 |
commit | 386b9a1bebb56367977ebc276d85f5f10d252be6 (patch) | |
tree | 0cb58887963ecc2806c0a3332f89743c03f02dc2 /sfx2 | |
parent | 62b309e5cf24570a242dbf41c53ece60b23292eb (diff) |
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@redhat.com>
Tested-by: Caolán McNamara <caolanm@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@libreoffice.org>
Diffstat (limited to 'sfx2')
-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 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(); |