Spreadsheet: Fixes for coverity defects Feb 2025
This commit is contained in:
@@ -543,7 +543,7 @@ void Cell::setDisplayUnit(const std::string& unit)
|
||||
if (newDisplayUnit != displayUnit) {
|
||||
PropertySheet::AtomicPropertyChange signaller(*owner);
|
||||
|
||||
displayUnit = newDisplayUnit;
|
||||
displayUnit = std::move(newDisplayUnit);
|
||||
setUsed(DISPLAY_UNIT_SET, !displayUnit.isEmpty());
|
||||
setDirty();
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
explicit DisplayUnit(const std::string _stringRep = "",
|
||||
const Base::Unit _unit = Base::Unit(),
|
||||
double _scaler = 0.0)
|
||||
: stringRep(_stringRep)
|
||||
: stringRep(std::move(_stringRep))
|
||||
, unit(_unit)
|
||||
, scaler(_scaler)
|
||||
{}
|
||||
|
||||
@@ -787,7 +787,7 @@ void PropertySheet::setAlias(CellAddress address, const std::string& alias)
|
||||
App::ObjectIdentifier key(owner, oldAlias);
|
||||
App::ObjectIdentifier value(owner, alias.empty() ? address.toString() : alias);
|
||||
|
||||
m[key] = value;
|
||||
m[key] = std::move(value);
|
||||
|
||||
owner->getDocument()->renameObjectIdentifiers(m);
|
||||
}
|
||||
@@ -1397,7 +1397,7 @@ void PropertySheet::addDependencies(CellAddress key)
|
||||
|
||||
// Insert into maps
|
||||
propertyNameToCellMap[propName].insert(key);
|
||||
cellToPropertyNameMap[key].insert(propName);
|
||||
cellToPropertyNameMap[key].insert(std::move(propName));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,7 +104,15 @@ Sheet::Sheet()
|
||||
|
||||
Sheet::~Sheet()
|
||||
{
|
||||
clearAll();
|
||||
try {
|
||||
clearAll();
|
||||
}
|
||||
catch (boost::wrapexcept<boost::regex_error>&) {
|
||||
// Don't let an exception propagate out of a destructor (calls terminate())
|
||||
Base::Console().Error(
|
||||
"clearAll() resulted in an exception when deleting the spreadsheet : %s\n",
|
||||
*pcNameInDocument);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -191,7 +191,7 @@ void DlgBindSheet::accept()
|
||||
addr = std::string("<<") + copy + ">>";
|
||||
}
|
||||
else {
|
||||
addr = copy;
|
||||
addr = std::move(copy);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -68,9 +68,9 @@ private:
|
||||
|
||||
QPointer<SpreadsheetGui::SheetTableView> stv;
|
||||
QGraphicsScene m_scene;
|
||||
QGraphicsProxyWidget* qpw;
|
||||
QGraphicsProxyWidget* qpw {nullptr};
|
||||
|
||||
int m_zoomLevel;
|
||||
int m_zoomLevel {100};
|
||||
|
||||
protected:
|
||||
void focusOutEvent(QFocusEvent* event) override;
|
||||
|
||||
Reference in New Issue
Block a user