From de607c1c30df45315be50a1c46bb7ff4ee0e4e08 Mon Sep 17 00:00:00 2001 From: PaddleStroke Date: Fri, 5 Sep 2025 15:37:55 +0200 Subject: [PATCH] Part: Revolution: do not copy style of sketches --- src/Mod/Part/Gui/DlgRevolution.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/Mod/Part/Gui/DlgRevolution.cpp b/src/Mod/Part/Gui/DlgRevolution.cpp index b9fb3701e3..f20c6ca1c9 100644 --- a/src/Mod/Part/Gui/DlgRevolution.cpp +++ b/src/Mod/Part/Gui/DlgRevolution.cpp @@ -49,6 +49,8 @@ #include #include +#include + #include "DlgRevolution.h" #include "ui_DlgRevolution.h" @@ -434,11 +436,15 @@ void DlgRevolution::accept() symmetric) //%13 ; Gui::Command::runCommand(Gui::Command::App, code.toLatin1()); - QByteArray to = name.toLatin1(); - QByteArray from = shape.toLatin1(); - Gui::Command::copyVisual(to, "ShapeAppearance", from); - Gui::Command::copyVisual(to, "LineColor", from); - Gui::Command::copyVisual(to, "PointColor", from); + + auto newObj = activeDoc->getObject(name.toStdString().c_str()); + auto sourceObj = activeDoc->getObject(shape.toStdString().c_str()); + + if (!sourceObj->isDerivedFrom()) { + Gui::Command::copyVisual(newObj, "ShapeAppearance", sourceObj); + Gui::Command::copyVisual(newObj, "LineColor", sourceObj); + Gui::Command::copyVisual(newObj, "PointColor", sourceObj); + } } activeDoc->commitTransaction(); @@ -585,3 +591,4 @@ bool TaskRevolution::accept() } #include "moc_DlgRevolution.cpp" +