[Libreoffice-commits] .: Branch 'libreoffice-3-4' - sw/source

Thorsten Behrens thorsten at kemper.freedesktop.org
Wed Oct 26 14:11:34 PDT 2011


 sw/source/core/graphic/ndgrf.cxx |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 1a6c6a66b72ca64641cb16b3c49c40aba06602f1
Author: Thorsten Behrens <tbehrens at novell.com>
Date:   Tue Oct 25 20:54:01 2011 +0200

    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 at suse.com>

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;
             }
             // <--


More information about the Libreoffice-commits mailing list