summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJianyuan Li <lijiany@apache.org>2012-09-25 04:48:42 +0000
committerNoel Power <noel.power@suse.com>2013-06-11 14:10:01 +0100
commit74d631dfb37ec870575d873c82e982a58f65d60c (patch)
treeb5924443650c01a1bfc1d6fc8129619ff813fb06
parent0b84b7d0f2bdd2d8c0620f3eafca8f0dd0761ed3 (diff)
Resolves: #i121045 After save a xls file contain marco in AOO, macor can't...
Reported by: binguo Reviewed by: sunying Patched by: Jianyuan Li Change-Id: Ie728ce5185082334e3ce250d73e0660a6097f494
-rw-r--r--forms/source/component/FormComponent.cxx38
-rw-r--r--forms/source/inc/FormComponent.hxx5
-rw-r--r--forms/source/inc/frm_strings.hxx2
-rw-r--r--forms/source/inc/property.hrc2
-rw-r--r--sc/source/filter/excel/xeescher.cxx9
-rw-r--r--sc/source/filter/excel/xiescher.cxx74
-rw-r--r--sc/source/filter/inc/xcl97esc.hxx14
-rw-r--r--sc/source/filter/inc/xeescher.hxx7
-rw-r--r--sc/source/filter/xcl97/xcl97esc.cxx66
-rw-r--r--svx/source/unodraw/unoshap2.cxx3
10 files changed, 186 insertions, 34 deletions
diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx
index eb32945619f8..7f70fc8219df 100644
--- a/forms/source/component/FormComponent.cxx
+++ b/forms/source/component/FormComponent.cxx
@@ -585,6 +585,8 @@ OControlModel::OControlModel(
,m_nClassId(FormComponentType::CONTROL)
,m_bNativeLook( sal_False )
,m_bGenerateVbEvents( sal_False )
+ ,m_nControlTypeinMSO(0) // 0 : default value is create from AOO
+ ,m_nObjIDinMSO(INVALID_OBJ_ID_IN_MSO)
// form controls are usually embedded into documents, not dialogs, and in documents
// the native look is ugly ....
// #i37342#
@@ -641,6 +643,8 @@ OControlModel::OControlModel( const OControlModel* _pOriginal, const Reference<
m_nClassId = _pOriginal->m_nClassId;
m_bNativeLook = _pOriginal->m_bNativeLook;
m_bGenerateVbEvents = _pOriginal->m_bGenerateVbEvents;
+ m_nControlTypeinMSO = _pOriginal->m_nControlTypeinMSO;
+ m_nObjIDinMSO = _pOriginal->m_nObjIDinMSO;
if ( _bCloneAggregate )
{
@@ -982,8 +986,13 @@ Any OControlModel::getPropertyDefaultByHandle( sal_Int32 _nHandle ) const
case PROPERTY_ID_GENERATEVBAEVENTS:
aReturn <<= (sal_Bool)sal_False;
break;
-
-
+ //added for exporting OCX control
+ case PROPERTY_ID_CONTROL_TYPE_IN_MSO:
+ aReturn <<= (sal_Int16)0;
+ break;
+ case PROPERTY_ID_OBJ_ID_IN_MSO:
+ aReturn <<= (sal_uInt16)INVALID_OBJ_ID_IN_MSO;
+ break;
default:
if ( m_aPropertyBagHelper.hasDynamicPropertyByHandle( _nHandle ) )
m_aPropertyBagHelper.getDynamicPropertyDefaultByHandle( _nHandle, aReturn );
@@ -1015,6 +1024,13 @@ void OControlModel::getFastPropertyValue( Any& _rValue, sal_Int32 _nHandle ) con
break;
case PROPERTY_ID_GENERATEVBAEVENTS:
_rValue <<= (sal_Bool)m_bGenerateVbEvents;
+ //added for exporting OCX control
+ case PROPERTY_ID_CONTROL_TYPE_IN_MSO:
+ _rValue <<= (sal_Int16)m_nControlTypeinMSO;
+ break;
+ case PROPERTY_ID_OBJ_ID_IN_MSO:
+ _rValue <<= (sal_uInt16)m_nObjIDinMSO;
+ break;
default:
if ( m_aPropertyBagHelper.hasDynamicPropertyByHandle( _nHandle ) )
m_aPropertyBagHelper.getDynamicFastPropertyValue( _nHandle, _rValue );
@@ -1047,6 +1063,13 @@ sal_Bool OControlModel::convertFastPropertyValue(
case PROPERTY_ID_GENERATEVBAEVENTS:
bModified = tryPropertyValue(_rConvertedValue, _rOldValue, _rValue, m_bGenerateVbEvents);
break;
+ //added for exporting OCX control
+ case PROPERTY_ID_CONTROL_TYPE_IN_MSO:
+ bModified = tryPropertyValue(_rConvertedValue, _rOldValue, _rValue, m_nControlTypeinMSO);
+ break;
+ case PROPERTY_ID_OBJ_ID_IN_MSO:
+ bModified = tryPropertyValue(_rConvertedValue, _rOldValue, _rValue, m_nObjIDinMSO);
+ break;
default:
if ( m_aPropertyBagHelper.hasDynamicPropertyByHandle( _nHandle ) )
bModified = m_aPropertyBagHelper.convertDynamicFastPropertyValue( _nHandle, _rValue, _rConvertedValue, _rOldValue );
@@ -1084,6 +1107,13 @@ void OControlModel::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, const A
case PROPERTY_ID_GENERATEVBAEVENTS:
OSL_VERIFY( _rValue >>= m_bGenerateVbEvents );
break;
+ //added for exporting OCX control
+ case PROPERTY_ID_CONTROL_TYPE_IN_MSO:
+ OSL_VERIFY( _rValue >>= m_nControlTypeinMSO );
+ break;
+ case PROPERTY_ID_OBJ_ID_IN_MSO:
+ OSL_VERIFY( _rValue >>= m_nObjIDinMSO );
+ break;
default:
if ( m_aPropertyBagHelper.hasDynamicPropertyByHandle( _nHandle ) )
m_aPropertyBagHelper.setDynamicFastPropertyValue( _nHandle, _rValue );
@@ -1096,12 +1126,14 @@ void OControlModel::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, const A
//------------------------------------------------------------------------------
void OControlModel::describeFixedProperties( Sequence< Property >& _rProps ) const
{
- BEGIN_DESCRIBE_BASE_PROPERTIES( 5 )
+ BEGIN_DESCRIBE_BASE_PROPERTIES( 7 )
DECL_PROP2 (CLASSID, sal_Int16, READONLY, TRANSIENT);
DECL_PROP1 (NAME, OUString, BOUND);
DECL_BOOL_PROP2 (NATIVE_LOOK, BOUND, TRANSIENT);
DECL_PROP1 (TAG, OUString, BOUND);
DECL_PROP1 (GENERATEVBAEVENTS, sal_Bool, TRANSIENT);
+ DECL_PROP1 (CONTROL_TYPE_IN_MSO,sal_Int16, BOUND);
+ DECL_PROP1 (OBJ_ID_IN_MSO,sal_uInt16, BOUND);
END_DESCRIBE_PROPERTIES()
}
diff --git a/forms/source/inc/FormComponent.hxx b/forms/source/inc/FormComponent.hxx
index 5429c368a7e4..a89043f36de7 100644
--- a/forms/source/inc/FormComponent.hxx
+++ b/forms/source/inc/FormComponent.hxx
@@ -329,6 +329,8 @@ protected:
//= OControlModel
//= model of a form layer control
//==================================================================
+//added for exporting OCX control
+#define INVALID_OBJ_ID_IN_MSO 0xFFFF
typedef ::cppu::ImplHelper7 < ::com::sun::star::form::XFormComponent
, ::com::sun::star::io::XPersistObject
@@ -366,6 +368,9 @@ protected:
sal_Int16 m_nClassId; // type of the control
sal_Bool m_bNativeLook; // should the control use the native platform look?
sal_Bool m_bGenerateVbEvents; // should the control generate fake vba events
+ //added for exporting OCX control
+ sal_Int16 m_nControlTypeinMSO; //keep the MS office control type for exporting to MS binarary file
+ sal_uInt16 m_nObjIDinMSO; //keep the OCX control obj id for exporting to MS binarary file
// </properties>
diff --git a/forms/source/inc/frm_strings.hxx b/forms/source/inc/frm_strings.hxx
index 7de3f24787fb..21718153178b 100644
--- a/forms/source/inc/frm_strings.hxx
+++ b/forms/source/inc/frm_strings.hxx
@@ -267,6 +267,8 @@ namespace frm
#define PROPERTY_CONTROL_BORDER_COLOR_MOUSE "ControlBorderColorOnHover"
#define PROPERTY_CONTROL_BORDER_COLOR_INVALID "ControlBorderColorOnInvalid"
#define PROPERTY_GENERATEVBAEVENTS "GenerateVbaEvents"
+ #define PROPERTY_CONTROL_TYPE_IN_MSO "ControlTypeinMSO"
+ #define PROPERTY_OBJ_ID_IN_MSO "ObjIDinMSO"
//--------------------------------------------------------------------------
//- URLs
diff --git a/forms/source/inc/property.hrc b/forms/source/inc/property.hrc
index af0ed334edb6..a35aa65db4e4 100644
--- a/forms/source/inc/property.hrc
+++ b/forms/source/inc/property.hrc
@@ -291,6 +291,8 @@ namespace frm
#define PROPERTY_ID_LINEEND_FORMAT ( PROPERTY_ID_START + 259 ) // css.awt.LineEndFormat
#define PROPERTY_ID_GENERATEVBAEVENTS ( PROPERTY_ID_START + 260 )
+#define PROPERTY_ID_CONTROL_TYPE_IN_MSO ( PROPERTY_ID_START + 261 )
+#define PROPERTY_ID_OBJ_ID_IN_MSO ( PROPERTY_ID_START + 262 )
// start ID fuer aggregierte Properties
#define PROPERTY_ID_AGGREGATE_ID (PROPERTY_ID_START + 10000)
diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx
index 77bfcb78bce5..54f9eac08f06 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -505,7 +505,8 @@ void XclExpControlHelper::WriteFormulaSubRec( XclExpStream& rStrm, sal_uInt16 nS
// ----------------------------------------------------------------------------
-#if EXC_EXP_OCX_CTRL
+//delete for exporting OCX
+//#if EXC_EXP_OCX_CTRL
XclExpOcxControlObj::XclExpOcxControlObj( XclExpObjectManager& rObjMgr, Reference< XShape > xShape,
const Rectangle* pChildAnchor, const String& rClassName, sal_uInt32 nStrmStart, sal_uInt32 nStrmSize ) :
@@ -527,7 +528,7 @@ XclExpOcxControlObj::XclExpOcxControlObj( XclExpObjectManager& rObjMgr, Referenc
mrEscherEx.OpenContainer( ESCHER_SpContainer );
mrEscherEx.AddShape( ESCHER_ShpInst_HostControl, SHAPEFLAG_HAVESPT | SHAPEFLAG_HAVEANCHOR | SHAPEFLAG_OLESHAPE );
Rectangle aDummyRect;
- EscherPropertyContainer aPropOpt( mrEscherEx, mrEscherEx.QueryPicStream(), aDummyRect );
+ EscherPropertyContainer aPropOpt( mrEscherEx.GetGraphicProvider(), mrEscherEx.QueryPictureStream(), aDummyRect );
aPropOpt.AddOpt( ESCHER_Prop_FitTextToShape, 0x00080008 ); // bool field
aPropOpt.AddOpt( ESCHER_Prop_lineColor, 0x08000040 );
aPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x00080000 ); // bool field
@@ -610,7 +611,7 @@ void XclExpOcxControlObj::WriteSubRecs( XclExpStream& rStrm )
rStrm.EndRecord();
}
-#else
+//#else
XclExpTbxControlObj::XclExpTbxControlObj( XclExpObjectManager& rRoot, Reference< XShape > xShape , const Rectangle* pChildAnchor ) :
XclObj( rRoot, EXC_OBJTYPE_UNKNOWN, true ),
@@ -1035,7 +1036,7 @@ void XclExpTbxControlObj::WriteSbs( XclExpStream& rStrm )
rStrm.EndRecord();
}
-#endif
+//#endif
// ----------------------------------------------------------------------------
diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx
index 3c530f023005..241a7158eb8c 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -39,6 +39,7 @@
#include <com/sun/star/form/binding/XListEntrySource.hpp>
#include <com/sun/star/script/ScriptEventDescriptor.hpp>
#include <com/sun/star/script/XEventAttacherManager.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
#include <rtl/logfile.hxx>
#include <sfx2/objsh.hxx>
@@ -110,6 +111,8 @@
using ::com::sun::star::uno::makeAny;
using ::com::sun::star::uno::Any;
+using ::com::sun::star::beans::XPropertySet;
+using ::com::sun::star::uno::makeAny;
using ::com::sun::star::uno::Exception;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
@@ -455,6 +458,77 @@ SdrObject* XclImpDrawObjBase::CreateSdrObject( XclImpDffConverter& rDffConv, con
xSdrObj.reset( DoCreateSdrObj( rDffConv, rAnchorRect ) );
if( xSdrObj.is() )
xSdrObj->SetModel( rDffConv.GetModel() );
+ //added for exporting OCX control
+ /* mnObjType value set should be as below table:
+ 0x0000 Group 0x0001 Line
+ 0x0002 Rectangle 0x0003 Oval
+ 0x0004 Arc 0x0005 Chart
+ 0x0006 Text 0x0009 Polygon
+ +-----------------------------------------------------+
+ OCX ==>| 0x0008 Picture |
+ +-----------------------------------------------------+
+ | 0x0007 Button |
+ | 0x000B Checkbox 0x000C Radio button |
+ | 0x000D Edit box 0x000E Label |
+ TBX ==> | 0x000F Dialog box 0x0010 Spin control |
+ | 0x0011 Scrollbar 0x0012 List |
+ | 0x0013 Group box 0x0014 Dropdown list |
+ +-----------------------------------------------------+
+ 0x0019 Note 0x001E OfficeArt object
+ */
+ if( xSdrObj.is() && xSdrObj->IsUnoObj() &&
+ ( (mnObjType < 25 && mnObjType > 10) || mnObjType == 7 || mnObjType == 8 ) )
+ {
+ SdrUnoObj* pSdrUnoObj = dynamic_cast< SdrUnoObj* >( xSdrObj.get() );
+ if( pSdrUnoObj != NULL )
+ {
+ Reference< XControlModel > xCtrlModel = pSdrUnoObj->GetUnoControlModel();
+ Reference< XPropertySet > xPropSet(xCtrlModel,UNO_QUERY);
+ const static rtl::OUString sPropertyName = rtl::OUString::createFromAscii("ControlTypeinMSO");
+
+ enum ControlType { eCreateFromOffice = 0, eCreateFromMSTBXControl, eCreateFromMSOCXControl };
+
+ if( mnObjType == 7 || (mnObjType < 25 && mnObjType > 10) )//TBX
+ {
+ //Need summary type for export. Detail type(checkbox, button ...) has been contained by mnObjType
+ const sal_Int16 nTBXControlType = eCreateFromMSTBXControl ;
+ Any aAny;
+ aAny <<= nTBXControlType;
+ try
+ {
+ xPropSet->setPropertyValue(sPropertyName, aAny);
+ }
+ catch(const Exception&)
+ {
+ OSL_TRACE("XclImpDrawObjBase::CreateSdrObject, this control can't be set the property ControlTypeinMSO!");
+ }
+ }
+ if( mnObjType == 8 )//OCX
+ {
+ //Need summary type for export
+ const static rtl::OUString sObjIdPropertyName = rtl::OUString::createFromAscii("ObjIDinMSO");
+ const XclImpPictureObj* const pObj = dynamic_cast< const XclImpPictureObj* const >(this);
+ if( pObj != NULL && pObj->IsOcxControl() )
+ {
+ const sal_Int16 nOCXControlType = eCreateFromMSOCXControl;
+ Any aAny;
+ try
+ {
+ aAny <<= nOCXControlType;
+ xPropSet->setPropertyValue(sPropertyName, aAny);
+ //Detail type(checkbox, button ...)
+ aAny<<= mnObjId;
+ xPropSet->setPropertyValue(sObjIdPropertyName, aAny);
+ }
+ catch(const Exception&)
+ {
+ OSL_TRACE("XclImpDrawObjBase::CreateSdrObject, this control can't be set the property ObjIDinMSO!");
+ }
+ }
+ }
+
+ }
+ }
}
return xSdrObj.release();
}
diff --git a/sc/source/filter/inc/xcl97esc.hxx b/sc/source/filter/inc/xcl97esc.hxx
index 4ce70eea5330..7d0b501976dc 100644
--- a/sc/source/filter/inc/xcl97esc.hxx
+++ b/sc/source/filter/inc/xcl97esc.hxx
@@ -27,9 +27,6 @@
#include "xeroot.hxx"
#include <vector>
-// 0 = Export TBX form controls, 1 = Export OCX form controls.
-#define EXC_EXP_OCX_CTRL 0
-
namespace utl { class TempFile; }
// ============================================================================
@@ -59,11 +56,8 @@ class XclExpDffAnchorBase;
class XclEscherHostAppData;
class XclEscherClientData;
class XclEscherClientTextbox;
-#if EXC_EXP_OCX_CTRL
class XclExpOcxControlObj;
-#else
class XclExpTbxControlObj;
-#endif
class XclExpShapeObj;
class EscherExHostAppData;
class ShapeInteractionHelper
@@ -111,19 +105,16 @@ public:
/// Flush and merge PicStream into EscherStream
void EndDocument();
-
-#if EXC_EXP_OCX_CTRL
/** Creates an OCX form control OBJ record from the passed form control.
@descr Writes the form control data to the 'Ctls' stream. */
- XclExpOcxControlObj* CreateCtrlObj(
+ XclExpOcxControlObj* CreateOCXCtrlObj(
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape,
const Rectangle* pChildAnchor );
private:
SotStorageStreamRef mxCtlsStrm; /// The 'Ctls' stream.
-#else
/** Creates a TBX form control OBJ record from the passed form control. */
- XclExpTbxControlObj* CreateCtrlObj(
+ XclExpTbxControlObj* CreateTBXCtrlObj(
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape,
const Rectangle* pChildAnchor );
@@ -133,7 +124,6 @@ private:
XclExpTbxControlObj& rTbxCtrlObj,
::com::sun::star::uno::Reference<
::com::sun::star::awt::XControlModel > xCtrlModel );
-#endif
void DeleteCurrAppData();
diff --git a/sc/source/filter/inc/xeescher.hxx b/sc/source/filter/inc/xeescher.hxx
index 9c91e7246a46..cfb396a1459e 100644
--- a/sc/source/filter/inc/xeescher.hxx
+++ b/sc/source/filter/inc/xeescher.hxx
@@ -236,7 +236,8 @@ private:
// ----------------------------------------------------------------------------
-#if EXC_EXP_OCX_CTRL
+//delete for exporting OCX
+//#if EXC_EXP_OCX_CTRL
/** Represents an OBJ record for an OCX form control. */
class XclExpOcxControlObj : public XclObj, public XclExpControlHelper
@@ -258,7 +259,7 @@ private:
sal_uInt32 mnStrmSize; /// Size in 'Ctls' stream.
};
-#else
+//#else
/** Represents an OBJ record for an TBX form control. */
class XclExpTbxControlObj : public XclObj, public XclMacroHelper
@@ -299,7 +300,7 @@ private:
bool mbScrollHor; /// Scrollbar: true = horizontal.
};
-#endif
+//#endif
// ----------------------------------------------------------------------------
diff --git a/sc/source/filter/xcl97/xcl97esc.cxx b/sc/source/filter/xcl97/xcl97esc.cxx
index 6d7a15b41a45..4ffad4065066 100644
--- a/sc/source/filter/xcl97/xcl97esc.cxx
+++ b/sc/source/filter/xcl97/xcl97esc.cxx
@@ -23,6 +23,8 @@
#include <com/sun/star/form/XFormsSupplier.hpp>
#include <com/sun/star/script/ScriptEventDescriptor.hpp>
#include <com/sun/star/script/XEventAttacherManager.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/form/XForm.hpp>
#include <svx/svdpage.hxx>
#include <editeng/outlobj.hxx>
@@ -61,6 +63,10 @@ using ::com::sun::star::container::XIndexAccess;
using ::com::sun::star::embed::XClassifiedObject;
using ::com::sun::star::drawing::XShape;
using ::com::sun::star::awt::XControlModel;
+using ::com::sun::star::beans::XPropertySet;
+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::script::ScriptEventDescriptor;
using ::com::sun::star::script::XEventAttacherManager;
@@ -200,6 +206,8 @@ EscherExHostAppData* XclEscherEx::StartShape( const Reference< XShape >& rxShape
aStack.push( std::make_pair( pCurrXclObj, pCurrAppData ) );
pCurrAppData = new XclEscherHostAppData;
SdrObject* pObj = GetSdrObjectFromXShape( rxShape );
+ //added for exporting OCX control
+ sal_Int16 nMsCtlType = 0;
if ( !pObj )
pCurrXclObj = new XclObjAny( mrObjMgr, rxShape ); // just what is it?!?
else
@@ -233,13 +241,22 @@ EscherExHostAppData* XclEscherEx::StartShape( const Reference< XShape >& rxShape
}
else if( nObjType == OBJ_UNO )
{
-#if EXC_EXP_OCX_CTRL
- // no ActiveX controls in embedded drawings (chart shapes)
- if( mbIsRootDff )
- pCurrXclObj = CreateCtrlObj( rxShape, pChildAnchor );
-#else
- pCurrXclObj = CreateCtrlObj( rxShape, pChildAnchor );
-#endif
+ //added for exporting OCX control
+ Reference< XPropertySet > xPropSet( rxShape, UNO_QUERY );
+ Any aAny;
+ try
+ {
+ aAny = xPropSet->getPropertyValue(rtl::OUString::createFromAscii("ControlTypeinMSO"));
+ aAny >>= nMsCtlType;
+ }
+ catch(const Exception&)
+ {
+ OSL_TRACE("XclEscherEx::StartShape, this control can't get the property ControlTypeinMSO!");
+ }
+ if( nMsCtlType == 2 ) //OCX Form Control
+ pCurrXclObj = CreateOCXCtrlObj( rxShape, pChildAnchor );
+ else //TBX Form Control
+ pCurrXclObj = CreateTBXCtrlObj( rxShape, pChildAnchor );
if( !pCurrXclObj )
pCurrXclObj = new XclObjAny( mrObjMgr, rxShape ); // just a metafile
}
@@ -298,6 +315,30 @@ EscherExHostAppData* XclEscherEx::StartShape( const Reference< XShape >& rxShape
}
}
}
+ //add for exporting OCX control
+ //for OCX control import from MS office file,we need keep the id value as MS office file.
+ //GetOldRoot().pObjRecs->Add( pCurrXclObj ) statement has generated the id value as obj id rule;
+ //but we trick it here.
+ sal_uInt16 nObjType = pObj->GetObjIdentifier();
+ if( nObjType == OBJ_UNO && pCurrXclObj )
+ {
+ Reference< XPropertySet > xPropSet( rxShape, UNO_QUERY );
+ Any aAny;
+ try
+ {
+ aAny = xPropSet->getPropertyValue(rtl::OUString::createFromAscii("ObjIDinMSO"));
+ }
+ catch(const Exception&)
+ {
+ OSL_TRACE("XclEscherEx::StartShape, this control can't get the property ObjIDinMSO!");
+ }
+ sal_uInt16 nObjIDinMSO = 0xFFFF;
+ aAny >>= nObjIDinMSO;
+ if( nObjIDinMSO != 0xFFFF && nMsCtlType == 2) //OCX
+ {
+ pCurrXclObj->SetId(nObjIDinMSO);
+ }
+ }
if ( !pCurrXclObj )
pCurrAppData->SetDontWriteShape( sal_True );
return pCurrAppData;
@@ -369,9 +410,10 @@ void XclEscherEx::EndDocument()
mpOutStrm->Seek( 0 );
}
-#if EXC_EXP_OCX_CTRL
+//delete for exporting OCX
+//#if EXC_EXP_OCX_CTRL
-XclExpOcxControlObj* XclEscherEx::CreateCtrlObj( Reference< XShape > xShape, const Rectangle* pChildAnchor )
+XclExpOcxControlObj* XclEscherEx::CreateOCXCtrlObj( Reference< XShape > xShape, const Rectangle* pChildAnchor )
{
::std::auto_ptr< XclExpOcxControlObj > xOcxCtrl;
@@ -399,9 +441,9 @@ XclExpOcxControlObj* XclEscherEx::CreateCtrlObj( Reference< XShape > xShape, con
return xOcxCtrl.release();
}
-#else
+//#else
-XclExpTbxControlObj* XclEscherEx::CreateCtrlObj( Reference< XShape > xShape, const Rectangle* pChildAnchor )
+XclExpTbxControlObj* XclEscherEx::CreateTBXCtrlObj( Reference< XShape > xShape, const Rectangle* pChildAnchor )
{
::std::auto_ptr< XclExpTbxControlObj > xTbxCtrl( new XclExpTbxControlObj( mrObjMgr, xShape, pChildAnchor ) );
if( xTbxCtrl->GetObjType() == EXC_OBJTYPE_UNKNOWN )
@@ -469,7 +511,7 @@ void XclEscherEx::ConvertTbxMacro( XclExpTbxControlObj& rTbxCtrlObj, Reference<
}
}
-#endif
+//#endif
void XclEscherEx::DeleteCurrAppData()
{
diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx
index 0b89df29f7a4..546b890ab987 100644
--- a/svx/source/unodraw/unoshap2.cxx
+++ b/svx/source/unodraw/unoshap2.cxx
@@ -688,6 +688,9 @@ SvxShapeControlPropertyMapping[] =
{ MAP_CHAR_LEN("ControlTextEmphasis"), MAP_CHAR_LEN("FontEmphasisMark") },
{ MAP_CHAR_LEN("ImageScaleMode"), MAP_CHAR_LEN("ScaleMode") },
{ MAP_CHAR_LEN("ControlWritingMode"), MAP_CHAR_LEN("WritingMode") },
+ //added for exporting OCX control
+ { MAP_CHAR_LEN("ControlTypeinMSO"), MAP_CHAR_LEN("ControlTypeinMSO") },
+ { MAP_CHAR_LEN("ObjIDinMSO"), MAP_CHAR_LEN("ObjIDinMSO") },
{ NULL,0, NULL, 0 }
};