Commit 597cfab0 authored by Marcus D. Hanwell's avatar Marcus D. Hanwell
Browse files

Use the std::string API from vtkContextUnicode

Change-Id: If628184669023be1e10774a93d47a4d1b6149b3e
parent dff00e9e
...@@ -797,28 +797,16 @@ void vtkOpenGLContextDevice2D::AlignText(double orientation, float width, ...@@ -797,28 +797,16 @@ void vtkOpenGLContextDevice2D::AlignText(double orientation, float width,
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void vtkOpenGLContextDevice2D::DrawString(float *point, void vtkOpenGLContextDevice2D::DrawString(float *point,
const vtkStdString &str) const vtkStdString &string)
{ {
// The &str[0] below will segfault if the string is empty: this->DrawString(point, vtkUnicodeString::from_utf8(string));
if (size_t size = str.size())
{
const char *begin(&str[0]);
const char *end(begin + size);
this->DrawString(point, vtkUnicodeString::from_utf8(begin, end));
}
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void vtkOpenGLContextDevice2D::ComputeStringBounds(const vtkStdString &str, void vtkOpenGLContextDevice2D::ComputeStringBounds(const vtkStdString &string,
float bounds[4]) float bounds[4])
{ {
// The &str[0] below will segfault if the string is empty: this->ComputeStringBounds(vtkUnicodeString::from_utf8(string), bounds);
if (size_t size = str.size())
{
const char *begin(&str[0]);
const char *end(begin + size);
this->ComputeStringBounds(vtkUnicodeString::from_utf8(begin, end), bounds);
}
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment