diff options
author | Tor Lillqvist <tlillqvist@novell.com> | 2010-10-15 11:10:08 +0200 |
---|---|---|
committer | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2010-10-15 11:10:08 +0200 |
commit | a07a2d9c940884fd55924080eec2d46d003262de (patch) | |
tree | ac9ce13ccd7bb8da2b7eb8814afaa072f66572f0 /sfx2 | |
parent | c63d5210fd85cf8ec41c29f8fc17d39c676726be (diff) |
mail-document-subject.diff: sanitize subject if document mailed from LibreOffice
bnc#459176
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/dialog/mailmodel.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sfx2/source/dialog/mailmodel.cxx b/sfx2/source/dialog/mailmodel.cxx index 15f9eafebd8c..e1463d3c7395 100644 --- a/sfx2/source/dialog/mailmodel.cxx +++ b/sfx2/source/dialog/mailmodel.cxx @@ -845,7 +845,13 @@ SfxMailModel::SendMailResult SfxMailModel::Send( const css::uno::Reference< css: Sequence< OUString > aAttachmentSeq(&(maAttachedDocuments[0]),maAttachedDocuments.size()); - xSimpleMailMessage->setSubject( maSubject ); + if ( xSimpleMailMessage->getSubject().getLength() == 0 ) { + OUString baseName( maAttachedDocuments[0].copy( maAttachedDocuments[0].lastIndexOf( '/' ) + 1 ) ); + OUString subject( baseName ); + if ( maAttachedDocuments.size() > 1 ) + subject += OUString::createFromAscii( ", ..." ); + xSimpleMailMessage->setSubject( subject ); + } xSimpleMailMessage->setAttachement( aAttachmentSeq ); sal_Bool bSend( sal_False ); |