From 7f647d188c0db1f2bb6ebff7e8d16308e2dd5bb4 Mon Sep 17 00:00:00 2001 From: Lawrence Lee Date: Wed, 8 Jul 2020 11:57:04 -0700 Subject: [PATCH] Fix cppcheck warnings --- rtgui/perspective.cc | 4 +++- rtgui/perspective.h | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/rtgui/perspective.cc b/rtgui/perspective.cc index 02aea16f6..68e43278f 100644 --- a/rtgui/perspective.cc +++ b/rtgui/perspective.cc @@ -710,11 +710,13 @@ void PerspCorrection::setCamBasedEventsActive(bool active) ControlLineManager::ControlLineManager(): EditSubscriber(ET_OBJECTS), + canvas_area(new Rectangle()), cursor(CSCrosshair), + draw_mode(false), + drawing_line(false), prev_obj(-1), selected_object(-1) { - canvas_area = std::unique_ptr(new Rectangle()); canvas_area->filled = true; canvas_area->topLeft = Coord(0, 0); mouseOverGeometry.push_back(canvas_area.get()); diff --git a/rtgui/perspective.h b/rtgui/perspective.h index 40c8d7e46..3538af279 100644 --- a/rtgui/perspective.h +++ b/rtgui/perspective.h @@ -47,7 +47,7 @@ protected: std::vector> control_lines; CursorShape cursor; bool draw_mode; - bool drawing_line = false; + bool drawing_line; Cairo::RefPtr line_icon_h, line_icon_v; Cairo::RefPtr line_icon_h_prelight, line_icon_v_prelight; int prev_obj; @@ -194,6 +194,6 @@ protected: PerspCorrection* tool; public: - LinesCallbacks(PerspCorrection* tool); + explicit LinesCallbacks(PerspCorrection* tool); void switchOffEditMode (void) override; };