From 31bf558349d9ab2634e9a866edf79bc115d649ce Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 11 Mar 2020 13:43:39 +0200 Subject: Revert "loplugin:constfields in oox" This reverts commit a84e3df74eecc8778e3d5be5dd80ad4ddb511edf. Now that we know that making fields has negative side effects like disabling assignment operator generation. Change-Id: I7b45b7ead281cf3a9202ca6aabc55ee5033e5331 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90332 Tested-by: Noel Grandin Reviewed-by: Noel Grandin --- oox/source/ole/axcontrol.cxx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'oox/source/ole/axcontrol.cxx') diff --git a/oox/source/ole/axcontrol.cxx b/oox/source/ole/axcontrol.cxx index 8ce93ea1ffa5..ebdf845310e5 100644 --- a/oox/source/ole/axcontrol.cxx +++ b/oox/source/ole/axcontrol.cxx @@ -661,7 +661,9 @@ ComCtlModelBase::ComCtlModelBase( sal_uInt32 nDataPartId5, sal_uInt32 nDataPartI mnFlags( 0 ), mnVersion( nVersion ), mnDataPartId5( nDataPartId5 ), - mnDataPartId6( nDataPartId6 ) + mnDataPartId6( nDataPartId6 ), + mbCommonPart( true ), + mbComplexPart( true ) { } @@ -671,13 +673,15 @@ bool ComCtlModelBase::importBinaryModel( BinaryInputStream& rInStrm ) if( importSizePart( rInStrm ) && readPartHeader( rInStrm, getDataPartId(), mnVersion ) ) { // if flags part exists, the first int32 of the data part contains its size - sal_uInt32 nCommonPartSize = rInStrm.readuInt32(); + sal_uInt32 nCommonPartSize = 0; + if (mbCommonPart) + nCommonPartSize = rInStrm.readuInt32(); // implementations must read the exact amount of data, stream must point to its end afterwards importControlData( rInStrm ); // read following parts if( !rInStrm.isEof() && - importCommonPart( rInStrm, nCommonPartSize ) && - importComplexPart( rInStrm ) ) + (!mbCommonPart || importCommonPart( rInStrm, nCommonPartSize )) && + (!mbComplexPart || importComplexPart( rInStrm )) ) { return !rInStrm.isEof(); } @@ -687,7 +691,8 @@ bool ComCtlModelBase::importBinaryModel( BinaryInputStream& rInStrm ) void ComCtlModelBase::convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const { - rPropMap.setProperty( PROP_Enabled, getFlag( mnFlags, COMCTL_COMMON_ENABLED ) ); + if( mbCommonPart ) + rPropMap.setProperty( PROP_Enabled, getFlag( mnFlags, COMCTL_COMMON_ENABLED ) ); ControlModelBase::convertProperties( rPropMap, rConv ); } -- cgit