← Back to team overview

widelands-dev team mailing list archive

Re: [Merge] lp:~widelands-dev/widelands/fh1_width_and_mapobject_messages into lp:widelands

 

Review: Approve test, compile, review

Played this now some 1,5 hours or such,
noticed no direct Problems.

Code LGTM, expect an inline nit.
But I still do noth know enough about that HTML like text-handling,
do really understang what happens here.

Diff comments:

> 
> === modified file 'src/graphic/text_layout.cc'
> --- src/graphic/text_layout.cc	2017-03-25 15:32:49 +0000
> +++ src/graphic/text_layout.cc	2017-05-01 08:57:15 +0000
> @@ -31,6 +31,16 @@
>  #include "graphic/text/font_set.h"
>  #include "graphic/text_constants.h"
>  
> +namespace {
> +bool is_paragraph(const std::string& text) {
> +	return boost::starts_with(text, "<p");
> +}

Thats a very lightwight XML-Parser :-)
what about <param ...> or <picture ...>?

> +
> +bool is_div(const std::string& text) {
> +	return boost::starts_with(text, "<div");
> +}
> +} // namespace
> +
>  void replace_entities(std::string* text) {
>  	boost::replace_all(*text, "&gt;", ">");
>  	boost::replace_all(*text, "&lt;", "<");


-- 
https://code.launchpad.net/~widelands-dev/widelands/fh1_width_and_mapobject_messages/+merge/318189
Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/fh1_width_and_mapobject_messages.


References