From e2e7d3d3911795153337417a0c5a54ea12be99eb Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 18 Mar 2016 22:33:31 +0100 Subject: [PATCH] Fix wxELLIPSIZE_END with wxALIGN_RIGHT in wxMSW wxDataViewCtrl Using wxELLIPSIZE_END together with wxALIGN_RIGHT resulted in unnecessarily ellipsizing or truncating the column contents in generic wxDataViewCtrl under MSW due to the combination of b642747fd25b79c20bafc6cd978914ee6f745fd0 and the native API behaviour. Fix this by not using alignment in RenderText(): it is unnecessary anyhow and not doing it avoids the problem as a side effect. Closes #17363. --- src/common/datavcmn.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/common/datavcmn.cpp b/src/common/datavcmn.cpp index 6775d5fc53..7fa71bab38 100644 --- a/src/common/datavcmn.cpp +++ b/src/common/datavcmn.cpp @@ -1002,12 +1002,17 @@ wxDataViewCustomRendererBase::RenderText(const wxString& text, if ( !GetOwner()->GetOwner()->IsEnabled() ) flags |= wxCONTROL_DISABLED; + // Notice that we intentionally don't use any alignment here: it is not + // necessary because the cell rectangle had been already adjusted to + // account for the alignment in WXCallRender() and using the alignment here + // results in problems with ellipsization when using native MSW renderer, + // see http://trac.wxwidgets.org/ticket/17363, so just don't do it. wxRendererNative::Get().DrawItemText( GetOwner()->GetOwner(), *dc, text, rectText, - GetEffectiveAlignment(), + wxALIGN_NOT, flags, GetEllipsizeMode()); }