diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2020-07-07 10:23:28 +0200 |
---|---|---|
committer | Adolfo Jayme Barrientos <fitojb@ubuntu.com> | 2020-07-10 17:32:17 +0200 |
commit | 33d23bfd409783e5ba7279a7ef40f970e629e518 (patch) | |
tree | 8190bb23e46763d5e64848e67f7d40f4a8fc4de6 /svx/source | |
parent | c1e7da2ce1b7705514ca09ace5a53e86474e5fd2 (diff) |
tdf#60684: graphic type content must correspond with graphic type extension
Change-Id: I8075b1b44aa400268b4022decb2a56770c81d83b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98239
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
(cherry picked from commit 7272a2edf113f29edeb8987ce649f85b776d9d23)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98456
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/xoutdev/_xoutbmp.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx index dc69da0ee4ec..2cff52b8bfc7 100644 --- a/svx/source/xoutdev/_xoutbmp.cxx +++ b/svx/source/xoutdev/_xoutbmp.cxx @@ -212,7 +212,10 @@ ErrCode XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileName, break; } - if( !aExt.isEmpty() ) + // tdf#60684: use native format if possible but it must correspond to filter name + // or no specific format has been required + // without this, you may save for example file with png extension but jpg content + if( !aExt.isEmpty() && (aExt == rFilterName || rFilterName.isEmpty()) ) { if( !(nFlags & XOutFlags::DontAddExtension) ) aURL.setExtension( aExt ); |