[Libreoffice-commits] core.git: include/svl svl/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri Feb 22 17:02:30 UTC 2019
include/svl/adrparse.hxx | 29 ++++-------------------------
svl/source/misc/adrparse.cxx | 10 +---------
2 files changed, 5 insertions(+), 34 deletions(-)
New commits:
commit 334644bad9e325d5b23b4416cdc3d22dce5141bf
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Feb 22 10:59:08 2019 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Feb 22 18:01:49 2019 +0100
loplugin:unusedfields in svl
and simplify SvAddressParser
Change-Id: I8333b4442dca69e46ad14c952436b98e40089a8c
Reviewed-on: https://gerrit.libreoffice.org/68199
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/include/svl/adrparse.hxx b/include/svl/adrparse.hxx
index 0961158a52e7..3c94b507522d 100644
--- a/include/svl/adrparse.hxx
+++ b/include/svl/adrparse.hxx
@@ -24,44 +24,23 @@
#include <vector>
-struct SvAddressEntry_Impl
-{
- OUString m_aAddrSpec;
- OUString m_aRealName;
-
- SvAddressEntry_Impl()
- {
- }
-
- SvAddressEntry_Impl(const OUString& rTheAddrSpec,
- const OUString& rTheRealName)
- : m_aAddrSpec(rTheAddrSpec)
- , m_aRealName(rTheRealName)
- {
- }
-};
-
-
class SVL_DLLPUBLIC SvAddressParser
{
friend class SvAddressParser_Impl;
- SvAddressEntry_Impl m_aFirst;
- ::std::vector< SvAddressEntry_Impl >
- m_aRest;
- bool m_bHasFirst;
+ ::std::vector< OUString >
+ m_vAddresses;
public:
SvAddressParser(const OUString& rInput);
~SvAddressParser();
- sal_Int32 Count() const { return m_bHasFirst ? m_aRest.size() + 1 : 0; }
+ sal_Int32 Count() const { return m_vAddresses.size(); }
const OUString& GetEmailAddress(sal_Int32 nIndex) const
{
- return nIndex == 0 ? m_aFirst.m_aAddrSpec :
- m_aRest[ nIndex - 1 ].m_aAddrSpec;
+ return m_vAddresses[nIndex];
}
};
diff --git a/svl/source/misc/adrparse.cxx b/svl/source/misc/adrparse.cxx
index 11d8742c36ed..16b3aa4c7196 100644
--- a/svl/source/misc/adrparse.cxx
+++ b/svl/source/misc/adrparse.cxx
@@ -662,14 +662,7 @@ SvAddressParser_Impl::SvAddressParser_Impl(SvAddressParser * pParser,
else
aTheRealName = rInput.copy( (m_pRealNameContentBegin - rInput.getStr()), nLen);
}
- if (pParser->m_bHasFirst)
- pParser->m_aRest.emplace_back( aTheAddrSpec, aTheRealName );
- else
- {
- pParser->m_bHasFirst = true;
- pParser->m_aFirst.m_aAddrSpec = aTheAddrSpec;
- pParser->m_aFirst.m_aRealName = aTheRealName;
- }
+ pParser->m_vAddresses.emplace_back( aTheAddrSpec );
}
if (bDone)
return;
@@ -721,7 +714,6 @@ SvAddressParser_Impl::SvAddressParser_Impl(SvAddressParser * pParser,
}
SvAddressParser::SvAddressParser(const OUString& rInput)
- : m_bHasFirst(false)
{
SvAddressParser_Impl aDoParse(this, rInput);
}
More information about the Libreoffice-commits
mailing list