[Libreoffice-commits] core.git: compilerplugins/clang tools/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Thu Nov 22 06:35:53 UTC 2018
compilerplugins/clang/unusedenumconstants.untouched.results | 2
tools/source/fsys/urlobj.cxx | 100 ++++++------
2 files changed, 50 insertions(+), 52 deletions(-)
New commits:
commit 542ad7cb2031a37e8b2cea83c4dc7c1f32caab56
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Nov 21 13:57:50 2018 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Nov 22 07:35:26 2018 +0100
convert INetURLObject::PrefixInfo::Kind to scoped enum
and drop unused ALIAS
Change-Id: Ifc0c6aba681bb166c515380ebb1b0f45d232d2d2
Reviewed-on: https://gerrit.libreoffice.org/63741
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/compilerplugins/clang/unusedenumconstants.untouched.results b/compilerplugins/clang/unusedenumconstants.untouched.results
index 1c4ba9a3aa9e..4cd99c3ed3e9 100644
--- a/compilerplugins/clang/unusedenumconstants.untouched.results
+++ b/compilerplugins/clang/unusedenumconstants.untouched.results
@@ -532,8 +532,6 @@ toolkit/source/controls/grid/defaultgriddatamodel.cxx:45
enum (anonymous namespace)::broadcast_type data_changed
toolkit/source/controls/grid/defaultgriddatamodel.cxx:45
enum (anonymous namespace)::broadcast_type row_removed
-tools/source/fsys/urlobj.cxx:305
- enum INetURLObject::PrefixInfo::Kind ALIAS
ucb/source/ucp/webdav-neon/DAVTypes.hxx:195
enum webdav_ucp::Depth DAVINFINITY
ucbhelper/source/client/proxydecider.cxx:119
diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx
index 2abdfff07b05..d5b2df68803a 100644
--- a/tools/source/fsys/urlobj.cxx
+++ b/tools/source/fsys/urlobj.cxx
@@ -302,7 +302,7 @@ struct INetURLObject::SchemeInfo
struct INetURLObject::PrefixInfo
{
- enum Kind { OFFICIAL, INTERNAL, EXTERNAL, ALIAS }; // order is important!
+ enum class Kind { Official, Internal, External }; // order is important!
sal_Char const * m_pPrefix;
sal_Char const * m_pTranslatedPrefix;
@@ -711,7 +711,7 @@ bool INetURLObject::setAbsURIRef(OUString const & rTheAbsURIRef,
m_eScheme = pPrefix->m_eScheme;
OUString sTemp(OUString::createFromAscii(pPrefix->m_eKind
- >= PrefixInfo::EXTERNAL ?
+ >= PrefixInfo::Kind::External ?
pPrefix->m_pTranslatedPrefix :
pPrefix->m_pPrefix));
aSynAbsURIRef.append(sTemp);
@@ -2048,7 +2048,7 @@ bool INetURLObject::convertIntToExt(OUString const & rTheIntURIRef,
sal_Unicode const * pEnd = pBegin + aSynExtURIRef.getLength();
sal_Unicode const * p = pBegin;
PrefixInfo const * pPrefix = getPrefix(p, pEnd);
- bool bConvert = pPrefix && pPrefix->m_eKind == PrefixInfo::INTERNAL;
+ bool bConvert = pPrefix && pPrefix->m_eKind == PrefixInfo::Kind::Internal;
if (bConvert)
{
aSynExtURIRef =
@@ -2071,7 +2071,7 @@ bool INetURLObject::convertExtToInt(OUString const & rTheExtURIRef,
sal_Unicode const * pEnd = pBegin + aSynIntURIRef.getLength();
sal_Unicode const * p = pBegin;
PrefixInfo const * pPrefix = getPrefix(p, pEnd);
- bool bConvert = pPrefix && pPrefix->m_eKind == PrefixInfo::EXTERNAL;
+ bool bConvert = pPrefix && pPrefix->m_eKind == PrefixInfo::Kind::External;
if (bConvert)
{
aSynIntURIRef =
@@ -2088,82 +2088,82 @@ INetURLObject::PrefixInfo const * INetURLObject::getPrefix(sal_Unicode const *&
{
static PrefixInfo const aMap[]
= { // dummy entry at front needed, because pLast may point here:
- { nullptr, nullptr, INetProtocol::NotValid, PrefixInfo::INTERNAL },
+ { nullptr, nullptr, INetProtocol::NotValid, PrefixInfo::Kind::Internal },
{ ".component:", "staroffice.component:", INetProtocol::Component,
- PrefixInfo::INTERNAL },
+ PrefixInfo::Kind::Internal },
{ ".uno:", "staroffice.uno:", INetProtocol::Uno,
- PrefixInfo::INTERNAL },
- { "cid:", nullptr, INetProtocol::Cid, PrefixInfo::OFFICIAL },
- { "data:", nullptr, INetProtocol::Data, PrefixInfo::OFFICIAL },
- { "db:", "staroffice.db:", INetProtocol::Db, PrefixInfo::INTERNAL },
- { "file:", nullptr, INetProtocol::File, PrefixInfo::OFFICIAL },
- { "ftp:", nullptr, INetProtocol::Ftp, PrefixInfo::OFFICIAL },
+ PrefixInfo::Kind::Internal },
+ { "cid:", nullptr, INetProtocol::Cid, PrefixInfo::Kind::Official },
+ { "data:", nullptr, INetProtocol::Data, PrefixInfo::Kind::Official },
+ { "db:", "staroffice.db:", INetProtocol::Db, PrefixInfo::Kind::Internal },
+ { "file:", nullptr, INetProtocol::File, PrefixInfo::Kind::Official },
+ { "ftp:", nullptr, INetProtocol::Ftp, PrefixInfo::Kind::Official },
{ "hid:", "staroffice.hid:", INetProtocol::Hid,
- PrefixInfo::INTERNAL },
- { "http:", nullptr, INetProtocol::Http, PrefixInfo::OFFICIAL },
- { "https:", nullptr, INetProtocol::Https, PrefixInfo::OFFICIAL },
- { "javascript:", nullptr, INetProtocol::Javascript, PrefixInfo::OFFICIAL },
- { "ldap:", nullptr, INetProtocol::Ldap, PrefixInfo::OFFICIAL },
+ PrefixInfo::Kind::Internal },
+ { "http:", nullptr, INetProtocol::Http, PrefixInfo::Kind::Official },
+ { "https:", nullptr, INetProtocol::Https, PrefixInfo::Kind::Official },
+ { "javascript:", nullptr, INetProtocol::Javascript, PrefixInfo::Kind::Official },
+ { "ldap:", nullptr, INetProtocol::Ldap, PrefixInfo::Kind::Official },
{ "macro:", "staroffice.macro:", INetProtocol::Macro,
- PrefixInfo::INTERNAL },
- { "mailto:", nullptr, INetProtocol::Mailto, PrefixInfo::OFFICIAL },
+ PrefixInfo::Kind::Internal },
+ { "mailto:", nullptr, INetProtocol::Mailto, PrefixInfo::Kind::Official },
{ "private:", "staroffice.private:", INetProtocol::PrivSoffice,
- PrefixInfo::INTERNAL },
+ PrefixInfo::Kind::Internal },
{ "private:factory/", "staroffice.factory:",
- INetProtocol::PrivSoffice, PrefixInfo::INTERNAL },
+ INetProtocol::PrivSoffice, PrefixInfo::Kind::Internal },
{ "private:helpid/", "staroffice.helpid:", INetProtocol::PrivSoffice,
- PrefixInfo::INTERNAL },
+ PrefixInfo::Kind::Internal },
{ "private:java/", "staroffice.java:", INetProtocol::PrivSoffice,
- PrefixInfo::INTERNAL },
+ PrefixInfo::Kind::Internal },
{ "private:searchfolder:", "staroffice.searchfolder:",
- INetProtocol::PrivSoffice, PrefixInfo::INTERNAL },
+ INetProtocol::PrivSoffice, PrefixInfo::Kind::Internal },
{ "private:trashcan:", "staroffice.trashcan:",
- INetProtocol::PrivSoffice, PrefixInfo::INTERNAL },
- { "sftp:", nullptr, INetProtocol::Sftp, PrefixInfo::OFFICIAL },
+ INetProtocol::PrivSoffice, PrefixInfo::Kind::Internal },
+ { "sftp:", nullptr, INetProtocol::Sftp, PrefixInfo::Kind::Official },
{ "slot:", "staroffice.slot:", INetProtocol::Slot,
- PrefixInfo::INTERNAL },
- { "smb:", nullptr, INetProtocol::Smb, PrefixInfo::OFFICIAL },
+ PrefixInfo::Kind::Internal },
+ { "smb:", nullptr, INetProtocol::Smb, PrefixInfo::Kind::Official },
{ "staroffice.component:", ".component:", INetProtocol::Component,
- PrefixInfo::EXTERNAL },
- { "staroffice.db:", "db:", INetProtocol::Db, PrefixInfo::EXTERNAL },
+ PrefixInfo::Kind::External },
+ { "staroffice.db:", "db:", INetProtocol::Db, PrefixInfo::Kind::External },
{ "staroffice.factory:", "private:factory/",
- INetProtocol::PrivSoffice, PrefixInfo::EXTERNAL },
+ INetProtocol::PrivSoffice, PrefixInfo::Kind::External },
{ "staroffice.helpid:", "private:helpid/", INetProtocol::PrivSoffice,
- PrefixInfo::EXTERNAL },
+ PrefixInfo::Kind::External },
{ "staroffice.hid:", "hid:", INetProtocol::Hid,
- PrefixInfo::EXTERNAL },
+ PrefixInfo::Kind::External },
{ "staroffice.java:", "private:java/", INetProtocol::PrivSoffice,
- PrefixInfo::EXTERNAL },
+ PrefixInfo::Kind::External },
{ "staroffice.macro:", "macro:", INetProtocol::Macro,
- PrefixInfo::EXTERNAL },
+ PrefixInfo::Kind::External },
{ "staroffice.private:", "private:", INetProtocol::PrivSoffice,
- PrefixInfo::EXTERNAL },
+ PrefixInfo::Kind::External },
{ "staroffice.searchfolder:", "private:searchfolder:",
- INetProtocol::PrivSoffice, PrefixInfo::EXTERNAL },
+ INetProtocol::PrivSoffice, PrefixInfo::Kind::External },
{ "staroffice.slot:", "slot:", INetProtocol::Slot,
- PrefixInfo::EXTERNAL },
+ PrefixInfo::Kind::External },
{ "staroffice.trashcan:", "private:trashcan:",
- INetProtocol::PrivSoffice, PrefixInfo::EXTERNAL },
+ INetProtocol::PrivSoffice, PrefixInfo::Kind::External },
{ "staroffice.uno:", ".uno:", INetProtocol::Uno,
- PrefixInfo::EXTERNAL },
+ PrefixInfo::Kind::External },
{ "staroffice:", "private:", INetProtocol::PrivSoffice,
- PrefixInfo::EXTERNAL },
- { "telnet:", nullptr, INetProtocol::Telnet, PrefixInfo::OFFICIAL },
- { "vnd.libreoffice.cmis:", nullptr, INetProtocol::Cmis, PrefixInfo::INTERNAL },
+ PrefixInfo::Kind::External },
+ { "telnet:", nullptr, INetProtocol::Telnet, PrefixInfo::Kind::Official },
+ { "vnd.libreoffice.cmis:", nullptr, INetProtocol::Cmis, PrefixInfo::Kind::Internal },
{ "vnd.sun.star.cmd:", nullptr, INetProtocol::VndSunStarCmd,
- PrefixInfo::OFFICIAL },
+ PrefixInfo::Kind::Official },
{ "vnd.sun.star.expand:", nullptr, INetProtocol::VndSunStarExpand,
- PrefixInfo::OFFICIAL },
+ PrefixInfo::Kind::Official },
{ "vnd.sun.star.help:", nullptr, INetProtocol::VndSunStarHelp,
- PrefixInfo::OFFICIAL },
+ PrefixInfo::Kind::Official },
{ "vnd.sun.star.hier:", nullptr, INetProtocol::VndSunStarHier,
- PrefixInfo::OFFICIAL },
+ PrefixInfo::Kind::Official },
{ "vnd.sun.star.pkg:", nullptr, INetProtocol::VndSunStarPkg,
- PrefixInfo::OFFICIAL },
+ PrefixInfo::Kind::Official },
{ "vnd.sun.star.tdoc:", nullptr, INetProtocol::VndSunStarTdoc,
- PrefixInfo::OFFICIAL },
+ PrefixInfo::Kind::Official },
{ "vnd.sun.star.webdav:", nullptr, INetProtocol::VndSunStarWebdav,
- PrefixInfo::OFFICIAL }
+ PrefixInfo::Kind::Official }
};
/* This list needs to be sorted, or you'll introduce serious bugs */
More information about the Libreoffice-commits
mailing list