diff --git a/src/support/docstring.cpp b/src/support/docstring.cpp index c232fec5fc..8ea76f95ec 100644 --- a/src/support/docstring.cpp +++ b/src/support/docstring.cpp @@ -109,10 +109,16 @@ docstring const from_local8bit(std::string const & s) } -const char* to_local8bit_failure::what() const throw() -{ - return "A string could not be converted from unicode to the local 8 bit encoding."; -} +/// Exception thrown by to_local8bit if the string could not be converted +class to_local8bit_failure : public std::bad_cast { +public: + to_local8bit_failure() throw() : std::bad_cast() {} + virtual ~to_local8bit_failure() throw() {} + virtual const char* what() const throw() + { + return "A string could not be converted from unicode to the local 8 bit encoding."; + } +}; std::string const to_local8bit(docstring const & s) diff --git a/src/support/docstring.h b/src/support/docstring.h index 73ba552095..fc00e347c2 100644 --- a/src/support/docstring.h +++ b/src/support/docstring.h @@ -16,7 +16,6 @@ #include "support/types.h" #include -//#include namespace lyx { @@ -41,14 +40,6 @@ std::string const to_utf8(docstring const &); /// convert \p s from the encoding of the locale to ucs4. docstring const from_local8bit(std::string const & s); -/// Exception thrown by to_local8bit if the string could not be converted -class to_local8bit_failure /*: public std::bad_cast*/ { -public: - to_local8bit_failure() throw() /*: std::bad_cast()*/ {} - virtual ~to_local8bit_failure() throw() {} - virtual const char* what() const throw(); -}; - /** * Convert \p s from ucs4 to the encoding of the locale. * This may fail and throw an exception, the caller is expected to act