[Libreoffice-commits] core.git: sw/source
Caolán McNamara
caolanm at redhat.com
Tue Jul 26 12:18:14 UTC 2016
sw/source/uibase/dbui/mmconfigitem.cxx | 64 ++++++++++++++++-----------------
1 file changed, 32 insertions(+), 32 deletions(-)
New commits:
commit b43b2b504f0164a2a3a69482c8d0f831c096c756
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jul 26 13:05:41 2016 +0100
return early and drop a level of indent
no logic change
Change-Id: Idf67cad227234417b23f7a4f20f6444141eb4377
diff --git a/sw/source/uibase/dbui/mmconfigitem.cxx b/sw/source/uibase/dbui/mmconfigitem.cxx
index d9bbc3d..1eed5cd 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;
}
}
More information about the Libreoffice-commits
mailing list