From a4f707b8a88f505d0faf0c6d58498f053dcc2c4d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 14 Aug 2014 12:17:17 +0000 Subject: [PATCH] Add support for paragraph spacing attribute to wxTextCtrl in wxMSW. Use PFM_SPACEAFTER/PFM_SPACEBEFORE to implement support for them. Closes #16417. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77070 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/textctrl.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 9b657ce9ff..05f6eabe26 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -2776,6 +2776,24 @@ bool wxTextCtrl::MSWSetParaFormat(const wxTextAttr& style, long start, long end) } } +#if wxUSE_RICHEDIT2 + if ( style.HasParagraphSpacingAfter() ) + { + pf.dwMask |= PFM_SPACEAFTER; + + // Convert from 1/10 mm to TWIPS + pf.dySpaceAfter = (int) (((double) style.GetParagraphSpacingAfter()) * mm2twips / 10.0) ; + } + + if ( style.HasParagraphSpacingBefore() ) + { + pf.dwMask |= PFM_SPACEBEFORE; + + // Convert from 1/10 mm to TWIPS + pf.dySpaceBefore = (int) (((double) style.GetParagraphSpacingBefore()) * mm2twips / 10.0) ; + } +#endif // wxUSE_RICHEDIT2 + #if wxUSE_RICHEDIT2 if ( m_verRichEdit > 1 ) {