[Libreoffice-commits] .: 3 commits -

Jan Holesovsky kendy at kemper.freedesktop.org
Fri Jun 17 04:47:23 PDT 2011


 0 files changed

New commits:
commit 125e3d01be4fa85de59223c0d4e02ad955da6199
Merge: 067f42d... 160ee93...
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Fri Jun 17 13:02:08 2011 +0200

    Merge remote-tracking branch 'origin/libreoffice-3-4'

commit 160ee9336bb61c6608b0387c6a5981ff4a90d94c
Author: Petr Mladek <pmladek at suse.cz>
Date:   Tue Jun 14 16:53:25 2011 +0200

    Version 3.4.1.1, tag libreoffice-3.4.1.1 (3.4.1-rc1)
commit a6e115351691e89de1a78e0efd04f1c785e47f29
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jun 7 12:37:08 2011 +0100

    Resolves: rhbz#710556 don't crash on missing graphics
    (cherry picked from commit b883b506e2d4dca419838b56915c58a0030d5b98)

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 48f4eb4..f73f569 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -469,7 +469,7 @@ OUString DrawingML::WriteImage( const Graphic& rGraphic )
 {
     GfxLink aLink = rGraphic.GetLink ();
     OUString sMediaType;
-    const char* sExtension = NULL;
+    const char* pExtension = "";
     OUString sRelId;
 
     SvMemoryStream aStream;
@@ -479,42 +479,42 @@ OUString DrawingML::WriteImage( const Graphic& rGraphic )
     switch ( aLink.GetType() ) {
         case GFX_LINK_TYPE_NATIVE_GIF:
             sMediaType = US( "image/gif" );
-            sExtension = ".gif";
+            pExtension = ".gif";
             break;
         case GFX_LINK_TYPE_NATIVE_JPG:
             sMediaType = US( "image/jpeg" );
-            sExtension = ".jpeg";
+            pExtension = ".jpeg";
             break;
         case GFX_LINK_TYPE_NATIVE_PNG:
             sMediaType = US( "image/png" );
-            sExtension = ".png";
+            pExtension = ".png";
             break;
         case GFX_LINK_TYPE_NATIVE_TIF:
             sMediaType = US( "image/tiff" );
-            sExtension = ".tiff";
+            pExtension = ".tiff";
             break;
         case GFX_LINK_TYPE_NATIVE_WMF:
             sMediaType = US( "image/x-wmf" );
-            sExtension = ".wmf";
+            pExtension = ".wmf";
             break;
         case GFX_LINK_TYPE_NATIVE_MET:
             sMediaType = US( "image/x-met" );
-            sExtension = ".met";
+            pExtension = ".met";
             break;
         case GFX_LINK_TYPE_NATIVE_PCT:
             sMediaType = US( "image/x-pict" );
-            sExtension = ".pct";
+            pExtension = ".pct";
             break;
         default: {
             GraphicType aType = rGraphic.GetType();
             if ( aType == GRAPHIC_BITMAP ) {
                 GraphicConverter::Export( aStream, rGraphic, CVT_PNG );
                 sMediaType = US( "image/png" );
-                sExtension = ".png";
+                pExtension = ".png";
             } else if ( aType == GRAPHIC_GDIMETAFILE ) {
                 GraphicConverter::Export( aStream, rGraphic, CVT_EMF );
                 sMediaType = US( "image/x-emf" );
-                sExtension = ".emf";
+                pExtension = ".emf";
             } else {
                 OSL_TRACE( "unhandled graphic type" );
                 break;
@@ -526,7 +526,7 @@ OUString DrawingML::WriteImage( const Graphic& rGraphic )
             }
     }
 
-    const char *pComponent = NULL;
+    const char *pComponent = "";
     switch ( meDocumentType )
     {
         case DOCUMENT_DOCX: pComponent = "word"; break;
@@ -538,13 +538,13 @@ OUString DrawingML::WriteImage( const Graphic& rGraphic )
                                                                       .appendAscii( pComponent )
                                                                       .appendAscii( "/media/image" )
                                                                       .append( (sal_Int32) mnImageCounter )
-                                                                      .appendAscii( sExtension )
+                                                                      .appendAscii( pExtension )
                                                                       .makeStringAndClear(),
                                                                       sMediaType );
     xOutStream->writeBytes( Sequence< sal_Int8 >( (const sal_Int8*) aData, nDataSize ) );
     xOutStream->closeOutput();
 
-    const char *pImagePrefix = NULL;
+    const char *pImagePrefix = "";
     switch ( meDocumentType )
     {
         case DOCUMENT_DOCX:
@@ -561,7 +561,7 @@ OUString DrawingML::WriteImage( const Graphic& rGraphic )
                                 OUStringBuffer()
                                 .appendAscii( pImagePrefix )
                                 .append( (sal_Int32) mnImageCounter ++ )
-                                .appendAscii( sExtension )
+                                .appendAscii( pExtension )
                                 .makeStringAndClear() );
 
     return sRelId;


More information about the Libreoffice-commits mailing list