sc/qa/unit/subsequent_export_test4.cxx |    5 +++++
 sc/source/filter/excel/xeescher.cxx    |    3 +++
 2 files changed, 8 insertions(+)

New commits:
commit 442f92858d230028ee1662fc775581511ae96858
Author:     Justin Luth <[email protected]>
AuthorDate: Mon Dec 8 21:29:24 2025 -0500
Commit:     Justin Luth <[email protected]>
CommitDate: Tue Dec 9 15:41:01 2025 +0100

    xlsx: export activeX control as transparent
    
    Using Excel 2024, I saved the control
    with a black, a blue, and a transparent background.
    The only differences in the files
    were in the activeX/activeX1.bin file,
    and in the media/image1.emf file.
    
    Currently we can't use LO to save different colours anyway,
    so if we are only going to support one choice,
    then the best choice is transparent - which is
    the default of a new control.
    
    make CppunitTest_sc_subsequent_export_test4 \
        CPPUNIT_TEST_NAME=testCheckboxFormControlXlsxExport
    
    Change-Id: I6d4a24fa43d4c12ce412d5bf3abb02e7347d3efc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195263
    Reviewed-by: Justin Luth <[email protected]>
    Tested-by: Jenkins

diff --git a/sc/qa/unit/subsequent_export_test4.cxx 
b/sc/qa/unit/subsequent_export_test4.cxx
index 5aa6ab7dbb0d..c5796a169842 100644
--- a/sc/qa/unit/subsequent_export_test4.cxx
+++ b/sc/qa/unit/subsequent_export_test4.cxx
@@ -1104,6 +1104,11 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, 
testCheckboxFormControlXlsxExport)
     xPropertySet->getPropertyValue(u"VisualEffect"_ustr) >>= nStyle;
     // without the fix, this was 1 (3d)
     CPPUNIT_ASSERT_EQUAL(sal_Int16(2), nStyle); // flat
+
+    Color aColor;
+    xPropertySet->getPropertyValue(u"BackgroundColor"_ustr) >>= aColor;
+    // without the fix, this was white
+    CPPUNIT_ASSERT_EQUAL(COL_BLACK, aColor); // black apparently == transparent
 }
 
 CPPUNIT_TEST_FIXTURE(ScExportTest4, testButtonFormControlXlsxExport)
diff --git a/sc/source/filter/excel/xeescher.cxx 
b/sc/source/filter/excel/xeescher.cxx
index f7e0e3005cc2..dfc43605c732 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -1138,6 +1138,9 @@ sal_Int32 VmlFormControlExporter::StartShape()
     if (!m_sControlName.isEmpty())
         AddShapeAttribute(XML_id, m_sControlName.toUtf8());
 
+    // control background: set filled as false so the control is transparent 
instead of white
+    AddShapeAttribute(XML_filled, "f");
+
     return VMLExport::StartShape();
 }
 

Reply via email to