r19400 by jghali - #12583: scripter's insertChar() should respect the surrounding formatting

scribus-commit scribus-commit at lists.scribus.net
Sat Aug 2 23:26:31 UTC 2014


Author: jghali
Date: Sat Aug  2 23:26:30 2014
New Revision: 19400

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19400
Log:
#12583: scripter's insertChar() should respect the surrounding formatting

Modified:
    trunk/Scribus/scribus/plugins/scriptplugin/cmdtext.cpp

Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmdtext.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19400&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmdtext.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmdtext.cpp (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmdtext.cpp Sat Aug  2 23:26:30 2014
@@ -320,9 +320,9 @@
 		PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot insert text into non-text frame.","python error").toLocal8Bit().constData());
 		return NULL;
 	}
-	QString Daten = QString::fromUtf8(Text);
-	Daten.replace("\r\n", SpecialChars::PARSEP);
-	Daten.replace(QChar('\n') , SpecialChars::PARSEP);
+	QString textData = QString::fromUtf8(Text);
+	textData.replace("\r\n", SpecialChars::PARSEP);
+	textData.replace(QChar('\n') , SpecialChars::PARSEP);
 	PyMem_Free(Text);
 	if ((pos < -1) || (pos > static_cast<int>(it->itemText.length())))
 	{
@@ -331,15 +331,13 @@
 	}
 	if (pos == -1)
 		pos = it->itemText.length();
-	it->itemText.insertChars(pos, Daten);
+	it->itemText.insertChars(pos, textData, true);
 	it->Dirty = true;
 	if (ScCore->primaryMainWindow()->doc->DoDrawing)
 	{
-// FIXME adapt to Qt-4 painting style
+		// FIXME adapt to Qt-4 painting style
 		it->Dirty = false;
 	}
-//	Py_INCREF(Py_None);
-//	return Py_None;
 	Py_RETURN_NONE;
 }
 




More information about the scribus-commit mailing list