[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - svx/source sw/source

Julien Nabet (via logerrit) logerrit at kemper.freedesktop.org
Fri Jul 10 07:08:58 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 36962d9cc105d2c98889ee841438823fce090dfb
Author:     Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Tue Jul 7 10:23:28 2020 +0200
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Fri Jul 10 09:08:34 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>
    (cherry picked from commit 7272a2edf113f29edeb8987ce649f85b776d9d23)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98342
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

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 2fb921c5ef2c..184c911956a9 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