Author: jghali
Date: Wed Apr 1 16:42:01 2020
New Revision: 23553
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23553
Log:
#16082: Text undo crash
Modified:
trunk/Scribus/scribus/pageitem_textframe.cpp
trunk/Scribus/scribus/scribus.cpp
Modified: trunk/Scribus/scribus/pageitem_textframe.cpp
URL:
http://scribus.net/websvn/diff.php?repname=Scribus&rev=23553&path=/trunk/Scribus/scribus/pageitem_textframe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_textframe.cpp (original)
+++ trunk/Scribus/scribus/pageitem_textframe.cpp Wed Apr 1 16:42:01 2020
@@ -3954,10 +3954,10 @@
}
undoManager->action(undoTarget,
ip);
}
- else if (ss && ss->get("ETEA") ==
"insert_frametext")
+ else if (ss && (ss->get("ETEA") ==
"insert_frametext") && (ss->undoObject() == undoTarget))
ss->set("TEXT_STR",
ss->get("TEXT_STR") + QString(QChar(conv)));
else {
- ss = new
SimpleState(Um::InsertText,"",Um::ICreate);
+ ss = new
SimpleState(Um::InsertText, "", Um::ICreate);
ss->set("INSERT_FRAMETEXT");
ss->set("ETEA",
QString("insert_frametext"));
ss->set("TEXT_STR",
QString(QChar(conv)));
@@ -4400,11 +4400,12 @@
if (UndoManager::undoEnabled())
{
SimpleState *ss =
dynamic_cast<SimpleState*>(undoManager->getLastUndo());
- if (ss && ss->get("ETEA") == "insert_frametext")
- ss->set("TEXT_STR",ss->get("TEXT_STR")
+ QString(SpecialChars::TAB));
+ UndoObject *undoTarget = this;
+ if (ss && (ss->get("ETEA") ==
"insert_frametext") && (ss->undoObject() == undoTarget))
+ ss->set("TEXT_STR", ss->get("TEXT_STR")
+ QString(SpecialChars::TAB));
else
{
- ss = new
SimpleState(Um::InsertText,"",Um::ICreate);
+ ss = new SimpleState(Um::InsertText,
"", Um::ICreate);
ss->set("INSERT_FRAMETEXT");
ss->set("ETEA",
QString("insert_frametext"));
ss->set("TEXT_STR",
QString(SpecialChars::TAB));
@@ -4445,7 +4446,7 @@
}
undoManager->action(undoTarget, ip);
}
- else if (ss && ss->get("ETEA") ==
"insert_frametext")
+ else if (ss && (ss->get("ETEA") ==
"insert_frametext") && (ss->undoObject() == undoTarget))
ss->set("TEXT_STR", ss->get("TEXT_STR")
+ uc);
else
{
Modified: trunk/Scribus/scribus/scribus.cpp
URL:
http://scribus.net/websvn/diff.php?repname=Scribus&rev=23553&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Wed Apr 1 16:42:01 2020
@@ -1536,8 +1536,9 @@
if (UndoManager::undoEnabled())
{
SimpleState *ss =
dynamic_cast<SimpleState*>(m_undoManager->getLastUndo());
- if (ss && ss->get("ETEA") == "insert_frametext")
- ss->set("TEXT_STR",ss->get("TEXT_STR") +
QString(QChar(unicodevalue)));
+ UndoObject *undoTarget = currItem;
+ if (ss && (ss->get("ETEA") == "insert_frametext") &&
(ss->undoObject() == undoTarget))
+ ss->set("TEXT_STR", ss->get("TEXT_STR") +
QString(QChar(unicodevalue)));
else
{
ss = new
SimpleState(Um::InsertText,"",Um::ICreate);
@@ -1545,7 +1546,6 @@
ss->set("ETEA", QString("insert_frametext"));
ss->set("TEXT_STR",
QString(QChar(unicodevalue)));
ss->set("START",
currItem->itemText.cursorPosition());
- UndoObject * undoTarget = currItem;
if (currItem->isNoteFrame())
{
undoTarget = doc;
@@ -1572,8 +1572,9 @@
if (UndoManager::undoEnabled())
{
SimpleState *ss =
dynamic_cast<SimpleState*>(m_undoManager->getLastUndo());
- if (ss && ss->get("ETEA") == "insert_frametext")
- ss->set("TEXT_STR",ss->get("TEXT_STR") +
QString(SpecialChars::SHYPHEN));
+ UndoObject *undoTarget = currItem;
+ if (ss && (ss->get("ETEA") == "insert_frametext") &&
(ss->undoObject() == undoTarget))
+ ss->set("TEXT_STR", ss->get("TEXT_STR") +
QString(SpecialChars::SHYPHEN));
else
{
ss = new SimpleState(Um::InsertText,"",
Um::ICreate);
@@ -1581,7 +1582,6 @@
ss->set("ETEA", QString("insert_frametext"));
ss->set("TEXT_STR",
QString(SpecialChars::SHYPHEN));
ss->set("START",
currItem->itemText.cursorPosition());
- UndoObject * undoTarget = currItem;
if (currItem->isNoteFrame())
{
undoTarget = doc;
_______________________________________________
scribus-commit mailing list
[email protected]
http://lists.scribus.net/mailman/listinfo/scribus-commit