Kaydet (Commit) 7c20a8ed authored tarafından Noel Power's avatar Noel Power

fix morph control export also fix toggle button state export

üst deb2d9b1
...@@ -109,7 +109,7 @@ public: ...@@ -109,7 +109,7 @@ public:
{ if( startNextProperty() ) maOutStrm.writeAligned< StreamType >( ornValue ); } { if( startNextProperty() ) maOutStrm.writeAligned< StreamType >( ornValue ); }
/** Write a boolean property value to the stream, the /** Write a boolean property value to the stream, the
respective flag in the property mask is set. */ respective flag in the property mask is set. */
void writeBoolProperty( bool& orbValue, bool bReverse = false ); void writeBoolProperty( bool orbValue, bool bReverse = false );
/** Write a pair property the stream, the respective flag in /** Write a pair property the stream, the respective flag in
the property mask is set. */ the property mask is set. */
void writePairProperty( AxPairData& orPairData ); void writePairProperty( AxPairData& orPairData );
......
...@@ -164,7 +164,7 @@ AxBinaryPropertyWriter::AxBinaryPropertyWriter( BinaryOutputStream& rOutStrm, bo ...@@ -164,7 +164,7 @@ AxBinaryPropertyWriter::AxBinaryPropertyWriter( BinaryOutputStream& rOutStrm, bo
mnNextProp = 1; mnNextProp = 1;
} }
void AxBinaryPropertyWriter::writeBoolProperty( bool& orbValue, bool bReverse ) void AxBinaryPropertyWriter::writeBoolProperty( bool orbValue, bool bReverse )
{ {
// orbValue ^ bReverse true then we want to set the bit, e.g. don't skip // orbValue ^ bReverse true then we want to set the bit, e.g. don't skip
startNextProperty( !( ( orbValue ^ bReverse ) >= 1 ) ); startNextProperty( !( ( orbValue ^ bReverse ) >= 1 ) );
......
...@@ -540,26 +540,16 @@ void ControlConverter::convertAxState( PropertyMap& rPropMap, ...@@ -540,26 +540,16 @@ void ControlConverter::convertAxState( PropertyMap& rPropMap,
} }
void ControlConverter::convertToAxState( PropertySet& rPropSet, void ControlConverter::convertToAxState( PropertySet& rPropSet,
OUString& rValue, sal_Int32& nMultiSelect, ApiDefaultStateMode eDefStateMode, bool bAwtModel ) const OUString& rValue, sal_Int32& nMultiSelect, ApiDefaultStateMode eDefStateMode, bool /*bAwtModel*/ ) const
{ {
bool bBooleanState = eDefStateMode == API_DEFAULTSTATE_BOOLEAN;
bool bSupportsTriState = eDefStateMode == API_DEFAULTSTATE_TRISTATE; bool bSupportsTriState = eDefStateMode == API_DEFAULTSTATE_TRISTATE;
sal_Int32 nPropId = bAwtModel ? PROP_State : PROP_DefaultState;
sal_Int16 nState = API_STATE_DONTKNOW; sal_Int16 nState = API_STATE_DONTKNOW;
sal_Bool bTmp = sal_False; sal_Bool bTmp = sal_False;
// need to use State for current state ( I think this is regardless of whether
if( bBooleanState ) // control is awt or not )
{ rPropSet.getProperty( nState, PROP_State );
rPropSet.getProperty( bTmp, nPropId );
if ( bTmp )
nState = API_STATE_CHECKED;
else
nState = API_STATE_UNCHECKED;
}
else
rPropSet.getProperty( nState, nPropId );
rValue = rtl::OUString(); // empty e.g. 'don't know' rValue = rtl::OUString(); // empty e.g. 'don't know'
if ( nState == API_STATE_UNCHECKED ) if ( nState == API_STATE_UNCHECKED )
...@@ -1475,7 +1465,7 @@ void AxMorphDataModelBase::exportBinaryModel( BinaryOutputStream& rOutStrm ) ...@@ -1475,7 +1465,7 @@ void AxMorphDataModelBase::exportBinaryModel( BinaryOutputStream& rOutStrm )
aWriter.skipProperty(); aWriter.skipProperty();
aWriter.skipProperty(); // drop down style aWriter.skipProperty(); // drop down style
aWriter.writeIntProperty< sal_uInt8 >( mnMultiSelect ); aWriter.writeIntProperty< sal_uInt8 >( mnMultiSelect );
aWriter.skipProperty(); // maValue; aWriter.writeStringProperty( maValue );
aWriter.writeStringProperty( maCaption ); aWriter.writeStringProperty( maCaption );
aWriter.skipProperty(); // mnPicturePos ); aWriter.skipProperty(); // mnPicturePos );
aWriter.writeIntProperty< sal_uInt32 >( mnBorderColor ); aWriter.writeIntProperty< sal_uInt32 >( mnBorderColor );
...@@ -1484,7 +1474,7 @@ void AxMorphDataModelBase::exportBinaryModel( BinaryOutputStream& rOutStrm ) ...@@ -1484,7 +1474,7 @@ void AxMorphDataModelBase::exportBinaryModel( BinaryOutputStream& rOutStrm )
aWriter.skipProperty(); // maPictureData aWriter.skipProperty(); // maPictureData
aWriter.skipProperty(); // accelerator aWriter.skipProperty(); // accelerator
aWriter.skipProperty(); // undefined aWriter.skipProperty(); // undefined
aWriter.skipProperty(); // some bool aWriter.writeBoolProperty(true); // must be 1 for morph
aWriter.writeStringProperty( maGroupName ); aWriter.writeStringProperty( maGroupName );
aWriter.finalizeExport(); aWriter.finalizeExport();
AxFontDataModel::exportBinaryModel( rOutStrm ); AxFontDataModel::exportBinaryModel( rOutStrm );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment