From f4c300eae4e9aaaec9e5d1f478ad35161ede2761 Mon Sep 17 00:00:00 2001 From: Matteo Casalin Date: Mon, 31 Aug 2015 23:04:00 +0200 Subject: Reduce scope by early bail out Change-Id: Ia4e1763cc4d70197342be4e5caf6d5c14cd34c80 --- dbaccess/source/ui/misc/WTypeSelect.cxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'dbaccess') diff --git a/dbaccess/source/ui/misc/WTypeSelect.cxx b/dbaccess/source/ui/misc/WTypeSelect.cxx index 99ba3559970d..bc20e9604398 100644 --- a/dbaccess/source/ui/misc/WTypeSelect.cxx +++ b/dbaccess/source/ui/misc/WTypeSelect.cxx @@ -372,15 +372,14 @@ void OWizTypeSelectList::dispose() bool OWizTypeSelectList::IsPrimaryKeyAllowed() const { const sal_Int32 nCount = GetSelectEntryCount(); - sal_Int32 j; - for( j = 0; m_bPKey && j < nCount; ++j ) + for( sal_Int32 j = 0; m_bPKey && j < nCount; ++j ) { OFieldDescription* pField = static_cast(GetEntryData(GetSelectEntryPos(j))); if(!pField || pField->getTypeInfo()->nSearchType == ColumnSearch::NONE) - break; + return true; } - return j == nCount; + return false; } void OWizTypeSelectList::setPrimaryKey(OFieldDescription* _pFieldDescr, sal_uInt16 _nPos, bool _bSet) -- cgit