sc/source/filter/xcl97/xcl97esc.cxx |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit 7f06e1e26cd3e76c65fcb271563d5741b3a45333
Author:     Gülşah Köse <gulsah.k...@collabora.com>
AuthorDate: Fri Jan 17 16:57:59 2025 +0300
Commit:     Gülşah Köse <gulsah.k...@collabora.com>
CommitDate: Tue Feb 11 15:44:16 2025 +0100

    tdf#164141 Fix command button xls to xlsx convert problem.
    
    MSO has two type controls. ActiveX and normal. ControlTypeinMSO
    specifies the form control object is ActiveX or not.
    
    2: ActiveX form control
    1: Normal form control
    
    Current case is simple ActiveX button created by MSO can not be exported by
    LibreOffice properly. It was triggering the repair dialog on MSO. And we
    even lost the button in LibreOffice.
    
    If the pCurrXclObj is failed, we need to give a chance to export button
    by using XclExpTbxControlObj instead of directly XclObjAny
    
    This patch just fixes the Command button xls to xlsx convertion problem.
    Not all the form controls.
    
    Signed-off-by: Gülşah Köse <gulsah.k...@collabora.com>
    Change-Id: Ifabf4d0e16bd620f8201a2143d8af7c64d8859a6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180414
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181345

diff --git a/sc/source/filter/xcl97/xcl97esc.cxx 
b/sc/source/filter/xcl97/xcl97esc.cxx
index b2f81453c667..525ddb1bf44e 100644
--- a/sc/source/filter/xcl97/xcl97esc.cxx
+++ b/sc/source/filter/xcl97/xcl97esc.cxx
@@ -240,7 +240,11 @@ EscherExHostAppData* XclEscherEx::StartShape( const 
Reference< XShape >& rxShape
                 SAL_WARN("sc", "XclEscherEx::StartShape, this control can't 
get the property ControlTypeinMSO!");
             }
             if( nMsCtlType == 2 )  //OCX Form Control
+            {
                 pCurrXclObj = CreateOCXCtrlObj( rxShape, pChildAnchor 
).release();
+                if(!pCurrXclObj) // Give a chance to handle control object 
with XclExpTbxControlObj instead of XclObjAny
+                    pCurrXclObj = CreateTBXCtrlObj( rxShape, pChildAnchor 
).release();
+            }
             else  //TBX Form Control
                 pCurrXclObj = CreateTBXCtrlObj( rxShape, pChildAnchor 
).release();
             if( !pCurrXclObj )

Reply via email to