Skip to content

Commit

Permalink
Fix rendering of multiline entries in the list on Windows
Browse files Browse the repository at this point in the history
Unlike other platforms, Windows ListView doesn’t replace newlines with a
space when putting the content on a single line, but rather eats them
completely, resulting in the text running together. Add explicit
substitution (MSW only) to fix this.
  • Loading branch information
vslavik committed Jun 19, 2016
1 parent 4de3bd0 commit 502d9fb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/edlistctrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,9 @@ wxString PoeditListCtrl::OnGetItemText(long item, long column) const
orig = d->GetString();

orig = orig.substr(0, GetMaxColChars());
#ifdef __WXMSW__
orig.Replace("\n", " ");
#endif

// Add RTL Unicode mark to render bidi texts correctly
if (m_appTextDir != m_sourceTextDir)
Expand All @@ -525,6 +528,9 @@ wxString PoeditListCtrl::OnGetItemText(long item, long column) const
else if (column == m_colTrans)
{
auto trans = d->GetTranslation().substr(0, GetMaxColChars());
#ifdef __WXMSW__
trans.Replace("\n", " ");
#endif

// Add RTL Unicode mark to render bidi texts correctly
if (m_appTextDir != m_transTextDir)
Expand Down

0 comments on commit 502d9fb

Please sign in to comment.