forked from organicmaps/organicmaps
FriBidi compilation fixes and @TODO refactorings for YG
- needed because wchar_t is equal to char (1 byte) on Android
This commit is contained in:
parent
e346b9afcc
commit
6350ab1569
3 changed files with 19 additions and 13 deletions
|
@ -24,10 +24,10 @@ void MakeLowerCase(string & s);
|
|||
string MakeLowerCase(string const & s);
|
||||
bool EqualNoCase(string const & s1, string const & s2);
|
||||
|
||||
inline UniString MakeUniString(string const & s)
|
||||
inline UniString MakeUniString(string const & utf8s)
|
||||
{
|
||||
UniString result;
|
||||
utf8::unchecked::utf8to32(s.begin(), s.end(), back_inserter(result));
|
||||
utf8::unchecked::utf8to32(utf8s.begin(), utf8s.end(), back_inserter(result));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -160,13 +160,8 @@ inline bool to_uint64(string const & s, uint64_t & i) { return to_uint64(s.c_str
|
|||
inline bool to_int64(string const & s, int64_t & i) { return to_int64(s.c_str(), i); }
|
||||
inline bool to_double(string const & s, double & d) { return to_double(s.c_str(), d); }
|
||||
|
||||
inline string ToUtf8(wstring const & wstr)
|
||||
{
|
||||
string result;
|
||||
utf8::unchecked::utf16to8(wstr.begin(), wstr.end(), back_inserter(result));
|
||||
return result;
|
||||
}
|
||||
|
||||
/// @TODO Remove, it's temporary workaround until YG is not refactored
|
||||
/// @deprecated
|
||||
inline wstring FromUtf8(string const & str)
|
||||
{
|
||||
wstring result;
|
||||
|
@ -174,6 +169,17 @@ inline wstring FromUtf8(string const & str)
|
|||
return result;
|
||||
}
|
||||
|
||||
/// @TODO Remove, it's temporary workaround until YG is not refactored
|
||||
/// @deprecated
|
||||
inline wstring UniStringToUtf16(UniString const & str)
|
||||
{
|
||||
string utf8tmp;
|
||||
utf8::unchecked::utf32to8(str.begin(), str.end(), back_inserter(utf8tmp));
|
||||
wstring result;
|
||||
utf8::unchecked::utf8to16(utf8tmp.begin(), utf8tmp.end(), back_inserter(result));
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename ItT, typename DelimiterT>
|
||||
typename ItT::value_type JoinStrings(ItT begin, ItT end, DelimiterT const & delimiter)
|
||||
{
|
||||
|
|
|
@ -15,10 +15,12 @@
|
|||
#include "../base/logging.hpp"
|
||||
#include "../base/stl_add.hpp"
|
||||
|
||||
|
||||
namespace yg
|
||||
{
|
||||
namespace gl
|
||||
{
|
||||
|
||||
TextRenderer::Params::Params()
|
||||
: m_textTreeAutoClean(true),
|
||||
m_useTextTree(false),
|
||||
|
@ -73,8 +75,8 @@ namespace yg
|
|||
|
||||
/* string const & TextRenderer::TextObj::Text() const
|
||||
{
|
||||
return m_elem.utf8Text();
|
||||
}*/
|
||||
return m_utf8Text;
|
||||
}
|
||||
|
||||
void TextRenderer::TextObj::Offset(m2::PointD const & offs)
|
||||
{
|
||||
|
@ -133,7 +135,6 @@ namespace yg
|
|||
{
|
||||
m_needTextRedraw = false;
|
||||
m_tree.ForEach(bind(&TextObj::Draw, _1, this));
|
||||
|
||||
/// flushing only texts
|
||||
base_t::flush(skin()->currentTextPage());
|
||||
}
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
|
||||
#include "../std/shared_ptr.hpp"
|
||||
|
||||
|
||||
namespace yg
|
||||
{
|
||||
class ResourceManager;
|
||||
|
|
Loading…
Add table
Reference in a new issue