]> git.lyx.org Git - lyx.git/commitdiff
Adapt code to comment
authorEnrico Forestieri <forenr@lyx.org>
Mon, 15 Aug 2016 01:22:01 +0000 (03:22 +0200)
committerEnrico Forestieri <forenr@lyx.org>
Mon, 15 Aug 2016 01:22:01 +0000 (03:22 +0200)
src/graphics/PreviewLoader.cpp

index f3bf4378114270e1244796aeabcdd6e8e345d5b3..e9b1d47202c2a4a4288a6f97227eeeddce48c66d 100644 (file)
@@ -103,13 +103,11 @@ lyx::Converter const * setConverter(string const & from)
                });
 #else
        // This is also thread-safe according to ยง6.7.4 of the C++11 standard.
-       static bool first = true;
-       if (first) {
-               first = false;
-               LYXERR0("PreviewLoader::startLoading()\n"
-                       << "No converter from \"" << from
-                       << "\" format has been defined.");
-       }
+       static bool once = ([&]{
+                       LYXERR0("PreviewLoader::startLoading()\n"
+                               << "No converter from \"" << from
+                               << "\" format has been defined.");
+               } (), true);
 #endif
        return 0;
 }