[Libreoffice-commits] core.git: svtools/source
Armin Le Grand
alg at apache.org
Fri Aug 30 08:16:47 PDT 2013
svtools/source/misc/transfer.cxx | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
New commits:
commit 1156d1b29af15c0d7f1d185f8ce1dc8668940286
Author: Armin Le Grand <alg at apache.org>
Date: Fri Aug 30 13:27:36 2013 +0000
Resolves: #i122982# Fallback to bitmap reader when no PNG even when claimed
(cherry picked from commit a77275c610f1543dcc8b38dc5ec50f1195965f27)
Conflicts:
svtools/source/misc/transfer.cxx
Change-Id: I213496c53558cd3b78e40866bdc8e89d08079033
diff --git a/svtools/source/misc/transfer.cxx b/svtools/source/misc/transfer.cxx
index a86e5cf..296d54d 100644
--- a/svtools/source/misc/transfer.cxx
+++ b/svtools/source/misc/transfer.cxx
@@ -1694,6 +1694,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))
{
@@ -1705,18 +1706,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("image/png"))
+ if(!bSuppressPNG && rFlavor.MimeType.equalsIgnoreAsciiCase("image/png"))
{
// it's a PNG, import to BitmapEx
::vcl::PNGReader aPNGReader(*xStm);
rBmpEx = aPNGReader.Read();
}
- else
+
+ if(rBmpEx.IsEmpty())
{
Bitmap aBitmap;
Bitmap aMask;
@@ -1734,7 +1737,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
More information about the Libreoffice-commits
mailing list