r22284 by jghali -
scribus-commit
scribus-commit at lists.scribus.net
Thu Dec 28 00:10:37 UTC 2017
Author: jghali
Date: Thu Dec 28 00:10:37 2017
New Revision: 22284
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22284
Log:
fix undo issue occurring when linking empty frame to an already filled text chain
Modified:
trunk/Scribus/scribus/pageitem.cpp
Modified: trunk/Scribus/scribus/pageitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22284&path=/trunk/Scribus/scribus/pageitem.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem.cpp (original)
+++ trunk/Scribus/scribus/pageitem.cpp Thu Dec 28 00:10:37 2017
@@ -7243,20 +7243,21 @@
//restore properly text if frame was linked at beginning of chain
ScItemState<QPair<PageItem*, PageItem*> > *is = dynamic_cast<ScItemState<QPair<PageItem*, PageItem*> >*>(state);
int joinPos = is->getInt("JOIN_POS");
- int ParSep = is->getBool("ADDPARSEP")?1:0;
+ int parSep = is->getBool("ADDPARSEP") ? 1 : 0;
if (is->getBool("FIRST"))
{
if (joinPos == 0)
{
is->getItem().second->itemText.append(itemText);
- itemText = StoryText(m_Doc);
+ itemText.select(0, itemText.length());
+ itemText.removeSelection();
}
else
{
StoryText content(m_Doc);
- itemText.select(joinPos + ParSep, itemText.length() - (joinPos + ParSep));
+ itemText.select(joinPos + parSep, itemText.length() - (joinPos + parSep));
content.insert(0, itemText, true);
- if (ParSep)
+ if (parSep)
itemText.select(joinPos, itemText.length() - joinPos);
itemText.removeSelection();
is->getItem().second->itemText.append(content);
@@ -7266,9 +7267,9 @@
{
StoryText content(m_Doc);
PageItem* prev = is->getItem().second;
- prev->itemText.select(joinPos + ParSep, prev->itemText.length() - (joinPos + ParSep));
+ prev->itemText.select(joinPos + parSep, prev->itemText.length() - (joinPos + parSep));
content.insert(0, prev->itemText, true);
- if (ParSep)
+ if (parSep)
prev->itemText.select(joinPos, prev->itemText.length() - joinPos);
prev->itemText.removeSelection();
itemText.append(content);
More information about the scribus-commit
mailing list