The branch, master, has been updated. - Log -----------------------------------------------------------------
commit 6e227f18aeb9c6c3c191e3f9b83297837357c506 Author: Vincent van Ravesteijn <[email protected]> Date: Thu Dec 13 20:16:50 2012 +0100 Fix a crash in PreviewLoader for command-line xhtml output While exporting from the command-line, theApp() doesn't exist. The colors foreground and background are only needed when previewing, so ignore this during buffer export. This replaces the fix in 4285b0b3 (Tommaso Cucinotta, 10-12-2012). In this case, we do not need to pull in Qt dependencies. diff --git a/src/graphics/PreviewLoader.cpp b/src/graphics/PreviewLoader.cpp index 6185681..10eeee3 100644 --- a/src/graphics/PreviewLoader.cpp +++ b/src/graphics/PreviewLoader.cpp @@ -583,20 +583,22 @@ void PreviewLoader::Impl::startLoading(bool wait) double const font_scaling_factor = buffer_.isExporting() ? 75.0 * buffer_.params().html_math_img_scale : 0.01 * lyxrc.dpi * lyxrc.zoom * lyxrc.preview_scale_factor; - - // FIXME XHTML - // The colors should be customizable. - ColorCode const bg = buffer_.isExporting() - ? Color_white : PreviewLoader::backgroundColor(); - ColorCode const fg = buffer_.isExporting() - ? Color_black : PreviewLoader::foregroundColor(); + // The conversion command. ostringstream cs; cs << pconverter_->command << " " << quoteName(latexfile.toFilesystemEncoding()) - << " --dpi " << int(font_scaling_factor) - << " --fg " << theApp()->hexName(fg) - << " --bg " << theApp()->hexName(bg); + << " --dpi " << int(font_scaling_factor); + + // FIXME XHTML + // The colors should be customizable. + if (!buffer_.isExporting()) { + ColorCode const fg = PreviewLoader::foregroundColor(); + ColorCode const bg = PreviewLoader::backgroundColor(); + cs << " --fg " << theApp()->hexName(fg) + << " --bg " << theApp()->hexName(bg); + } + // FIXME what about LuaTeX? if (buffer_.params().useNonTeXFonts) cs << " --latex=xelatex"; commit 752f2e48113100c5c7ff559c827d6c14a3f9d552 Author: Vincent van Ravesteijn <[email protected]> Date: Thu Dec 13 20:15:29 2012 +0100 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 e2298f9..d3c52f5 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 ce273aa..6185681 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"; commit e78e987649968c1e9daaee39e32d0768e249ea0e Author: Vincent van Ravesteijn <[email protected]> Date: Thu Dec 13 20:13:23 2012 +0100 Revert "Cmake build: Make PreviewLoader.cpp compilable again" This reverts commit 0a2c70636a49eb1b2457d29b05d9c4ee5bcc2843. diff --git a/src/graphics/CMakeLists.txt b/src/graphics/CMakeLists.txt index cd081ef..d0708bd 100644 --- a/src/graphics/CMakeLists.txt +++ b/src/graphics/CMakeLists.txt @@ -12,9 +12,7 @@ file(GLOB graphics_headers ${TOP_SRC_DIR}/src/graphics/${LYX_HPP_FILES}) lyx_add_msvc_pch(graphics) -include_directories(${TOP_SRC_DIR}/src/graphics - ${QT_INCLUDES} -) +include_directories(${TOP_SRC_DIR}/src/graphics) if(NOT LYX_MERGE_FILES) add_library(graphics ${library_type} ${graphics_sources} ${graphics_headers}) ----------------------------------------------------------------------- Summary of changes: src/Makefile.am | 2 +- src/graphics/CMakeLists.txt | 4 +--- src/graphics/PreviewLoader.cpp | 32 +++++++++++--------------------- 3 files changed, 13 insertions(+), 25 deletions(-) hooks/post-receive -- The LyX Source Repository
