summaryrefslogtreecommitdiffstats
path: root/oox
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2013-06-10 17:30:07 +0100
committerNoel Power <noel.power@suse.com>2013-06-11 14:10:01 +0100
commit866845356629dd51660b73330bb9c8a2696147dd (patch)
tree2d2a48289de1a877acbda4dacdbd7df9d47b19e5 /oox
parentResolves: #i121045 After save a xls file contain marco in AOO, macor can't... (diff)
downloadcore-866845356629dd51660b73330bb9c8a2696147dd.tar.gz
core-866845356629dd51660b73330bb9c8a2696147dd.zip
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 'oox')
-rw-r--r--oox/source/ole/olehelper.cxx31
1 files changed, 31 insertions, 0 deletions
diff --git a/oox/source/ole/olehelper.cxx b/oox/source/ole/olehelper.cxx
index e87f2cde88a7..58aa67e485f2 100644
--- a/oox/source/ole/olehelper.cxx
+++ b/oox/source/ole/olehelper.cxx
@@ -284,6 +284,22 @@ sal_uInt32 OleHelper::encodeOleColor( sal_Int32 nRgbColor )
return OLE_COLORTYPE_BGR | lclSwapRedBlue( static_cast< sal_uInt32 >( nRgbColor & 0xFFFFFF ) );
}
+void OleHelper::exportGuid( BinaryOutputStream& rOStr, const SvGlobalName& rId )
+{
+ const sal_uInt8* pBytes = rId.GetBytes();
+ sal_uInt32 a;
+ memcpy(&a, pBytes, sizeof(sal_uInt32));
+ rOStr<< a;
+
+ sal_uInt16 b;
+ memcpy(&b, pBytes+4, sizeof(sal_uInt16));
+ rOStr << b;
+
+ memcpy(&b, pBytes+6, sizeof(sal_uInt16));
+ rOStr << b;
+
+ rOStr.writeArray( (sal_Char *)&pBytes[ 8 ], 8 );
+}
OUString OleHelper::importGuid( BinaryInputStream& rInStrm )
{
OUStringBuffer aBuffer;
@@ -569,6 +585,21 @@ sal_Bool MSConvertOCXControls::ReadOCXStorage( SotStorageRef& xOleStg,
return sal_False;
}
+sal_Bool MSConvertOCXControls::WriteOCXExcelKludgeStream( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxModel, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& xOutStrm, const com::sun::star::uno::Reference< com::sun::star::awt::XControlModel > &rxControlModel, const com::sun::star::awt::Size& rSize,OUString &rName )
+{
+ OleFormCtrlExportHelper exportHelper( comphelper::getProcessComponentContext(), rxModel, rxControlModel );
+ if ( !exportHelper.isValid() )
+ return sal_False;
+ rName = exportHelper.getTypeName();
+ SvGlobalName aName;
+ OUString sId = exportHelper.getGUID();
+ aName.MakeId(sId);
+ BinaryXOutputStream xOut( xOutStrm, false );
+ OleHelper::exportGuid( xOut, aName );
+ exportHelper.exportControl( xOutStrm, rSize );
+ return sal_True;
+}
+
sal_Bool MSConvertOCXControls::WriteOCXStream( const Reference< XModel >& rxModel, SotStorageRef &xOleStg,
const Reference< XControlModel > &rxControlModel,
const com::sun::star::awt::Size& rSize, OUString &rName)