summaryrefslogtreecommitdiff
path: root/sw/source/uibase/dbui/mmconfigitem.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-10-21 12:31:03 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-10-21 14:58:51 +0200
commit29489b33b435683021b72cb2bce27aba8cb7a430 (patch)
tree8e4e1c59d56d5ed0d0ca4d088419067041e4553a /sw/source/uibase/dbui/mmconfigitem.cxx
parenta4244c0f05b95ded277a3a7ed217bf0451daa996 (diff)
loplugin:flatten
Change-Id: I3b4226a9d089ec9aedab95d96e50a068f57a76c7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123991 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/uibase/dbui/mmconfigitem.cxx')
-rw-r--r--sw/source/uibase/dbui/mmconfigitem.cxx24
1 files changed, 12 insertions, 12 deletions
diff --git a/sw/source/uibase/dbui/mmconfigitem.cxx b/sw/source/uibase/dbui/mmconfigitem.cxx
index 36986ba59f5e..cd46d6b386eb 100644
--- a/sw/source/uibase/dbui/mmconfigitem.cxx
+++ b/sw/source/uibase/dbui/mmconfigitem.cxx
@@ -330,18 +330,18 @@ SwMailMergeConfigItem_Impl::SwMailMergeConfigItem_Impl() :
}
}
//check if the saved documents still exist
- if(m_aSavedDocuments.hasElements())
- {
- uno::Sequence< OUString > aTempDocuments(m_aSavedDocuments.getLength());
- auto begin = aTempDocuments.getArray();
- OUString* pTempDocuments = std::copy_if(std::cbegin(m_aSavedDocuments), std::cend(m_aSavedDocuments), begin,
- [](const OUString& rDoc) { return SWUnoHelper::UCB_IsFile( rDoc ); });
- sal_Int32 nIndex = static_cast<sal_Int32>(std::distance(begin, pTempDocuments));
- if(nIndex < m_aSavedDocuments.getLength())
- {
- m_aSavedDocuments.swap(aTempDocuments);
- m_aSavedDocuments.realloc(nIndex);
- }
+ if(!m_aSavedDocuments.hasElements())
+ return;
+
+ uno::Sequence< OUString > aTempDocuments(m_aSavedDocuments.getLength());
+ auto begin = aTempDocuments.getArray();
+ OUString* pTempDocuments = std::copy_if(std::cbegin(m_aSavedDocuments), std::cend(m_aSavedDocuments), begin,
+ [](const OUString& rDoc) { return SWUnoHelper::UCB_IsFile( rDoc ); });
+ sal_Int32 nIndex = static_cast<sal_Int32>(std::distance(begin, pTempDocuments));
+ if(nIndex < m_aSavedDocuments.getLength())
+ {
+ m_aSavedDocuments.swap(aTempDocuments);
+ m_aSavedDocuments.realloc(nIndex);
}
}