mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-02-09 21:28:30 -06:00
Fixes some problems reported by Coverity
- Unchecked dynamic_cast - Uninitialized scalar field - Uninitialized pointer field - Big parameter passed by value
This commit is contained in:
@@ -82,7 +82,7 @@ public:
|
||||
|
||||
void setEditorData(QWidget *editor, const QModelIndex &index) const override {
|
||||
|
||||
NullLineEdit* lineEditor = dynamic_cast<NullLineEdit*>(editor);
|
||||
NullLineEdit* lineEditor = static_cast<NullLineEdit*>(editor);
|
||||
// Set the editor in the null state (unless the user has actually written NULL)
|
||||
if (index.model()->data(index, Qt::UserRole).isNull() &&
|
||||
index.model()->data(index, Qt::DisplayRole) == Settings::getValue("databrowser", "null_text"))
|
||||
@@ -94,7 +94,7 @@ public:
|
||||
}
|
||||
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override {
|
||||
|
||||
NullLineEdit* lineEditor = dynamic_cast<NullLineEdit*>(editor);
|
||||
NullLineEdit* lineEditor = static_cast<NullLineEdit*>(editor);
|
||||
// Restore NULL text (unless the user has already modified the value)
|
||||
if (lineEditor->isNull() && !lineEditor->isModified()) {
|
||||
model->setData(index, Settings::getValue("databrowser", "null_text"), Qt::DisplayRole);
|
||||
|
||||
Reference in New Issue
Block a user