openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1519374 - /openoffice/branches/AOO401/main/svtools/source/misc/transfer.cxx
Date Mon, 02 Sep 2013 09:21:44 GMT
Author: alg
Date: Mon Sep  2 09:21:44 2013
New Revision: 1519374

URL: http://svn.apache.org/r1519374
Log:
i122982 Fallback to bitmap reader when no PNG even when claimed

Modified:
    openoffice/branches/AOO401/main/svtools/source/misc/transfer.cxx

Modified: openoffice/branches/AOO401/main/svtools/source/misc/transfer.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/AOO401/main/svtools/source/misc/transfer.cxx?rev=1519374&r1=1519373&r2=1519374&view=diff
==============================================================================
--- openoffice/branches/AOO401/main/svtools/source/misc/transfer.cxx (original)
+++ openoffice/branches/AOO401/main/svtools/source/misc/transfer.cxx Mon Sep  2 09:21:44 2013
@@ -1808,6 +1808,7 @@ sal_Bool TransferableDataHelper::GetBitm
     SotStorageStreamRef xStm;
     DataFlavor aSubstFlavor;
     bool bRet(GetSotStorageStream(rFlavor, xStm));
+    bool bSuppressPNG(false); // #122982# If PNG stream not accessed, but BMP one, suppress
trying to load PNG
 
     if(!bRet && HasFormat(SOT_FORMATSTR_ID_PNG) && SotExchange::GetFormatDataFlavor(SOT_FORMATSTR_ID_PNG,
aSubstFlavor))
     {
@@ -1819,18 +1820,20 @@ sal_Bool TransferableDataHelper::GetBitm
     {
         // when no direct success, try if BMP is available
         bRet = GetSotStorageStream(aSubstFlavor, xStm);
+        bSuppressPNG = bRet;
     }
 
     if(bRet)
     {
-        if(rFlavor.MimeType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("image/png")))
+        if(!bSuppressPNG && rFlavor.MimeType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("image/png")))
         {
             // it's a PNG, import to BitmapEx
             ::vcl::PNGReader aPNGReader(*xStm);
 
             rBmpEx = aPNGReader.Read();
         }
-        else
+
+        if(rBmpEx.IsEmpty())
         {
             Bitmap aBitmap;
             Bitmap aMask;
@@ -1848,7 +1851,7 @@ sal_Bool TransferableDataHelper::GetBitm
             }
         }
 
-        bRet = (ERRCODE_NONE == xStm->GetError());
+        bRet = (ERRCODE_NONE == xStm->GetError() && !rBmpEx.IsEmpty());
 
         /* SJ: #110748# At the moment we are having problems with DDB inserted as DIB. The
            problem is, that some graphics are inserted much too big because the nXPelsPerMeter



Mime
View raw message