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

New commits:
commit eb8ee2ecf2f62117fb771d712c88cb0d30883c07
Author:     Justin Luth <[email protected]>
AuthorDate: Mon Dec 8 21:29:24 2025 -0500
Commit:     Miklos Vajna <[email protected]>
CommitDate: Wed Dec 10 16:28:06 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
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195323
    Reviewed-by: Miklos Vajna <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/sc/qa/unit/subsequent_export_test4.cxx 
b/sc/qa/unit/subsequent_export_test4.cxx
index f9171f165822..3d02063626f3 100644
--- a/sc/qa/unit/subsequent_export_test4.cxx
+++ b/sc/qa/unit/subsequent_export_test4.cxx
@@ -1171,6 +1171,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 2c89aec0d320..00612e7da182 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