Kaydet (Commit) 9db7130e authored tarafından Caolán McNamara's avatar Caolán McNamara

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: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 4a4b1df7
...@@ -948,8 +948,14 @@ void SfxDocumentPage::Reset( const SfxItemSet* rSet ) ...@@ -948,8 +948,14 @@ void SfxDocumentPage::Reset( const SfxItemSet* rSet )
const SfxDocumentInfoItem& rInfoItem = rSet->Get(SID_DOCINFO); const SfxDocumentInfoItem& rInfoItem = rSet->Get(SID_DOCINFO);
// template data // template data
if ( rInfoItem.HasTemplate() ) if (rInfoItem.HasTemplate())
m_xTemplValFt->set_label( rInfoItem.getTemplateName() ); {
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 else
{ {
m_xTemplFt->hide(); m_xTemplFt->hide();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment