Salome HOME
SALOME 9.1.0 Windows version
[modules/gui.git] / src / GLViewer / GLViewer_BaseObjects.cxx
index ae9caefd9028d6eb01105ac24db67be0524e7683..6e65422f294b93b43d9d748e7d0a80dc55018a7a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -1096,7 +1096,7 @@ GLboolean GLViewer_Polyline::select( GLfloat x, GLfloat y, GLfloat tol, GLViewer
     GLfloat xa, xb, ya, yb, l;
     GLfloat rsin, rcos, r, ra, rb;
     // GLboolean update;
-    GLboolean selected = myIsSel;
+    // GLboolean selected = myIsSel;
 
     myIsSel = GL_FALSE;
 
@@ -1438,7 +1438,6 @@ bool GLViewer_TextObject::translateToEMF( HDC dc, GLViewer_CoordSystem* aViewerC
            y = double( yPos );
 
     aViewerCS->transform( *aEMFCS, x, y );
-    const char* str = aText.toLatin1();
 
     int nHeight = 35*14;       // height of font
     int nWidth = 35*12;        // average character width
@@ -1466,7 +1465,12 @@ bool GLViewer_TextObject::translateToEMF( HDC dc, GLViewer_CoordSystem* aViewerC
 
     HGDIOBJ old1 = SelectObject( dc, aFont );
     HGDIOBJ old2 = SelectObject( dc, aBrush );
-
+#ifdef UNICODE
+       LPTSTR str = new TCHAR[aText.length() + 1];
+       str[aText.toWCharArray(str)] = '\0';
+#else  
+       LPTSTR str = aText.toLatin1().constData();
+#endif
     TextOut( dc, x, y, str, aText.length() );
 
     SelectObject ( dc, old1 );