From 7d7a1119daccbf4a342555a3395c00fbd5e9f817 Mon Sep 17 00:00:00 2001 From: Sergey Shambir Date: Tue, 12 Feb 2013 11:49:20 +0400 Subject: [PATCH] Fixed book text misalignment, at least in some cases https://bugs.openmw.org/issues/284 --- apps/openmw/mwgui/formatting.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/openmw/mwgui/formatting.cpp b/apps/openmw/mwgui/formatting.cpp index c50381a87..7f28e9e17 100644 --- a/apps/openmw/mwgui/formatting.cpp +++ b/apps/openmw/mwgui/formatting.cpp @@ -87,6 +87,7 @@ std::vector BookTextParser::split(std::string utf8Text, const int w MWScript::InterpreterContext interpreterContext(NULL, MWWorld::Ptr()); // empty arguments, because there is no locals or actor utf8Text = Interpreter::fixDefinesBook(utf8Text, interpreterContext); + boost::algorithm::replace_all(utf8Text, "\n", ""); boost::algorithm::replace_all(utf8Text, "
", "\n"); boost::algorithm::replace_all(utf8Text, "

", "\n\n"); @@ -207,6 +208,7 @@ MyGUI::IntSize BookTextParser::parse(std::string text, MyGUI::Widget* parent, co MyGUI::Gui::getInstance().destroyWidget(mParent->getChildAt(0)); } + boost::algorithm::replace_all(text, "\n", ""); boost::algorithm::replace_all(text, "
", "\n"); boost::algorithm::replace_all(text, "

", "\n\n");