diff options
author | Armin Le Grand <alg@apache.org> | 2013-08-30 13:27:36 +0000 |
---|---|---|
committer | Armin Le Grand <alg@apache.org> | 2013-08-30 13:27:36 +0000 |
commit | a77275c610f1543dcc8b38dc5ec50f1195965f27 (patch) | |
tree | 06c16f0af57823bc258c764570ca317791c6ba18 /svtools | |
parent | 7ed3f859004e0763598a7d6edc7e4dec2b69813c (diff) |
i122982 Fallback to bitmap reader when no PNG even when claimed
Notes
Notes:
merged as: 1156d1b29af15c0d7f1d185f8ce1dc8668940286
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/misc/transfer.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/svtools/source/misc/transfer.cxx b/svtools/source/misc/transfer.cxx index 62cab330a165..0dae8ae74199 100644 --- a/svtools/source/misc/transfer.cxx +++ b/svtools/source/misc/transfer.cxx @@ -1808,6 +1808,7 @@ sal_Bool TransferableDataHelper::GetBitmapEx( const DataFlavor& rFlavor, BitmapE 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::GetBitmapEx( const DataFlavor& rFlavor, BitmapE { // 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::GetBitmapEx( const DataFlavor& rFlavor, BitmapE } } - 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 |