-Werror=logical-op (GCC 6)

"logical ‘and’ of mutually exclusive tests is always false"

<sberg> alg, in editeng/source/uno/unoipset.cxx:208 (wid < START && wid > END),
 is what's actually wanted to check for contained or for not contained in the
 START..END range?  You touched the code last, in
 b0c2ec72ff171d8b4303d39f11f67497e88e2d8c, 15+ years ago (although the line
 itself was already like that in the initial import,
 fd069bee7e57ad529c3c0974559fd2d84ec3151a)
<alg> sberg: sorry cannot remember - but looks correct. All values outside
 OWN_ATTR_VALUE_START/_END are answered with defaut. The renge should be the one
 from ditEngine
<sberg> alg, the code as is is clearly incorrect, as the condition is always
 false
<alg> sberg: Ah, yes! Should probably be an '||'
<sberg> alg, OK, thanks, I'll give that a "make check" try (a bit scary to thus
 enable code that had effectively been disabled since at least the turn of the
 century)
<alg> sberg: Yes - scary is the right word. Looking further, eState ==
 SfxItemState::DEFAULT should result when outside, thus pItem->QueryValue would
 be taken which *should* get the default from the pool when not in the local
 ItemSet range. In theory, the same *should* happen

Change-Id: I906361272dfe3f6af0e1ed3cb4e245ead7eabaec
This commit is contained in:
Stephan Bergmann 2016-04-14 17:18:24 +02:00
parent 23622f240d
commit c455fc6064

View File

@ -205,7 +205,7 @@ uno::Any SvxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry*
uno::Any aVal;
SfxItemSet aSet( mrItemPool, pMap->nWID, pMap->nWID);
if( (pMap->nWID < OWN_ATTR_VALUE_START) && (pMap->nWID > OWN_ATTR_VALUE_END ) )
if( (pMap->nWID < OWN_ATTR_VALUE_START) || (pMap->nWID > OWN_ATTR_VALUE_END ) )
{
// Get Default from ItemPool
if(SfxItemPool::IsWhich(pMap->nWID))