From 7a124ab8614efa113cc08205c47aeb720b2e2b9e Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Tue, 14 Mar 2017 14:26:26 +0100 Subject: [PATCH] Fixup commit 50060053 Fix two instances where theFormats() was used instead of a local parameter. Fix layout test. --- src/Converter.cpp | 8 ++++---- src/support/tests/dummy_functions.cpp | 8 ++++++++ src/tex2lyx/dummy_impl.cpp | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/Converter.cpp b/src/Converter.cpp index 2c1ae2d878..2f22030495 100644 --- a/src/Converter.cpp +++ b/src/Converter.cpp @@ -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())); } } diff --git a/src/support/tests/dummy_functions.cpp b/src/support/tests/dummy_functions.cpp index 63ff0c051e..2b0f21710a 100644 --- a/src/support/tests/dummy_functions.cpp +++ b/src/support/tests/dummy_functions.cpp @@ -1,5 +1,6 @@ #include +#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(); diff --git a/src/tex2lyx/dummy_impl.cpp b/src/tex2lyx/dummy_impl.cpp index f697740377..7c3bc4741b 100644 --- a/src/tex2lyx/dummy_impl.cpp +++ b/src/tex2lyx/dummy_impl.cpp @@ -84,7 +84,7 @@ Messages const & getGuiMessages() // -Formats & theFormats() +Formats & theFormats() { static Formats dummy_formats; return dummy_formats; -- 2.39.2