Commit 131fc83d authored by Huff, Israel's avatar Huff, Israel
Browse files

Fortify changes

parent 285d83ad
Pipeline #67105 failed with stages
in 20 minutes and 48 seconds
...@@ -21,18 +21,20 @@ class RADIX_PUBLIC TableView::PImpl ...@@ -21,18 +21,20 @@ class RADIX_PUBLIC TableView::PImpl
TableView::PImpl::PImpl() TableView::PImpl::PImpl()
{ {
allow_paste = false; allow_paste = false;
copy_vert_header = false; copy_vert_header = false;
copy_horiz_header = false; copy_horiz_header = false;
separator = '\t'; separator = '\t';
} }
TableView::TableView(QWidget *parent) TableView::TableView(QWidget *parent)
: QTableView(parent) : QTableView(parent)
, p(new PImpl(), [](PImpl *impl) { delete impl; }) , p(new PImpl(), deleter)
{ {
} }
void TableView::deleter(PImpl *impl) { delete impl; }
char TableView::separator() const { return p->separator; } char TableView::separator() const { return p->separator; }
void TableView::setSeparator(char value) { p->separator = value; } void TableView::setSeparator(char value) { p->separator = value; }
...@@ -98,11 +100,11 @@ void TableView::copy() ...@@ -98,11 +100,11 @@ void TableView::copy()
} }
if (p->copy_horiz_header) if (p->copy_horiz_header)
{ {
for (int i = 0; i < cols.size(); i++) for (int i = 0; i < cols.size(); i++)
{ {
if (i > 0) data.append(p->separator); if (i > 0) data.append(p->separator);
data.append(chmodel->headerData(cols[i], Qt::Horizontal).toString()); data.append(chmodel->headerData(cols[i], Qt::Horizontal).toString());
} }
} }
data.append('\n'); data.append('\n');
} }
......
...@@ -21,9 +21,10 @@ class RADIX_PUBLIC TableView : public QTableView ...@@ -21,9 +21,10 @@ class RADIX_PUBLIC TableView : public QTableView
class PImpl; class PImpl;
std::unique_ptr<PImpl, void (*)(PImpl *)> p; std::unique_ptr<PImpl, void (*)(PImpl *)> p;
static void deleter(PImpl *impl);
public: public:
TableView(QWidget *parent = 0); TableView(QWidget *parent = nullptr);
char separator() const; char separator() const;
void setSeparator(char value); void setSeparator(char value);
......
...@@ -832,6 +832,7 @@ bool vtkPlotPointsErrorBars::UpdateTableCache(vtkTable *table) ...@@ -832,6 +832,7 @@ bool vtkPlotPointsErrorBars::UpdateTableCache(vtkTable *table)
} }
vtkDataArray *x = array[0]; vtkDataArray *x = array[0];
vtkDataArray *y = array[1]; vtkDataArray *y = array[1];
if (x == nullptr || y == nullptr) return false;
// Now copy the components into their new columns // Now copy the components into their new columns
if (this->UseIndexForXSeries) if (this->UseIndexForXSeries)
...@@ -868,7 +869,7 @@ bool vtkPlotPointsErrorBars::UpdateTableCache(vtkTable *table) ...@@ -868,7 +869,7 @@ bool vtkPlotPointsErrorBars::UpdateTableCache(vtkTable *table)
if (xErr) if (xErr)
{ {
switch (xErr->GetDataType()) switch (xErr->GetDataType())
{ {
vtkTemplateMacro(CopyToXErrors( vtkTemplateMacro(CopyToXErrors(
this->XErrors, static_cast<VTK_TT *>(xErr->GetVoidPointer(0)), this->XErrors, static_cast<VTK_TT *>(xErr->GetVoidPointer(0)),
int(xErr->GetNumberOfTuples()), this->ShiftScale)); int(xErr->GetNumberOfTuples()), this->ShiftScale));
......
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