From 86e1b977ad642609a9424e6d3199e5e3e7fd21ef Mon Sep 17 00:00:00 2001 From: Christophe Bourcier Date: Tue, 19 Jun 2018 09:09:13 +0200 Subject: [PATCH] Fix #2530 Export Feature stored into the History --- src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp | 3 +++ src/ExchangePlugin/ExchangePlugin_ExportFeature.h | 10 +++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp b/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp index 407887dbc..8803b3d3c 100644 --- a/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp +++ b/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp @@ -225,6 +225,9 @@ void ExchangePlugin_ExportFeature::exportXAO(const std::string& theFileName) std::string anAuthor = string(ExchangePlugin_ExportFeature::XAO_AUTHOR_ID())->value(); aXao.setAuthor(anAuthor); + if (anAuthor == "automatic_shaper_export_to_XAO") + _comes_from_export_to_geom = true; + // make shape for export from all results std::list aShapes; std::list aResults; diff --git a/src/ExchangePlugin/ExchangePlugin_ExportFeature.h b/src/ExchangePlugin/ExchangePlugin_ExportFeature.h index f0866181c..317c10858 100644 --- a/src/ExchangePlugin/ExchangePlugin_ExportFeature.h +++ b/src/ExchangePlugin/ExchangePlugin_ExportFeature.h @@ -105,9 +105,10 @@ public: /// Computes or recomputes the results EXCHANGEPLUGIN_EXPORT virtual void execute(); - /// Reimplemented from ModelAPI_Feature::isMacro(). Returns false. - // Not a macro. Otherwise, the feature will be deleted after being executed - EXCHANGEPLUGIN_EXPORT virtual bool isMacro() const { return false; } + /// Reimplemented from ModelAPI_Feature::isMacro(). + // Not always a macro. Otherwise, the feature will be deleted after being executed. + // It is needed for python dump of exportToXAO when it comes from exportToGEOM. + EXCHANGEPLUGIN_EXPORT virtual bool isMacro() const { return !_comes_from_export_to_geom; } /// Reimplemented from ModelAPI_Feature::isPreviewNeeded(). Returns false. EXCHANGEPLUGIN_EXPORT virtual bool isPreviewNeeded() const { return false; } @@ -123,6 +124,9 @@ protected: /// Performs export to XAO file EXCHANGEPLUGIN_EXPORT void exportXAO(const std::string& theFileName); + +private: + bool _comes_from_export_to_geom = false; }; #endif /* EXPORT_EXPORTFEATURE_H_ */ -- 2.39.2