Salome HOME
Unicode support: correct handling of unicode on GUI level
[modules/gui.git] / src / OCCViewer / OCCViewer_ViewWindow.cxx
index 264cc3337eae738b55841a585f4ccb77efc77f0d..3f3217a96fe2cf9ee29010857aedb957a7d0f215 100644 (file)
@@ -2248,15 +2248,28 @@ bool OCCViewer_ViewWindow::dumpViewToFormat( const QImage& img,
 {
   bool res = false;
   QApplication::setOverrideCursor( Qt::WaitCursor );
-  if ( format != "PS" && format != "EPS")
-   res = myViewPort->getView()->Dump( fileName.toStdString().c_str() );
 
   Handle(Graphic3d_CView) a3dView = myViewPort->getView()->View();
 
-  if (format == "PS")
-    res = a3dView->Export(strdup(qPrintable(fileName)), Graphic3d_EF_PostScript);
-  else if (format == "EPS")
-    res = a3dView->Export(strdup(qPrintable(fileName)), Graphic3d_EF_EnhPostScript);
+  if (format == "PS") {
+    Handle(OpenGl_GraphicDriver) aDriver = Handle(OpenGl_GraphicDriver)::DownCast(myViewPort->getViewer()->Driver());
+    OpenGl_Caps* aCaps = &aDriver->ChangeOptions();
+    int prev = aCaps->ffpEnable;
+    aCaps->ffpEnable = 1;
+    res = a3dView->Export(strdup(qUtf8Printable(fileName)), Graphic3d_EF_PostScript);
+    aCaps->ffpEnable = prev;
+  }
+  else if (format == "EPS") {
+    Handle(OpenGl_GraphicDriver) aDriver = Handle(OpenGl_GraphicDriver)::DownCast(myViewPort->getViewer()->Driver());
+    OpenGl_Caps* aCaps = &aDriver->ChangeOptions();
+    int prev = aCaps->ffpEnable;
+    aCaps->ffpEnable = 1;
+    res = a3dView->Export(strdup(qUtf8Printable(fileName)), Graphic3d_EF_EnhPostScript);
+    aCaps->ffpEnable = prev;
+  }
+  else {
+    res = myViewPort->getView()->Dump( fileName.toStdString().c_str() );
+  }
 
   QApplication::restoreOverrideCursor();
   return res;