diff options
author | Thorsten Behrens <tbehrens@novell.com> | 2011-10-25 20:54:01 +0200 |
---|---|---|
committer | Thorsten Behrens <tbehrens@suse.com> | 2011-10-28 13:43:21 +0200 |
commit | 5180b2d840093ec67ca356e3f0fb803d9278f7ae (patch) | |
tree | bd38072cd1ef770d79cf3153368f0c0364dc6a05 | |
parent | 55a871898af7cf22a752fbf80d39cce7f9b2eacb (diff) |
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.
Signed-off-by: Noel Power <nopower@suse.com>
Signed-off-by: Fridrich Strba <fridrich.strba@graduateinstitute.ch>
Signed-off-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r-- | sw/source/core/graphic/ndgrf.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx index 0a11a93b01..62a9a4b322 100644 --- 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; } // <-- |