Skip to content

Commit bc31388

Browse files
authored
Merge pull request #7989 from gadfort/gui-cov
gui: fix coverity issues
2 parents 4fbf7e3 + 47a8e7b commit bc31388

File tree

5 files changed

+8
-9
lines changed

5 files changed

+8
-9
lines changed

src/drt/src/dr/FlexDR_graphics.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ void GridGraphDescriptor::highlight(const std::any& object,
6868
gui::Painter& painter) const
6969
{
7070
odb::Rect bbox;
71-
getBBox(std::move(object), bbox);
71+
getBBox(object, bbox);
7272
auto x = bbox.xMin();
7373
auto y = bbox.yMin();
7474
bbox.init(x - 20, y - 20, x + 20, y + 20);
@@ -134,7 +134,7 @@ gui::Descriptor::Properties GridGraphDescriptor::getProperties(
134134
}
135135

136136
if (!graph->hasEdge(x, y, z, dir)) {
137-
props.push_back({name, "<none>"});
137+
props.push_back({std::move(name), "<none>"});
138138
continue;
139139
}
140140

src/gui/include/gui/gui.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ class Descriptor
300300
virtual std::string getName(const std::any& object) const = 0;
301301
virtual std::string getShortName(const std::any& object) const
302302
{
303-
return getName(std::move(object));
303+
return getName(object);
304304
}
305305
virtual std::string getTypeName() const = 0;
306306
virtual std::string getTypeName(const std::any& /* object */) const

src/gui/src/dbDescriptors.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2616,7 +2616,7 @@ void DbBlockageDescriptor::highlight(const std::any& object,
26162616
Painter& painter) const
26172617
{
26182618
odb::Rect rect;
2619-
getBBox(std::move(object), rect);
2619+
getBBox(object, rect);
26202620
painter.drawRect(rect);
26212621
}
26222622

@@ -2733,7 +2733,7 @@ void DbObstructionDescriptor::highlight(const std::any& object,
27332733
Painter& painter) const
27342734
{
27352735
odb::Rect rect;
2736-
getBBox(std::move(object), rect);
2736+
getBBox(object, rect);
27372737
painter.drawRect(rect);
27382738
}
27392739

src/gui/src/gui.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,8 +406,7 @@ std::string Gui::addLabel(int x,
406406
std::optional<Painter::Anchor> anchor,
407407
const std::optional<std::string>& name)
408408
{
409-
return main_window->addLabel(
410-
x, y, text, color, size, anchor, std::move(name));
409+
return main_window->addLabel(x, y, text, color, size, anchor, name);
411410
}
412411

413412
void Gui::deleteLabel(const std::string& name)

src/gui/src/layoutViewer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2489,8 +2489,8 @@ LayoutScroll::LayoutScroll(
24892489
const std::function<int()>& arrow_keys_scroll_step,
24902490
QWidget* parent)
24912491
: QScrollArea(parent),
2492-
default_mouse_wheel_zoom_(std::move(default_mouse_wheel_zoom)),
2493-
arrow_keys_scroll_step_(std::move(arrow_keys_scroll_step)),
2492+
default_mouse_wheel_zoom_(default_mouse_wheel_zoom),
2493+
arrow_keys_scroll_step_(arrow_keys_scroll_step),
24942494
viewer_(viewer),
24952495
scrolling_with_cursor_(false)
24962496
{

0 commit comments

Comments
 (0)