]> git.lyx.org Git - features.git/commitdiff
We don't generally use "static" this way in the LyX code any more. (Just
authorRichard Heck <rgheck@comcast.net>
Wed, 17 Nov 2010 22:00:42 +0000 (22:00 +0000)
committerRichard Heck <rgheck@comcast.net>
Wed, 17 Nov 2010 22:00:42 +0000 (22:00 +0000)
a bit of cleanup while studying other things....)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36354 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiFontMetrics.cpp
src/support/lstrings.cpp

index 76ebd907064e088a442cdd03fb2097196c1a2f8e..236c975d44a593f0bfed351f7ad519783ff891b8 100644 (file)
@@ -27,27 +27,28 @@ using namespace std;
 namespace lyx {
 namespace frontend {
 
+namespace {
 /**
  * Convert a UCS4 character into a QChar.
  * This is a hack (it does only make sense for the common part of the UCS4
  * and UTF16 encodings) and should not be used.
  * This does only exist because of performance reasons (a real conversion
  * using iconv is too slow on windows).
- */
-static inline QChar const ucs4_to_qchar(char_type const ucs4)
+ *
+ * This is no real conversion but a simple cast in reality. This is the reason
+ * why this works well for symbol fonts used in mathed too, even though
+ * these are not real ucs4 characters. These are codepoints in the
+ * modern fonts used, nothing unicode related.
+ * See comment in QLPainter::text() for more explanation.
+ **/   
+inline QChar const ucs4_to_qchar(char_type const ucs4)
 {
        LASSERT(is_utf16(ucs4), /**/);
        return QChar(static_cast<unsigned short>(ucs4));
 }
+} // anon namespace
 
 
-// Caution: When using ucs4_to_qchar() in these methods, this is no
-// real conversion but a simple cast in reality. This is the reason
-// why this works well for symbol fonts used in mathed too, even though
-// these are not real ucs4 characters. These are codepoints in the
-// modern fonts used, nothing unicode related.
-// See comment in QLPainter::text() for more explanation.
-
 GuiFontMetrics::GuiFontMetrics(QFont const & font)
 : metrics_(font), smallcaps_metrics_(font), smallcaps_shape_(false)
 {
index 3e4fb8d215586a8e47b9fe8a8d23d91587155467..daa862747c16ea97f72499764f12ec704852b7d1 100644 (file)
@@ -47,6 +47,7 @@ string const & empty_string()
        return s;
 }
 
+namespace {
 /**
  * Convert a QChar into a UCS4 character.
  * This is a hack (it does only make sense for the common part of the UCS4
@@ -54,13 +55,12 @@ string const & empty_string()
  * This does only exist because of performance reasons (a real conversion
  * using iconv is too slow on windows).
  */
-static inline char_type qchar_to_ucs4(QChar const & qchar)
+inline char_type qchar_to_ucs4(QChar const & qchar)
 {
        LASSERT(is_utf16(static_cast<char_type>(qchar.unicode())), /**/);
        return static_cast<char_type>(qchar.unicode());
 }
 
-
 /**
  * Convert a UCS4 character into a QChar.
  * This is a hack (it does only make sense for the common part of the UCS4
@@ -68,17 +68,15 @@ static inline char_type qchar_to_ucs4(QChar const & qchar)
  * This does only exist because of performance reasons (a real conversion
  * using iconv is too slow on windows).
  */
-static inline QChar const ucs4_to_qchar(char_type const ucs4)
+inline QChar const ucs4_to_qchar(char_type const ucs4)
 {
        LASSERT(is_utf16(ucs4), /**/);
        return QChar(static_cast<unsigned short>(ucs4));
 }
 
-
-namespace {
-       /// Maximum valid UCS4 code point
-       char_type const ucs4_max = 0x10ffff;
-}
+/// Maximum valid UCS4 code point
+char_type const ucs4_max = 0x10ffff;
+} // anon namespace
 
 
 bool isLetterChar(char_type c)