[qet] qet/qet: [5385] Fix : clear the element texts when paste an element with the option " Do not store the labels of items in the copy paste" enabled

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 5385
Author:   blacksun
Date:     2018-06-03 20:13:25 +0200 (Sun, 03 Jun 2018)
Log Message:
-----------
Fix : clear the element texts when paste an element with the option "Do not store the labels of items in the copy paste" enabled

Modified Paths:
--------------
    trunk/sources/diagramcommands.cpp
    trunk/sources/qetgraphicsitem/element.h

Modified: trunk/sources/diagramcommands.cpp
===================================================================
--- trunk/sources/diagramcommands.cpp	2018-06-02 21:15:51 UTC (rev 5384)
+++ trunk/sources/diagramcommands.cpp	2018-06-03 18:13:25 UTC (rev 5385)
@@ -103,10 +103,12 @@
 			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 <Conductor *> conductors_list = content.m_conductors_to_move;

Modified: trunk/sources/qetgraphicsitem/element.h
===================================================================
--- trunk/sources/qetgraphicsitem/element.h	2018-06-02 21:15:51 UTC (rev 5384)
+++ trunk/sources/qetgraphicsitem/element.h	2018-06-03 18:13:25 UTC (rev 5385)
@@ -1,4 +1,4 @@
-/*
+/*
 	Copyright 2006-2017 The QElectroTech Team
 	This file is part of QElectroTech.
 	
@@ -129,7 +129,6 @@
 		//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


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/