kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #37554
[PATCH] Return reference to current object from operator=
---
common/tool/tool_manager.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/common/tool/tool_manager.cpp b/common/tool/tool_manager.cpp
index 0fa7214c6..3233d1cbe 100644
--- a/common/tool/tool_manager.cpp
+++ b/common/tool/tool_manager.cpp
@@ -109,7 +109,7 @@ struct TOOL_MANAGER::TOOL_STATE
/// VIEW_CONTROLS settings to preserve settings when the tools are switched
KIGFX::VC_SETTINGS vcSettings;
- void operator=( const TOOL_STATE& aState )
+ TOOL_STATE& operator=( const TOOL_STATE& aState )
{
theTool = aState.theTool;
idle = aState.idle;
@@ -123,6 +123,7 @@ struct TOOL_MANAGER::TOOL_STATE
transitions = aState.transitions;
vcSettings = aState.vcSettings;
// do not copy stateStack
+ return *this;
}
bool operator==( const TOOL_MANAGER::TOOL_STATE& aRhs ) const
Follow ups