Kaydet (Commit) ca0600f0 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

multiple unsequenced modifications to 'nPos' [-Werror,-Wunsequenced]

...solved by removing the nPos member and instead calculating the index on the
fly.  The difference is that old indices were before calling std::sort in
OPropertyInfoService::getPropertyInfo() while new ones are after, but that
should probably be OK per the documentation of
com.sun.star.inspection.XObjectInspectionModel.getPropertyOrderIndex (which
appears to be the only client of that functionality).

Change-Id: Id346bb219acbdad88ec43cf46feca8c37f2c7cf4
üst b88fe998
...@@ -44,26 +44,23 @@ namespace pcr ...@@ -44,26 +44,23 @@ namespace pcr
String sTranslation; String sTranslation;
rtl::OString sHelpId; rtl::OString sHelpId;
sal_Int32 nId; sal_Int32 nId;
sal_uInt16 nPos;
sal_uInt32 nUIFlags; sal_uInt32 nUIFlags;
OPropertyInfoImpl( OPropertyInfoImpl(
const ::rtl::OUString& rName, const ::rtl::OUString& rName,
sal_Int32 _nId, sal_Int32 _nId,
const String& aTranslation, const String& aTranslation,
sal_uInt16 nPosId,
const rtl::OString&, const rtl::OString&,
sal_uInt32 _nUIFlags); sal_uInt32 _nUIFlags);
}; };
//------------------------------------------------------------------------ //------------------------------------------------------------------------
OPropertyInfoImpl::OPropertyInfoImpl(const ::rtl::OUString& _rName, sal_Int32 _nId, OPropertyInfoImpl::OPropertyInfoImpl(const ::rtl::OUString& _rName, sal_Int32 _nId,
const String& aString, sal_uInt16 nP, const rtl::OString& sHid, sal_uInt32 _nUIFlags) const String& aString, const rtl::OString& sHid, sal_uInt32 _nUIFlags)
:sName(_rName) :sName(_rName)
,sTranslation(aString) ,sTranslation(aString)
,sHelpId(sHid) ,sHelpId(sHid)
,nId(_nId) ,nId(_nId)
,nPos(nP)
,nUIFlags(_nUIFlags) ,nUIFlags(_nUIFlags)
{ {
} }
...@@ -83,7 +80,7 @@ namespace pcr ...@@ -83,7 +80,7 @@ namespace pcr
//======================================================================== //========================================================================
#define DEF_INFO( ident, uinameres, helpid, flags ) \ #define DEF_INFO( ident, uinameres, helpid, flags ) \
OPropertyInfoImpl( PROPERTY_##ident, PROPERTY_ID_##ident, \ OPropertyInfoImpl( PROPERTY_##ident, PROPERTY_ID_##ident, \
String( PcrRes( RID_STR_##uinameres ) ), nPos++, HID_PROP_##helpid, flags ) String( PcrRes( RID_STR_##uinameres ) ), HID_PROP_##helpid, flags )
#define DEF_INFO_1( ident, uinameres, helpid, flag1 ) \ #define DEF_INFO_1( ident, uinameres, helpid, flag1 ) \
DEF_INFO( ident, uinameres, helpid, PROP_FLAG_##flag1 ) DEF_INFO( ident, uinameres, helpid, PROP_FLAG_##flag1 )
...@@ -111,8 +108,6 @@ namespace pcr ...@@ -111,8 +108,6 @@ namespace pcr
PcrClient aResourceAccess; PcrClient aResourceAccess;
// this ensures that we have our resource file loaded // this ensures that we have our resource file loaded
sal_uInt16 nPos = 1;
static OPropertyInfoImpl aPropertyInfos[] = static OPropertyInfoImpl aPropertyInfos[] =
{ {
/* /*
...@@ -399,7 +394,7 @@ namespace pcr ...@@ -399,7 +394,7 @@ namespace pcr
sal_Int16 OPropertyInfoService::getPropertyPos(sal_Int32 _nId) const sal_Int16 OPropertyInfoService::getPropertyPos(sal_Int32 _nId) const
{ {
const OPropertyInfoImpl* pInfo = getPropertyInfo(_nId); const OPropertyInfoImpl* pInfo = getPropertyInfo(_nId);
return (pInfo) ? pInfo->nPos : 0xFFFF; return (pInfo) ? pInfo - s_pPropertyInfos : 0xFFFF;
} }
//------------------------------------------------------------------------ //------------------------------------------------------------------------
...@@ -550,7 +545,7 @@ namespace pcr ...@@ -550,7 +545,7 @@ namespace pcr
// Initialization // Initialization
if(!s_pPropertyInfos) if(!s_pPropertyInfos)
getPropertyInfo(); getPropertyInfo();
OPropertyInfoImpl aSearch(_rName, 0L, String(), 0, "", 0); OPropertyInfoImpl aSearch(_rName, 0L, String(), "", 0);
const OPropertyInfoImpl* pInfo = ::std::lower_bound( const OPropertyInfoImpl* pInfo = ::std::lower_bound(
s_pPropertyInfos, s_pPropertyInfos + s_nCount, aSearch, PropertyInfoLessByName() ); s_pPropertyInfos, s_pPropertyInfos + s_nCount, aSearch, PropertyInfoLessByName() );
......
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