[qet] [1889] Bugfix: existing project files could end up saving application-wide default template properties .

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


Revision: 1889
Author:   xavier
Date:     2012-07-01 23:54:03 +0200 (Sun, 01 Jul 2012)
Log Message:
-----------
Bugfix: existing project files could end up saving application-wide default template properties.

Modified Paths:
--------------
    trunk/sources/diagramcontext.cpp
    trunk/sources/diagramcontext.h
    trunk/sources/titleblockproperties.cpp

Modified: trunk/sources/diagramcontext.cpp
===================================================================
--- trunk/sources/diagramcontext.cpp	2012-07-01 21:54:02 UTC (rev 1888)
+++ trunk/sources/diagramcontext.cpp	2012-07-01 21:54:03 UTC (rev 1889)
@@ -65,6 +65,13 @@
 	return(false);
 }
 
+/**
+	Clear the content of this diagram context.
+*/
+void DiagramContext::clear() {
+	content_.clear();
+}
+
 bool DiagramContext::operator==(const DiagramContext &dc) const {
 	return(content_ == dc.content_);
 }

Modified: trunk/sources/diagramcontext.h
===================================================================
--- trunk/sources/diagramcontext.h	2012-07-01 21:54:02 UTC (rev 1888)
+++ trunk/sources/diagramcontext.h	2012-07-01 21:54:03 UTC (rev 1889)
@@ -36,6 +36,7 @@
 	bool contains(const QString &) const;
 	const QVariant operator[](const QString &) const;
 	bool addValue(const QString &, const QVariant &);
+	void clear();
 	
 	bool operator==(const DiagramContext &) const;
 	bool operator!=(const DiagramContext &) const;

Modified: trunk/sources/titleblockproperties.cpp
===================================================================
--- trunk/sources/titleblockproperties.cpp	2012-07-01 21:54:02 UTC (rev 1888)
+++ trunk/sources/titleblockproperties.cpp	2012-07-01 21:54:03 UTC (rev 1889)
@@ -102,6 +102,7 @@
 	if (e.hasAttribute("titleblocktemplate")) template_name = e.attribute("titleblocktemplate");
 	
 	// reads the additional fields used to fill the title block
+	context.clear();
 	foreach (QDomElement property, QET::findInDomElement(e, "properties", "property")) {
 		if (!property.hasAttribute("name")) continue;
 		context.addValue(property.attribute("name"), QVariant(property.text()));


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