From c455fc6064da0cfe5bc05ce2ac678c1fc89c92a4 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 14 Apr 2016 17:18:24 +0200 Subject: [PATCH] -Werror=logical-op (GCC 6) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "logical ‘and’ of mutually exclusive tests is always false" 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) 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 alg, the code as is is clearly incorrect, as the condition is always false sberg: Ah, yes! Should probably be an '||' 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) 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 --- editeng/source/uno/unoipset.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editeng/source/uno/unoipset.cxx b/editeng/source/uno/unoipset.cxx index 4c369844ccf6..6399834bf70e 100644 --- a/editeng/source/uno/unoipset.cxx +++ b/editeng/source/uno/unoipset.cxx @@ -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))