summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2013-08-30 13:27:36 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-08-30 16:16:22 +0100
commit1156d1b29af15c0d7f1d185f8ce1dc8668940286 (patch)
tree16f4480c02fefad052e4a9985e831014f01eb5ef /svtools
parent729bc005ec12cdb1c8cb319a60bdccc3b0964c85 (diff)
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
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/misc/transfer.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/svtools/source/misc/transfer.cxx b/svtools/source/misc/transfer.cxx
index a86e5cf5513a..296d54de77f2 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