[Libreoffice-commits] .: 2 commits - binfilter/bf_sw oox/source

Caolán McNamara caolan at kemper.freedesktop.org
Tue Jun 7 04:37:17 PDT 2011


 binfilter/bf_sw/source/core/sw3io/sw_sw3misc.cxx |    2 -
 binfilter/bf_sw/source/core/text/sw_itrcrsr.cxx  |    1 
 oox/source/export/drawingml.cxx                  |   28 +++++++++++------------
 3 files changed, 16 insertions(+), 15 deletions(-)

New commits:
commit b883b506e2d4dca419838b56915c58a0030d5b98
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

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 4e94e90..7cf8d98 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;
commit bbeaee35d41c6f75504e2735ebb7398e57b25bf8
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jun 7 12:33:59 2011 +0100

    WaE: extra macosx non-debug warnings

diff --git a/binfilter/bf_sw/source/core/sw3io/sw_sw3misc.cxx b/binfilter/bf_sw/source/core/sw3io/sw_sw3misc.cxx
index 25028c1..e050b86 100644
--- a/binfilter/bf_sw/source/core/sw3io/sw_sw3misc.cxx
+++ b/binfilter/bf_sw/source/core/sw3io/sw_sw3misc.cxx
@@ -1375,7 +1375,7 @@ extern sal_Bool lcl_sw3io_isTOXHeaderSection( const SwStartNode& rSttNd );
 /*N*/ 			case TOX_OBJECTS:
 /*N*/ 			case TOX_TABLES:
 /*N*/ 				{
-/*N*/ 					sal_uInt16 nPoolId;
+/*N*/ 					sal_uInt16 nPoolId(0);
 /*N*/ 					switch( pType->GetType() )
 /*N*/ 					{
 /*?*/ 					case TOX_ILLUSTRATIONS:
diff --git a/binfilter/bf_sw/source/core/text/sw_itrcrsr.cxx b/binfilter/bf_sw/source/core/text/sw_itrcrsr.cxx
index 23f4c11..34c5e9d 100644
--- a/binfilter/bf_sw/source/core/text/sw_itrcrsr.cxx
+++ b/binfilter/bf_sw/source/core/text/sw_itrcrsr.cxx
@@ -709,6 +709,7 @@ sal_Bool SwTxtCursor::bRightMargin = sal_False;
 /*?*/ 
 /*?*/         OSL_ENSURE( ! nLineOfst || SP_EXTEND_RANGE_BEFORE != nExtendRange,
 /*?*/                 "LineOffset AND Number Portion?" );
+/*?*/         (void)nLineOfst;
 /*?*/ 
 /*?*/         // portions which are behind the string
 /*?*/         if ( SP_EXTEND_RANGE_BEHIND == nExtendRange )


More information about the Libreoffice-commits mailing list