tdf#136632: Use 'Save transparency' when exporting selected objects for PNG

To avoid some regression, consider that transparency should be enabled by default.
So only remove transparency if it's required explicitely.

+ change QA test since "Translucent" property isn't a bool but a sal_Int32
In officecfg/registry/schema/org/openoffice/Office/Common.xcs:
<prop oor:name="Translucent" oor:type="xs:int" oor:nillable="false">

Change-Id: I9bfb6aae8e2e8a31dee82f73a9165989129f222a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131057
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
diff --git a/sd/qa/unit/PNGExportTests.cxx b/sd/qa/unit/PNGExportTests.cxx
index f80d2e6..f3ab402 100644
--- a/sd/qa/unit/PNGExportTests.cxx
+++ b/sd/qa/unit/PNGExportTests.cxx
@@ -240,7 +240,7 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf147119)
    uno::Sequence<beans::PropertyValue> aFilterData{
        comphelper::makePropertyValue("PixelWidth", sal_Int32(100)),
        comphelper::makePropertyValue("PixelHeight", sal_Int32(100)),
        comphelper::makePropertyValue("Translucent", true),
        comphelper::makePropertyValue("Translucent", sal_Int32(1)),
    };

    utl::TempFile aTempFile;
diff --git a/vcl/source/filter/png/pngwrite.cxx b/vcl/source/filter/png/pngwrite.cxx
index b4bc3fa..865fe38 100644
--- a/vcl/source/filter/png/pngwrite.cxx
+++ b/vcl/source/filter/png/pngwrite.cxx
@@ -124,6 +124,7 @@ PNGWriterImpl::PNGWriterImpl(const BitmapEx& rBitmapEx,
    Bitmap aBmp(aBitmapEx.GetBitmap());

    mnMaxChunkSize = std::numeric_limits<sal_uInt32>::max();
    bool bTranslucent = true;

    if (pFilterData)
    {
@@ -133,6 +134,13 @@ PNGWriterImpl::PNGWriterImpl(const BitmapEx& rBitmapEx,
                rPropVal.Value >>= mnCompLevel;
            else if (rPropVal.Name == "Interlaced")
                rPropVal.Value >>= mnInterlaced;
            else if (rPropVal.Name == "Translucent")
            {
                tools::Long nTmp = 0;
                rPropVal.Value >>= nTmp;
                if (!nTmp)
                    bTranslucent = false;
            }
            else if (rPropVal.Name == "MaxChunkSize")
            {
                sal_Int32 nVal = 0;
@@ -143,7 +151,7 @@ PNGWriterImpl::PNGWriterImpl(const BitmapEx& rBitmapEx,
    }
    mnBitsPerPixel = sal_uInt8(vcl::pixelFormatBitCount(aBmp.getPixelFormat()));

    if (aBitmapEx.IsAlpha())
    if (aBitmapEx.IsAlpha() && bTranslucent)
    {
        if (mnBitsPerPixel <= 8)
        {