summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-04-02 15:58:06 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-04-02 16:30:34 +0200
commit44b3e56bb4a4df59f53447c4ca4d8e02fe926206 (patch)
tree71a9efde3a6a2a00688e8feb8e3086cb32eceb4f /include
parent0b4965bcd7ec911951e7ca3a4cd48062843b2634 (diff)
Change INetProtocol to scoped enumeration
...and fix o3tl::enumarray::operator [] const overload Change-Id: I749b1b9d68686b03a97074253478d9d2d9d32b0b
Diffstat (limited to 'include')
-rw-r--r--include/o3tl/enumarray.hxx2
-rw-r--r--include/svl/inethist.hxx8
-rw-r--r--include/svtools/inettbc.hxx6
-rw-r--r--include/svtools/place.hxx2
-rw-r--r--include/tools/urlobj.hxx84
5 files changed, 51 insertions, 51 deletions
diff --git a/include/o3tl/enumarray.hxx b/include/o3tl/enumarray.hxx
index b476cb3671d2..6bc3dff7a608 100644
--- a/include/o3tl/enumarray.hxx
+++ b/include/o3tl/enumarray.hxx
@@ -51,7 +51,7 @@ public:
static const size_type max_index = static_cast<size_type>(E::LAST);
- const V operator[](E index) const
+ const V& operator[](E index) const
{
assert(index>=static_cast<E>(0) && index<=E::LAST);
return detail_values[static_cast<size_type>(index)];
diff --git a/include/svl/inethist.hxx b/include/svl/inethist.hxx
index a21db8a4732e..6b4f9755011b 100644
--- a/include/svl/inethist.hxx
+++ b/include/svl/inethist.hxx
@@ -63,10 +63,10 @@ public:
*/
bool QueryProtocol (INetProtocol eProto) const
{
- return ((eProto == INET_PROT_FILE ) ||
- (eProto == INET_PROT_FTP ) ||
- (eProto == INET_PROT_HTTP ) ||
- (eProto == INET_PROT_HTTPS) );
+ return ((eProto == INetProtocol::FILE ) ||
+ (eProto == INetProtocol::FTP ) ||
+ (eProto == INetProtocol::HTTP ) ||
+ (eProto == INetProtocol::HTTPS) );
}
/** QueryUrl.
diff --git a/include/svtools/inettbc.hxx b/include/svtools/inettbc.hxx
index b9852ce6fc7b..92a07661c6cb 100644
--- a/include/svtools/inettbc.hxx
+++ b/include/svtools/inettbc.hxx
@@ -59,9 +59,9 @@ protected:
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
public:
- SvtURLBox( vcl::Window* pParent, INetProtocol eSmart = INET_PROT_NOT_VALID, bool bSetDefaultHelpID = true );
- SvtURLBox( vcl::Window* pParent, WinBits _nStyle, INetProtocol eSmart = INET_PROT_NOT_VALID, bool bSetDefaultHelpID = true );
- SvtURLBox( vcl::Window* pParent, const ResId& _rResId, INetProtocol eSmart = INET_PROT_NOT_VALID, bool bSetDefaultHelpID = true );
+ SvtURLBox( vcl::Window* pParent, INetProtocol eSmart = INetProtocol::NOT_VALID, bool bSetDefaultHelpID = true );
+ SvtURLBox( vcl::Window* pParent, WinBits _nStyle, INetProtocol eSmart = INetProtocol::NOT_VALID, bool bSetDefaultHelpID = true );
+ SvtURLBox( vcl::Window* pParent, const ResId& _rResId, INetProtocol eSmart = INetProtocol::NOT_VALID, bool bSetDefaultHelpID = true );
virtual ~SvtURLBox();
void SetBaseURL( const OUString& rURL );
diff --git a/include/svtools/place.hxx b/include/svtools/place.hxx
index e46eba4e2785..0933f998a1a5 100644
--- a/include/svtools/place.hxx
+++ b/include/svtools/place.hxx
@@ -33,7 +33,7 @@ public:
OUString& GetName( ) { return msName; }
OUString GetUrl( ) { return maUrl.GetMainURL( INetURLObject::NO_DECODE ); }
INetURLObject& GetUrlObject( ) { return maUrl; }
- bool IsLocal( ) { return maUrl.GetProtocol() == INET_PROT_FILE; }
+ bool IsLocal( ) { return maUrl.GetProtocol() == INetProtocol::FILE; }
bool IsEditable( ) { return mbEditable; }
};
diff --git a/include/tools/urlobj.hxx b/include/tools/urlobj.hxx
index bbe6d3945bbc..50c5b5109b40 100644
--- a/include/tools/urlobj.hxx
+++ b/include/tools/urlobj.hxx
@@ -64,43 +64,43 @@ enum
};
// Schemes:
-enum INetProtocol
+enum class INetProtocol
{
- INET_PROT_NOT_VALID = 0,
- INET_PROT_FTP = 1,
- INET_PROT_HTTP = 2,
- INET_PROT_FILE = 3,
- INET_PROT_MAILTO = 4,
- INET_PROT_VND_SUN_STAR_WEBDAV = 5,
- INET_PROT_NEWS = 6,
- INET_PROT_PRIV_SOFFICE = 7,
- INET_PROT_VND_SUN_STAR_HELP = 8,
- INET_PROT_HTTPS = 9,
- INET_PROT_SLOT = 10,
- INET_PROT_MACRO = 11,
- INET_PROT_JAVASCRIPT = 12,
- INET_PROT_IMAP = 13,
- INET_PROT_POP3 = 14,
- INET_PROT_DATA = 15,
- INET_PROT_CID = 16,
- INET_PROT_OUT = 17,
- INET_PROT_VND_SUN_STAR_HIER = 18,
- INET_PROT_VIM = 19,
- INET_PROT_UNO = 20,
- INET_PROT_COMPONENT = 21,
- INET_PROT_VND_SUN_STAR_PKG = 22,
- INET_PROT_LDAP = 23,
- INET_PROT_DB = 24,
- INET_PROT_VND_SUN_STAR_CMD = 25,
- INET_PROT_TELNET = 26,
- INET_PROT_VND_SUN_STAR_EXPAND = 27,
- INET_PROT_VND_SUN_STAR_TDOC = 28,
- INET_PROT_GENERIC = 29,
- INET_PROT_SMB = 30,
- INET_PROT_HID = 31,
- INET_PROT_SFTP = 32,
- INET_PROT_CMIS = 33,
- INET_PROT_END = 34
+ NOT_VALID,
+ FTP,
+ HTTP,
+ FILE,
+ MAILTO,
+ VND_SUN_STAR_WEBDAV,
+ NEWS,
+ PRIV_SOFFICE,
+ VND_SUN_STAR_HELP,
+ HTTPS,
+ SLOT,
+ MACRO,
+ JAVASCRIPT,
+ IMAP,
+ POP3,
+ DATA,
+ CID,
+ OUT,
+ VND_SUN_STAR_HIER,
+ VIM,
+ UNO,
+ COMPONENT,
+ VND_SUN_STAR_PKG,
+ LDAP,
+ DB,
+ VND_SUN_STAR_CMD,
+ TELNET,
+ VND_SUN_STAR_EXPAND,
+ VND_SUN_STAR_TDOC,
+ GENERIC,
+ SMB,
+ HID,
+ SFTP,
+ CMIS,
+ LAST = CMIS
};
class TOOLS_DLLPUBLIC SAL_WARN_UNUSED INetURLObject
@@ -182,9 +182,9 @@ public:
// General Structure:
inline INetURLObject():
- m_eScheme(INET_PROT_NOT_VALID), m_eSmartScheme(INET_PROT_HTTP) {}
+ m_eScheme(INetProtocol::NOT_VALID), m_eSmartScheme(INetProtocol::HTTP) {}
- inline bool HasError() const { return m_eScheme == INET_PROT_NOT_VALID; }
+ inline bool HasError() const { return m_eScheme == INetProtocol::NOT_VALID; }
inline OUString GetMainURL(DecodeMechanism eMechanism,
rtl_TextEncoding eCharset
@@ -1234,7 +1234,7 @@ private:
// Coding:
static inline sal_Char getEscapePrefix(INetProtocol eTheScheme)
- { return eTheScheme == INET_PROT_VIM ? '=' : '%'; }
+ { return eTheScheme == INetProtocol::VIM ? '=' : '%'; }
inline sal_Char getEscapePrefix() const
{ return getEscapePrefix(m_eScheme); }
@@ -1299,7 +1299,7 @@ inline OUString INetURLObject::decode(SubString const & rSubString,
inline INetURLObject::INetURLObject(OUString const & rTheAbsURIRef,
EncodeMechanism eMechanism,
rtl_TextEncoding eCharset):
- m_eScheme(INET_PROT_NOT_VALID), m_eSmartScheme(INET_PROT_HTTP)
+ m_eScheme(INetProtocol::NOT_VALID), m_eSmartScheme(INetProtocol::HTTP)
{
setAbsURIRef(rTheAbsURIRef, false, eMechanism, eCharset, false,
FSysStyle(0));
@@ -1318,7 +1318,7 @@ inline INetURLObject::INetURLObject(OUString const & rTheAbsURIRef,
EncodeMechanism eMechanism,
rtl_TextEncoding eCharset,
FSysStyle eStyle):
- m_eScheme(INET_PROT_NOT_VALID), m_eSmartScheme(eTheSmartScheme)
+ m_eScheme(INetProtocol::NOT_VALID), m_eSmartScheme(eTheSmartScheme)
{
setAbsURIRef(rTheAbsURIRef, false, eMechanism, eCharset, true, eStyle);
}
@@ -1456,7 +1456,7 @@ inline bool INetURLObject::SetMark(OUString const & rTheFragment,
inline INetURLObject::INetURLObject(OUString const & rFSysPath,
FSysStyle eStyle):
- m_eScheme(INET_PROT_NOT_VALID), m_eSmartScheme(INET_PROT_HTTP)
+ m_eScheme(INetProtocol::NOT_VALID), m_eSmartScheme(INetProtocol::HTTP)
{
setFSysPath(rFSysPath, eStyle);
}