[Libreoffice-commits] core.git: emfio/source

Caolán McNamara caolanm at redhat.com
Mon Sep 4 07:53:09 UTC 2017


 emfio/source/reader/mtftools.cxx |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

New commits:
commit c8a3f0fe63e38a1b597327d1145568dc9ae7a84a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Sep 3 20:37:55 2017 +0100

    crashtesting: uninherited GDIObj is also possible here
    
    e.g. kde239472-4.doc and W_META_CREATEPALETTE etc create objects that can be
    selected but are just a base GDIObj
    
    Change-Id: I4b99978c49f5abb7fb1c616d044ba25c793577be
    Reviewed-on: https://gerrit.libreoffice.org/41869
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/emfio/source/reader/mtftools.cxx b/emfio/source/reader/mtftools.cxx
index 4edfeb4817cd..ce2b8ab1b395 100644
--- a/emfio/source/reader/mtftools.cxx
+++ b/emfio/source/reader/mtftools.cxx
@@ -546,7 +546,7 @@ namespace emfio
     {
         if ( nIndex & ENHMETA_STOCK_OBJECT )
         {
-             sal_uInt16 nStockId = (sal_uInt8)nIndex;
+            sal_uInt16 nStockId = (sal_uInt8)nIndex;
             switch( nStockId )
             {
                 case WHITE_BRUSH :
@@ -608,6 +608,8 @@ namespace emfio
             if ( (sal_uInt32)nIndex < mvGDIObj.size() )
                 pGDIObj = mvGDIObj[ nIndex ].get();
 
+            fprintf(stderr, "index %d is %p\n", nIndex, pGDIObj);
+
             if ( pGDIObj )
             {
                 if (const auto pen = dynamic_cast<WinMtfLineStyle*>(pGDIObj))
@@ -620,9 +622,9 @@ namespace emfio
                 }
                 else if (const auto font = dynamic_cast<WinMtfFontStyle*>(
                              pGDIObj))
+                {
                     maFont = font->aFont;
-                else
-                    assert(false);
+                }
             }
         }
     }
@@ -715,6 +717,7 @@ namespace emfio
         if ( nIndex == mvGDIObj.size() )
             ImplResizeObjectArry( mvGDIObj.size() + 16 );
 
+        fprintf(stderr, "index %ld set to %p\n", nIndex, pObject.get());
         mvGDIObj[ nIndex ] = std::move(pObject);
     }
 
@@ -751,6 +754,8 @@ namespace emfio
             if ( (sal_uInt32)nIndex >= mvGDIObj.size() )
                 ImplResizeObjectArry( nIndex + 16 );
 
+            fprintf(stderr, "22 index %d set to %p\n", nIndex, pObject.get());
+
             mvGDIObj[ nIndex ] = std::move(pObject);
         }
     }


More information about the Libreoffice-commits mailing list