X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/37f11dee3997c348ea2098c366e7621d2337b8c2..11ea1abfa0c4684375ae7c4d5b5d75af8e39f912:/src/msw/textctrl.cpp diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 5c1fcdeacc..f4193cf875 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -27,6 +27,7 @@ #if wxUSE_TEXTCTRL && !(defined(__SMARTPHONE__) && defined(__WXWINCE__)) #ifndef WX_PRECOMP + #include "wx/msw/missing.h" #include "wx/textctrl.h" #include "wx/settings.h" #include "wx/brush.h" @@ -36,9 +37,9 @@ #include "wx/app.h" #include "wx/menu.h" #include "wx/math.h" + #include "wx/module.h" #endif -#include "wx/module.h" #include "wx/sysopt.h" #if wxUSE_CLIPBOARD @@ -71,8 +72,6 @@ #include #endif -#include "wx/msw/missing.h" - #endif // wxUSE_RICHEDIT // ---------------------------------------------------------------------------- @@ -2565,11 +2564,23 @@ bool wxTextCtrl::SetStyle(long start, long end, const wxTextAttr& style) } } - if (pf.dwMask != 0) +#if wxUSE_RICHEDIT2 + if ( m_verRichEdit > 1 ) + { + if ( wxTheApp->GetLayoutDirection() == wxLayout_RightToLeft ) + { + // Use RTL paragraphs in RTL mode to get proper layout + pf.dwMask |= PFM_RTLPARA; + pf.wEffects |= PFE_RTLPARA; + } + } +#endif // wxUSE_RICHEDIT2 + + if ( pf.dwMask ) { // do format the selection bool ok = ::SendMessage(GetHwnd(), EM_SETPARAFORMAT, - 0, (LPARAM) &pf) != 0; + 0, (LPARAM) &pf) != 0; if ( !ok ) { wxLogDebug(_T("SendMessage(EM_SETPARAFORMAT, 0) failed"));