r21681 by jghali - connect/disconnect signals properly when setting a doc to StoryText
scribus-commit
scribus-commit at lists.scribus.net
Mon Dec 26 19:42:03 UTC 2016
Author: jghali
Date: Mon Dec 26 19:42:02 2016
New Revision: 21681
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21681
Log:
connect/disconnect signals properly when setting a doc to StoryText
Modified:
trunk/Scribus/scribus/text/storytext.cpp
Modified: trunk/Scribus/scribus/text/storytext.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21681&path=/trunk/Scribus/scribus/text/storytext.cpp
==============================================================================
--- trunk/Scribus/scribus/text/storytext.cpp (original)
+++ trunk/Scribus/scribus/text/storytext.cpp Mon Dec 26 19:42:02 2016
@@ -120,7 +120,17 @@
void StoryText::setDoc(ScribusDoc *docin)
{
+ if (m_doc) {
+ m_doc->paragraphStyles().disconnect(this, SLOT(invalidateAll()));
+ m_doc->charStyles().disconnect(this, SLOT(invalidateAll()));
+ }
+
m_doc = docin;
+
+ if (m_doc) {
+ m_doc->paragraphStyles().connect(this, SLOT(invalidateAll()));
+ m_doc->charStyles().connect(this, SLOT(invalidateAll()));
+ }
}
StoryText StoryText::copy() const
More information about the scribus-commit
mailing list