From 43f7bad2d0e5dc670160da8c8264b8219b8257f9 Mon Sep 17 00:00:00 2001 From: blacksun Date: Sun, 3 Jun 2018 18:13:25 +0000 Subject: [PATCH] Fix : clear the element texts when paste an element with the option "Do not store the labels of items in the copy paste" enabled git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5385 bfdf4180-ca20-0410-9c96-a3a8aa849046 --- sources/diagramcommands.cpp | 10 ++++++---- sources/qetgraphicsitem/element.h | 3 +-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/sources/diagramcommands.cpp b/sources/diagramcommands.cpp index 09c5609b5..f83c7a62c 100644 --- a/sources/diagramcommands.cpp +++ b/sources/diagramcommands.cpp @@ -103,10 +103,12 @@ void PasteDiagramCommand::redo() if (settings.value("diagramcommands/erase-label-on-copy", true).toBool()) { //Reset the information about the label, the comment and location - e -> rElementInformations().addValue("formula", ""); - e -> rElementInformations().addValue("label", ""); - e -> rElementInformations().addValue("comment", ""); - e -> rElementInformations().addValue("location", ""); + DiagramContext dc = e->elementInformations(); + dc.addValue("formula", ""); + dc.addValue("label", ""); + dc.addValue("comment", ""); + dc.addValue("location", ""); + e->setElementInformations(dc); //Reset the text of conductors const QList conductors_list = content.m_conductors_to_move; diff --git a/sources/qetgraphicsitem/element.h b/sources/qetgraphicsitem/element.h index bdee3c300..1413a73b3 100644 --- a/sources/qetgraphicsitem/element.h +++ b/sources/qetgraphicsitem/element.h @@ -1,4 +1,4 @@ -/* +/* Copyright 2006-2017 The QElectroTech Team This file is part of QElectroTech. @@ -129,7 +129,6 @@ class Element : public QetGraphicsItem //METHODS related to information public: DiagramContext elementInformations ()const {return m_element_informations;} - DiagramContext& rElementInformations () {return m_element_informations;} virtual void setElementInformations (DiagramContext dc); DiagramContext kindInformations () const {return m_kind_informations;} //@kind_information_ is used to store more information //about the herited class like contactelement for know