summaryrefslogtreecommitdiff
path: root/sw/source/ui/chrdlg/swuiccoll.cxx
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-11-28 15:16:49 +0100
committerMichael Stahl <mstahl@redhat.com>2016-11-29 09:49:24 +0000
commit5a13d6146e21355803b7c803ab98143dd41b8416 (patch)
treead1810446efa184741bd270e57b760707e0e8cea /sw/source/ui/chrdlg/swuiccoll.cxx
parent199e687c12de402f51f86c6b81bb9bdcd514337c (diff)
sw ui: de-obfuscate assignments in conditions to help GCC
GCC 6.2.1 with -Og produces spurious -Werror=maybe-uninitialized on variables that are assigned in conditions; perhaps it's better to de-obfuscate the code if even GCC is confused about it. Change-Id: I5276f35be773f8e7a6d27f970085f0cd00cea0aa Reviewed-on: https://gerrit.libreoffice.org/31331 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sw/source/ui/chrdlg/swuiccoll.cxx')
-rw-r--r--sw/source/ui/chrdlg/swuiccoll.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/sw/source/ui/chrdlg/swuiccoll.cxx b/sw/source/ui/chrdlg/swuiccoll.cxx
index df1b7d04a0b2..286f0d4f83cf 100644
--- a/sw/source/ui/chrdlg/swuiccoll.cxx
+++ b/sw/source/ui/chrdlg/swuiccoll.cxx
@@ -242,11 +242,14 @@ IMPL_LINK( SwCondCollPage, AssignRemoveHdl, ListBox&, rBox, void)
void SwCondCollPage::AssignRemove(void* pBtn)
{
SvTreeListEntry* pE = m_pTbLinks->FirstSelected();
- sal_uLong nPos;
- if( !pE || LISTBOX_ENTRY_NOTFOUND ==
- ( nPos = m_pTbLinks->GetModel()->GetAbsPos( pE ) ) )
+ if (!pE)
+ {
+ OSL_ENSURE(false, "where's the empty entry from?");
+ return;
+ }
+ sal_uLong const nPos(m_pTbLinks->GetModel()->GetAbsPos(pE));
+ if (LISTBOX_ENTRY_NOTFOUND == nPos)
{
- OSL_ENSURE( pE, "where's the empty entry from?" );
return;
}