diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2020-07-07 10:23:28 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2020-07-09 09:10:54 +0200 |
commit | 7272a2edf113f29edeb8987ce649f85b776d9d23 (patch) | |
tree | 6af05c346600bdb425d5b41be4b81d828028542a | |
parent | c435ee5c9c9882d0817039d5e53990418c3d1066 (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>
-rw-r--r-- | svx/source/xoutdev/_xoutbmp.cxx | 5 | ||||
-rw-r--r-- | sw/source/filter/html/htmlflywriter.cxx | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx index 500a30375c62..15123e853484 100644 --- a/svx/source/xoutdev/_xoutbmp.cxx +++ b/svx/source/xoutdev/_xoutbmp.cxx @@ -187,7 +187,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 ); diff --git a/sw/source/filter/html/htmlflywriter.cxx b/sw/source/filter/html/htmlflywriter.cxx index b41568377580..55163aba520d 100644 --- a/sw/source/filter/html/htmlflywriter.cxx +++ b/sw/source/filter/html/htmlflywriter.cxx @@ -1825,7 +1825,7 @@ static Writer& OutHTML_FrameFormatGrfNode( Writer& rWrt, const SwFrameFormat& rF aMM100Size = OutputDevice::LogicToLogic( rSize.GetSize(), MapMode( MapUnit::MapTwip ), MapMode( MapUnit::Map100thMM )); - OUString aFilterName("JPG"); + OUString aFilterName(""); if (rHTMLWrt.mbReqIF) { |