diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-07-26 13:05:41 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-07-26 13:17:44 +0100 |
commit | b43b2b504f0164a2a3a69482c8d0f831c096c756 (patch) | |
tree | 0d3afc4514122c622d5a1a632fef852a43beab52 /sw | |
parent | eb345a155bc9cb92fffd3e5ea0269207b3bac0f1 (diff) |
return early and drop a level of indent
no logic change
Change-Id: Idf67cad227234417b23f7a4f20f6444141eb4377
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/dbui/mmconfigitem.cxx | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/sw/source/uibase/dbui/mmconfigitem.cxx b/sw/source/uibase/dbui/mmconfigitem.cxx index d9bbc3d2dab1..1eed5cdd9845 100644 --- a/sw/source/uibase/dbui/mmconfigitem.cxx +++ b/sw/source/uibase/dbui/mmconfigitem.cxx @@ -1617,44 +1617,44 @@ void SwMailMergeConfigItem::SetSourceView(SwView* pView) { m_pSourceView = pView; - if(pView) + if (!pView) + return; + + std::vector<OUString> aDBNameList; + std::vector<OUString> aAllDBNames; + pView->GetWrtShell().GetAllUsedDB( aDBNameList, &aAllDBNames ); + if(!aDBNameList.empty()) { - std::vector<OUString> aDBNameList; - std::vector<OUString> aAllDBNames; - pView->GetWrtShell().GetAllUsedDB( aDBNameList, &aAllDBNames ); - if(!aDBNameList.empty()) + // if fields are available there is usually no need of an addressblock and greeting + if(!m_pImpl->m_bUserSettingWereOverwritten) { - // if fields are available there is usually no need of an addressblock and greeting - if(!m_pImpl->m_bUserSettingWereOverwritten) + if( m_pImpl->m_bIsAddressBlock + || m_pImpl->m_bIsGreetingLineInMail + || m_pImpl->m_bIsGreetingLine ) { - if( m_pImpl->m_bIsAddressBlock - || m_pImpl->m_bIsGreetingLineInMail - || m_pImpl->m_bIsGreetingLine ) - { - //store user settings - m_pImpl->m_bUserSettingWereOverwritten = true; - m_pImpl->m_bIsAddressBlock_LastUserSetting = m_pImpl->m_bIsAddressBlock; - m_pImpl->m_bIsGreetingLineInMail_LastUserSetting = m_pImpl->m_bIsGreetingLineInMail; - m_pImpl->m_bIsGreetingLine_LastUserSetting = m_pImpl->m_bIsGreetingLine; - - //set all to false - m_pImpl->m_bIsAddressBlock = false; - m_pImpl->m_bIsGreetingLineInMail = false; - m_pImpl->m_bIsGreetingLine = false; - - m_pImpl->SetModified(); - } + //store user settings + m_pImpl->m_bUserSettingWereOverwritten = true; + m_pImpl->m_bIsAddressBlock_LastUserSetting = m_pImpl->m_bIsAddressBlock; + m_pImpl->m_bIsGreetingLineInMail_LastUserSetting = m_pImpl->m_bIsGreetingLineInMail; + m_pImpl->m_bIsGreetingLine_LastUserSetting = m_pImpl->m_bIsGreetingLine; + + //set all to false + m_pImpl->m_bIsAddressBlock = false; + m_pImpl->m_bIsGreetingLineInMail = false; + m_pImpl->m_bIsGreetingLine = false; + + m_pImpl->SetModified(); } } - else if( m_pImpl->m_bUserSettingWereOverwritten ) - { - //restore last user settings: - m_pImpl->m_bIsAddressBlock = m_pImpl->m_bIsAddressBlock_LastUserSetting; - m_pImpl->m_bIsGreetingLineInMail = m_pImpl->m_bIsGreetingLineInMail_LastUserSetting; - m_pImpl->m_bIsGreetingLine = m_pImpl->m_bIsGreetingLine_LastUserSetting; + } + else if( m_pImpl->m_bUserSettingWereOverwritten ) + { + //restore last user settings: + m_pImpl->m_bIsAddressBlock = m_pImpl->m_bIsAddressBlock_LastUserSetting; + m_pImpl->m_bIsGreetingLineInMail = m_pImpl->m_bIsGreetingLineInMail_LastUserSetting; + m_pImpl->m_bIsGreetingLine = m_pImpl->m_bIsGreetingLine_LastUserSetting; - m_pImpl->m_bUserSettingWereOverwritten = false; - } + m_pImpl->m_bUserSettingWereOverwritten = false; } } |