]> git.lyx.org Git - features.git/commitdiff
Fixup commit 50060053
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 14 Mar 2017 13:26:26 +0000 (14:26 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 14 Mar 2017 13:26:26 +0000 (14:26 +0100)
Fix two instances where theFormats() was used instead of a local parameter.

Fix layout test.

src/Converter.cpp
src/support/tests/dummy_functions.cpp
src/tex2lyx/dummy_impl.cpp

index 2c1ae2d87827a17e9464d3a7b99c6d7b9ebbf42f..2f22030495139195f2d1c20fb05755cf6663cc33 100644 (file)
@@ -235,8 +235,8 @@ void Converters::update(Formats const & formats)
        ConverterList::iterator it = converterlist_.begin();
        ConverterList::iterator end = converterlist_.end();
        for (; it != end; ++it) {
-               it->setFrom(theFormats().getFormat(it->from()));
-               it->setTo(theFormats().getFormat(it->to()));
+               it->setFrom(formats.getFormat(it->from()));
+               it->setTo(formats.getFormat(it->to()));
        }
 }
 
@@ -247,8 +247,8 @@ void Converters::updateLast(Formats const & formats)
 {
        if (converterlist_.begin() != converterlist_.end()) {
                ConverterList::iterator it = converterlist_.end() - 1;
-               it->setFrom(theFormats().getFormat(it->from()));
-               it->setTo(theFormats().getFormat(it->to()));
+               it->setFrom(formats.getFormat(it->from()));
+               it->setTo(formats.getFormat(it->to()));
        }
 }
 
index 63ff0c051e829ecc63821f7d77c48473c55616fe..2b0f21710a9ffc9008241547d5d6275793affcbf 100644 (file)
@@ -1,5 +1,6 @@
 #include <config.h>
 
+#include "Format.h"
 #include "support/Messages.h"
 
 using namespace std;
@@ -33,6 +34,13 @@ namespace lyx {
                return lyx_messages;
        }
 
+       // Dummy formats support (needed by Lexer)
+       Formats & theFormats()
+       {
+               static Formats dummy_formats;
+               return dummy_formats;
+       }
+
        string alignmentToCSS(LyXAlignment)
        {
                return string();
index f6977403770ee463b54b464a5ec67c235c89bd88..7c3bc4741b2fcb3ea10e6f7f3e71d23bea2f320c 100644 (file)
@@ -84,7 +84,7 @@ Messages const & getGuiMessages()
 //
 
 
-Formats & theFormats() 
+Formats & theFormats()
 {
        static Formats dummy_formats;
        return dummy_formats;