diff options
author | Jianyuan Li <lijiany@apache.org> | 2012-09-25 04:48:42 +0000 |
---|---|---|
committer | Noel Power <noel.power@suse.com> | 2013-06-11 14:10:01 +0100 |
commit | 74d631dfb37ec870575d873c82e982a58f65d60c (patch) | |
tree | b5924443650c01a1bfc1d6fc8129619ff813fb06 /forms/source | |
parent | 0b84b7d0f2bdd2d8c0620f3eafca8f0dd0761ed3 (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
Diffstat (limited to 'forms/source')
-rw-r--r-- | forms/source/component/FormComponent.cxx | 38 | ||||
-rw-r--r-- | forms/source/inc/FormComponent.hxx | 5 | ||||
-rw-r--r-- | forms/source/inc/frm_strings.hxx | 2 | ||||
-rw-r--r-- | forms/source/inc/property.hrc | 2 |
4 files changed, 44 insertions, 3 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) |