git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25827
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
// Each element of the array will be the width of the string up to and
// Each element of the array will be the width of the string up to and
-// including the coresoponding character in text.
+// including the coresoponding character in text.
bool wxDC::DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) const
{
bool wxDC::DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) const
{
maxLenText = version == wxWINDOWS_NT ? 65535 : 8192;
maxWidth = version == wxWINDOWS_NT ? INT_MAX : 32767;
}
maxLenText = version == wxWINDOWS_NT ? 65535 : 8192;
maxWidth = version == wxWINDOWS_NT ? INT_MAX : 32767;
}
widths.Empty();
widths.Add(0, stlen); // fill the array with zeros
widths.Empty();
widths.Add(0, stlen); // fill the array with zeros
if (!::GetTextExtentExPoint(GetHdc(),
text.c_str(), // string to check
wxMin(stlen, maxLenText),
if (!::GetTextExtentExPoint(GetHdc(),
text.c_str(), // string to check
wxMin(stlen, maxLenText),
- maxWidth,
- &fit, // receives count of chars
+ maxWidth,
+ &fit, // [out] count of chars
- widths.begin(), // array to fill
- &sz)) {
+ &widths[0], // array to fill
+ &sz))
+ {
// API failed
wxLogLastError(wxT("GetTextExtentExPoint"));
// API failed
wxLogLastError(wxT("GetTextExtentExPoint"));