[Libreoffice-commits] core.git: svx/source sw/source

Julien Nabet (via logerrit) logerrit at kemper.freedesktop.org
Thu Jul 9 07:11:41 UTC 2020


 svx/source/xoutdev/_xoutbmp.cxx         |    5 ++++-
 sw/source/filter/html/htmlflywriter.cxx |    2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 7272a2edf113f29edeb8987ce649f85b776d9d23
Author:     Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Tue Jul 7 10:23:28 2020 +0200
Commit:     Julien Nabet <serval2412 at yahoo.fr>
CommitDate: Thu Jul 9 09:10:54 2020 +0200

    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 at yahoo.fr>

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)
             {


More information about the Libreoffice-commits mailing list