Author: alg Date: Fri Aug 30 13:27:36 2013 New Revision: 1518964 URL: http://svn.apache.org/r1518964 Log: i122982 Fallback to bitmap reader when no PNG even when claimed
Modified: openoffice/trunk/main/svtools/source/misc/transfer.cxx Modified: openoffice/trunk/main/svtools/source/misc/transfer.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svtools/source/misc/transfer.cxx?rev=1518964&r1=1518963&r2=1518964&view=diff ============================================================================== --- openoffice/trunk/main/svtools/source/misc/transfer.cxx (original) +++ openoffice/trunk/main/svtools/source/misc/transfer.cxx Fri Aug 30 13:27:36 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