From 591dc1dffd8ae8a086f07e3dde0dd4a0de35a1a4 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 2 Dec 2016 15:58:59 +0100 Subject: [PATCH] Changed: Use std::string instead of const char* for openURL and openDoc --HG-- branch : develop --- code/nel/include/nel/misc/common.h | 4 ++-- code/nel/src/misc/common.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/code/nel/include/nel/misc/common.h b/code/nel/include/nel/misc/common.h index f1c090c2b..c7c1369c5 100644 --- a/code/nel/include/nel/misc/common.h +++ b/code/nel/include/nel/misc/common.h @@ -690,10 +690,10 @@ inline int nlisprint(int c) #endif // Open an url in a browser -bool openURL (const char *url); +bool openURL (const std::string &url); // Open a document -bool openDoc (const char *document); +bool openDoc (const std::string &document); // AntiBug method that return an epsilon if x==0, else x inline float favoid0(float x) diff --git a/code/nel/src/misc/common.cpp b/code/nel/src/misc/common.cpp index 9f9241b82..6453d836d 100644 --- a/code/nel/src/misc/common.cpp +++ b/code/nel/src/misc/common.cpp @@ -1434,7 +1434,7 @@ LONG GetRegKey(HKEY key, LPCWSTR subkey, LPWSTR retdata) } #endif // NL_OS_WINDOWS -static bool openDocWithExtension (const char *document, const char *ext) +static bool openDocWithExtension (const std::string &document, const std::string &ext) { #ifdef NL_OS_WINDOWS // First try ShellExecute() @@ -1552,18 +1552,18 @@ static bool openDocWithExtension (const char *document, const char *ext) return false; } -bool openURL (const char *url) +bool openURL(const std::string &url) { return openDocWithExtension(url, "htm"); } -bool openDoc (const char *document) +bool openDoc(const std::string &document) { // get extension from document fullpath string ext = CFile::getExtension(document); // try to open document - return openDocWithExtension(document, ext.c_str()); + return openDocWithExtension(document, ext); } } // NLMISC