From 1210587617ed2d7bb4ba9e0863f88236e106abe0 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 29 Oct 2013 12:17:40 +0000 Subject: [PATCH] Fix MeasureWidths() in wxSTC in non-Unicode build. Integer values must be converted to floats instead of just using memcpy(). Closes #15617. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75097 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/stc/PlatWX.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/stc/PlatWX.cpp b/src/stc/PlatWX.cpp index b752c39689..393c3842e4 100644 --- a/src/stc/PlatWX.cpp +++ b/src/stc/PlatWX.cpp @@ -537,15 +537,12 @@ void SurfaceImpl::MeasureWidths(Font &font, const char *s, int len, XYPOSITION * } ui++; } -#else - +#else // !wxUSE_UNICODE // If not unicode then just use the widths we have -#if wxUSE_STD_CONTAINERS - std::copy(tpos.begin(), tpos.end(), positions); -#else - memcpy(positions, tpos.begin(), len * sizeof(int)); -#endif -#endif + for (int i = 0; i < len; i++) { + positions[i] = tpos[i]; + } +#endif // wxUSE_UNICODE/!wxUSE_UNICODE }