From: Vincent van Ravesteijn Date: Thu, 13 Dec 2012 19:15:29 +0000 (+0100) Subject: Revert "While exporting from the command-line, theApp() doesn't exist." X-Git-Tag: 2.1.0beta1~1095 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=752f2e48113100c5c7ff559c827d6c14a3f9d552;p=features.git Revert "While exporting from the command-line, theApp() doesn't exist." This reverts commit 4285b0b31698cb83c3a525d1cf6b54c5d4654142. --- diff --git a/src/Makefile.am b/src/Makefile.am index e2298f9357..d3c52f5e90 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,7 +5,7 @@ include $(top_srcdir)/config/common.am DISTCLEANFILES += libintl.h AM_CPPFLAGS += $(PCH_FLAGS) -I$(top_srcdir)/src $(BOOST_INCLUDES) $(ENCHANT_CFLAGS) $(HUNSPELL_CFLAGS) -AM_CPPFLAGS += $(QT4_CPPFLAGS) $(QT4_INCLUDES) +AM_CPPFLAGS += $(QT4_CPPFLAGS) $(QT4_CORE_INCLUDES) if BUILD_CLIENT_SUBDIR CLIENT = client diff --git a/src/graphics/PreviewLoader.cpp b/src/graphics/PreviewLoader.cpp index ce273aa189..6185681f53 100644 --- a/src/graphics/PreviewLoader.cpp +++ b/src/graphics/PreviewLoader.cpp @@ -27,7 +27,6 @@ #include "TexRow.h" #include "frontends/Application.h" // hexName -#include "frontends/qt4/ColorCache.h" #include "insets/Inset.h" @@ -37,7 +36,6 @@ #include "support/filetools.h" #include "support/ForkedCalls.h" #include "support/lstrings.h" -#include "support/qstring_helpers.h" #include "support/bind.h" @@ -589,26 +587,16 @@ void PreviewLoader::Impl::startLoading(bool wait) // FIXME XHTML // The colors should be customizable. ColorCode const bg = buffer_.isExporting() - ? Color_white : PreviewLoader::backgroundColor(); + ? Color_white : PreviewLoader::backgroundColor(); ColorCode const fg = buffer_.isExporting() - ? Color_black : PreviewLoader::foregroundColor(); - std::string bg_name, fg_name; - if (theApp()) { - fg_name = theApp()->hexName(fg); - bg_name = theApp()->hexName(bg); - } else { - ColorCache cc; - fg_name = ltrim(fromqstr(cc.get(fg).name()), "#"); - bg_name = ltrim(fromqstr(cc.get(bg).name()), "#"); - } - + ? Color_black : PreviewLoader::foregroundColor(); // The conversion command. ostringstream cs; cs << pconverter_->command << " " << quoteName(latexfile.toFilesystemEncoding()) << " --dpi " << int(font_scaling_factor) - << " --fg " << fg_name - << " --bg " << bg_name; + << " --fg " << theApp()->hexName(fg) + << " --bg " << theApp()->hexName(bg); // FIXME what about LuaTeX? if (buffer_.params().useNonTeXFonts) cs << " --latex=xelatex";