it seems, though the filter is there, we don't read .svg files from the Pictures stream inside the odf zip container. Easy fix attached, could someone please review & commit to -3-4?
And one more of that kind - Writer has its own implementation, needing a similar-in-spirit fix. We missed 3.4.4 for that, but a useful fix for 3.4.5 - your review & commit to that branch appreciated. :) Cheers, -- Thorsten
From 87d88aa0a2240748f1ffd456b524405bf21d4c64 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens <tbehrens@novell.com> Date: Tue, 25 Oct 2011 20:54:01 +0200 Subject: [PATCH] Fix fdo#41995 fallout - recognize .svg in odt container Seems the graphic load code is stupid and not using the path name / file extension to guess file type, but only "magic byte" detection. Giving filter framework the path now, so that .svg actually loads. This parrots 050350f326629c6edffcdb2cf288893027f264e6, but for Writer, which sadly sports its own Graphic implementation. --- sw/source/core/graphic/ndgrf.cxx | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) mode change 100644 => 100755 sw/source/core/graphic/ndgrf.cxx diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx old mode 100644 new mode 100755 index 0a11a93..62a9a4b --- a/sw/source/core/graphic/ndgrf.cxx +++ b/sw/source/core/graphic/ndgrf.cxx @@ -394,12 +394,11 @@ Size SwGrfNode::GetTwipSize() const sal_Bool SwGrfNode::ImportGraphic( SvStream& rStrm ) { Graphic aGraphic; - if( !GraphicFilter::GetGraphicFilter()->ImportGraphic( aGraphic, String(), rStrm ) ) + const String aGraphicURL( aGrfObj.GetUserData() ); + if( !GraphicFilter::GetGraphicFilter()->ImportGraphic( aGraphic, aGraphicURL, rStrm ) ) { - const String aUserData( aGrfObj.GetUserData() ); - aGrfObj.SetGraphic( aGraphic ); - aGrfObj.SetUserData( aUserData ); + aGrfObj.SetUserData( aGraphicURL ); return sal_True; } @@ -893,7 +892,8 @@ SwCntntNode* SwGrfNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const SvStream* pStrm = _GetStreamForEmbedGrf( refPics, aStrmName ); if ( pStrm ) { - GraphicFilter::GetGraphicFilter()->ImportGraphic( aTmpGrf, String(), *pStrm ); + const String aGraphicURL( aGrfObj.GetUserData() ); + GraphicFilter::GetGraphicFilter()->ImportGraphic( aTmpGrf, aGraphicURL, *pStrm ); delete pStrm; } // <-- -- 1.7.7
Attachment:
pgpz_H7htec29.pgp
Description: PGP signature