Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/1822

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/22/1822/1

Fix fdo#59616 - ensure BitmapEx has same-sized subbitmaps

Lots of code relies on the fact that the two bitmaps inside a
BitmapEx actually have the same size. Enforce that convention during
import.

Change-Id: I436ccc33b06c627cd6347747d22c24bfaf7ca932
---
M vcl/source/gdi/bitmapex.cxx
1 file changed, 18 insertions(+), 0 deletions(-)



diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index d1d4262..133448c 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -904,6 +904,24 @@
 
                 if( !!aMask)
                 {
+                    // fdo#59616 enforce same size for both mask and content
+                    if( aMask.GetSizePixel() != aBmp.GetSizePixel() )
+                    {
+                        Bitmap aNewMask;
+                        const Size aNominalSize=aBmp.GetSizePixel();
+                        BitmapReadAccess aAcc(aMask);
+                        if( aAcc.HasPalette() )
+                            aNewMask = Bitmap(aNominalSize,
+                                              aMask.GetBitCount(),
+                                              &aAcc.GetPalette());
+                        else
+                            aNewMask = Bitmap(aNominalSize,
+                                              aMask.GetBitCount());
+                        const Rectangle aCopyArea(Point(0,0), aNominalSize);
+                        aNewMask.CopyPixel(aCopyArea, aCopyArea, &aMask);
+                        aMask = aNewMask;
+                    }
+
                     // do we have an alpha mask?
                     if( ( 8 == aMask.GetBitCount() ) && aMask.HasGreyPalette() )
                     {

-- 
To view, visit https://gerrit.libreoffice.org/1822
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I436ccc33b06c627cd6347747d22c24bfaf7ca932
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-3-6
Gerrit-Owner: Thorsten Behrens <tbehrens@suse.com>


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.