]> git.lyx.org Git - lyx.git/blobdiff - src/support/Messages.cpp
Fix assertion when checking if change in selection
[lyx.git] / src / support / Messages.cpp
index da1c3cc0b8fc14241fb654be683409a75aa8d978..57c18d522e2afadf45539aa1fdb53df43409857a 100644 (file)
@@ -127,7 +127,7 @@ void cleanTranslation(docstring & trans)
        }
 }
 
-} // lyx
+} // namespace lyx
 
 
 #ifdef ENABLE_NLS
@@ -167,7 +167,7 @@ string realCode(string code)
        }
        return string();
 }
-}
+} // namespace
 
 
 bool Messages::available(string const & c)
@@ -238,7 +238,7 @@ void StringTable::swapEnd()
 }
 
 
-} // namespace anon
+} // namespace
 
 bool Messages::readMoFile()
 {
@@ -347,6 +347,19 @@ docstring const Messages::get(string const & m) const
        }
 }
 
+
+docstring const Messages::getIfFound(string const & m) const
+{
+       if (m.empty())
+               return docstring();
+
+       TranslationMap::const_iterator it = trans_map_.find(m);
+       if (it != trans_map_.end())
+               return it->second;
+       else
+               return docstring();
+}
+
 } // namespace lyx
 
 #else // ENABLE_NLS
@@ -375,6 +388,11 @@ bool Messages::available(string const & /* c */)
        return false;
 }
 
+docstring const Messages::getIfFound(string const & m) const
+{
+       return docstring();
+}
+
 } // namespace lyx
 
 #endif