From: nds Date: Thu, 20 Mar 2008 13:05:52 +0000 (+0000) Subject: Metods exportData and copy/paste values became public. X-Git-Tag: TG_ACHERON_2008-04-13~18 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e4375891da79971cf39e84f495cd0e7094a2498d;p=modules%2Fgui.git Metods exportData and copy/paste values became public. --- diff --git a/src/TableViewer/TableViewer_ViewWindow.cxx b/src/TableViewer/TableViewer_ViewWindow.cxx index 0a94850b6..199729bc5 100755 --- a/src/TableViewer/TableViewer_ViewWindow.cxx +++ b/src/TableViewer/TableViewer_ViewWindow.cxx @@ -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(); } diff --git a/src/TableViewer/TableViewer_ViewWindow.h b/src/TableViewer/TableViewer_ViewWindow.h index 79d044c2a..94514fc6e 100755 --- a/src/TableViewer/TableViewer_ViewWindow.h +++ b/src/TableViewer/TableViewer_ViewWindow.h @@ -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;