From 0deb90af925ab54adbe6f226f95ae506c7701bf0 Mon Sep 17 00:00:00 2001
From: Roman Telezhynskyi <kroluku@gmail.com>
Date: Mon, 3 Jun 2019 19:17:17 +0300
Subject: [PATCH] Fix regression. Piece duplicate complains about
 currentSeamAllowance variable.

--HG--
branch : develop
---
 .../vtools/dialogs/tools/piece/dialogduplicatedetail.cpp  | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/libs/vtools/dialogs/tools/piece/dialogduplicatedetail.cpp b/src/libs/vtools/dialogs/tools/piece/dialogduplicatedetail.cpp
index a35fc233d..2d6babc4a 100644
--- a/src/libs/vtools/dialogs/tools/piece/dialogduplicatedetail.cpp
+++ b/src/libs/vtools/dialogs/tools/piece/dialogduplicatedetail.cpp
@@ -29,6 +29,7 @@
 #include "ui_dialogduplicatedetail.h"
 #include "../vwidgets/vabstractmainwindow.h"
 #include "../../../visualization/path/vistoolduplicatedetail.h"
+#include "../../../tools/vabstracttool.h"
 
 //---------------------------------------------------------------------------------------------------------------------
 DialogDuplicateDetail::DialogDuplicateDetail(const VContainer *data, quint32 toolId, QWidget *parent)
@@ -85,6 +86,13 @@ void DialogDuplicateDetail::ChosenObject(quint32 id, const SceneObject &type)
         if (type == SceneObject::Detail && id > NULL_ID)
         {
             m_idDetail = id;
+
+            VAbstractTool *tool = qobject_cast<VAbstractTool *>(VAbstractPattern::getTool(m_idDetail));
+            if (tool)
+            {
+                vis->SetData(tool->getData()); // Includes currentSeamAllowance variable we need
+            }
+
             emit ToolTip(tr("Click to place duplicate"));
             vis->VisualMode(id);
             prepare = true;