diff options
author | Noel Power <noel.power@suse.com> | 2013-06-10 17:30:07 +0100 |
---|---|---|
committer | Noel Power <noel.power@suse.com> | 2013-06-11 14:10:01 +0100 |
commit | 866845356629dd51660b73330bb9c8a2696147dd (patch) | |
tree | 2d2a48289de1a877acbda4dacdbd7df9d47b19e5 /sc | |
parent | 74d631dfb37ec870575d873c82e982a58f65d60c (diff) |
fix build error, reinstate WriteOCXExcelKludgeStream to export ole control
new ole export used WriteOCXExcelKludgeStream but that function dissapeared when
msocximex was stripped of ocx control import ( now we use the new filters in oox )
When that stuff was moved WriteOCXExcelKludgeStream was #ifdef'ed out
Change-Id: I370983efa5e8c4ba2b210dfb7535ea211d13a8c1
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/xcl97/xcl97esc.cxx | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/sc/source/filter/xcl97/xcl97esc.cxx b/sc/source/filter/xcl97/xcl97esc.cxx index 4ffad4065066..bcdec460cc66 100644 --- a/sc/source/filter/xcl97/xcl97esc.cxx +++ b/sc/source/filter/xcl97/xcl97esc.cxx @@ -52,6 +52,9 @@ #include "xehelper.hxx" #include "xechart.hxx" #include "xcl97esc.hxx" +#include <unotools/streamwrap.hxx> +#include <oox/ole/olehelper.hxx> +#include <sfx2/objsh.hxx> using ::com::sun::star::uno::Any; using ::com::sun::star::uno::Exception; @@ -68,6 +71,7 @@ using ::com::sun::star::uno::Any; using ::com::sun::star::form::XForm; using ::com::sun::star::form::XFormComponent; using ::com::sun::star::form::XFormsSupplier; +using ::com::sun::star::io::XOutputStream; using ::com::sun::star::script::ScriptEventDescriptor; using ::com::sun::star::script::XEventAttacherManager; @@ -410,9 +414,6 @@ void XclEscherEx::EndDocument() mpOutStrm->Seek( 0 ); } -//delete for exporting OCX -//#if EXC_EXP_OCX_CTRL - XclExpOcxControlObj* XclEscherEx::CreateOCXCtrlObj( Reference< XShape > xShape, const Rectangle* pChildAnchor ) { ::std::auto_ptr< XclExpOcxControlObj > xOcxCtrl; @@ -425,15 +426,17 @@ XclExpOcxControlObj* XclEscherEx::CreateOCXCtrlObj( Reference< XShape > xShape, mxCtlsStrm = OpenStream( EXC_STREAM_CTLS ); if( mxCtlsStrm.Is() ) { - String aClassName; + OUString aClassName; sal_uInt32 nStrmStart = static_cast< sal_uInt32 >( mxCtlsStrm->Tell() ); // writes from xCtrlModel into mxCtlsStrm, raw class name returned in aClassName - if( SvxMSConvertOCXControls::WriteOCXExcelKludgeStream( mxCtlsStrm, xCtrlModel, xShape->getSize(), aClassName ) ) + Reference< XOutputStream > xOut( new utl::OSeekableOutputStreamWrapper( *mxCtlsStrm ) ); + Reference< com::sun::star::frame::XModel > xModel( GetDocShell() ? GetDocShell()->GetModel() : NULL ); + if( xModel.is() && xOut.is() && oox::ole::MSConvertOCXControls::WriteOCXExcelKludgeStream( xModel, xOut, xCtrlModel, xShape->getSize(), aClassName ) ) { sal_uInt32 nStrmSize = static_cast< sal_uInt32 >( mxCtlsStrm->Tell() - nStrmStart ); // adjust the class name to "Forms.***.1" - aClassName.InsertAscii( "Forms.", 0 ).AppendAscii( ".1" ); + aClassName = "Forms." + aClassName + ".1"; xOcxCtrl.reset( new XclExpOcxControlObj( mrObjMgr, xShape, pChildAnchor, aClassName, nStrmStart, nStrmSize ) ); } } @@ -441,8 +444,6 @@ XclExpOcxControlObj* XclEscherEx::CreateOCXCtrlObj( Reference< XShape > xShape, return xOcxCtrl.release(); } -//#else - XclExpTbxControlObj* XclEscherEx::CreateTBXCtrlObj( Reference< XShape > xShape, const Rectangle* pChildAnchor ) { ::std::auto_ptr< XclExpTbxControlObj > xTbxCtrl( new XclExpTbxControlObj( mrObjMgr, xShape, pChildAnchor ) ); @@ -511,8 +512,6 @@ void XclEscherEx::ConvertTbxMacro( XclExpTbxControlObj& rTbxCtrlObj, Reference< } } -//#endif - void XclEscherEx::DeleteCurrAppData() { if ( pCurrAppData ) |