]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Metods exportData and copy/paste values became public.
authornds <nds@opencascade.com>
Thu, 20 Mar 2008 13:05:52 +0000 (13:05 +0000)
committernds <nds@opencascade.com>
Thu, 20 Mar 2008 13:05:52 +0000 (13:05 +0000)
src/TableViewer/TableViewer_ViewWindow.cxx
src/TableViewer/TableViewer_ViewWindow.h

index 0a94850b62f4b79d2ef8a8682f19172f62a0e116..199729bc54163874cbef0513f544af47f74b2fd4 100755 (executable)
@@ -356,6 +356,11 @@ void TableViewer_ViewWindow::exportData()
   if ( fileName.isEmpty() )
     return;
 
+  exportData( fileName );
+}
+
+void TableViewer_ViewWindow::exportData( const QString& theFileName )
+{
   QApplication::setOverrideCursor( Qt::WaitCursor );
 
   int rows = numRows( Cells );
@@ -365,8 +370,8 @@ void TableViewer_ViewWindow::exportData()
 
   Handle(HTMLService_HTMLTable) table = new HTMLService_HTMLTable( rows + horOffset,
                                                                    cols + verOffset );
-  QString title = getViewManager()->getTitle();
-  SUIT_ViewWindow* anActiveWnd = getViewManager()->getActiveView();
+  QString title = getViewManager() ? getViewManager()->getTitle() : "";
+  SUIT_ViewWindow* anActiveWnd = getViewManager() ? getViewManager()->getActiveView() : 0;
   if ( anActiveWnd )
     title = anActiveWnd->windowTitle();
 
@@ -383,7 +388,7 @@ void TableViewer_ViewWindow::exportData()
     ltCell->SetHeaderCell( true );
     ltCell->SetBackgroundColor( Quantity_NOC_GRAY );
   }
-  table->GenerateFile( TableViewer_Tool::ToExtString( fileName ), true );
+  table->GenerateFile( TableViewer_Tool::ToExtString( theFileName ), true );
 
   QApplication::restoreOverrideCursor();
 }
index 79d044c2a7f9f04aeec0add7ead8819909446c81..94514fc6e36e167d1e940abb94bc5da58773c60b 100755 (executable)
@@ -50,6 +50,11 @@ public:
   virtual void        initLayout();
   virtual QImage      dumpView();
 
+  void                exportData();
+  void                exportData( const QString& );
+  void                copyData();
+  void                pasteData();
+
 protected:
   typedef enum { VerticalHeader, HorizontalHeader, Cells } ContentType;
   typedef enum { DumpId, CopyId, PasteId, PrintId, ExportId, Custom } ActionId;
@@ -83,9 +88,6 @@ protected slots:
   void                onActivated();
 
 private:
-  void                exportData();
-  void                copyData();
-  void                pasteData();
   typedef struct {
     QString myText;
     QColor  myBgCol;