r24644 by jghali - Some cleanup for marks.h header
scribus-commit
scribus-commit at lists.scribus.net
Mon May 10 21:47:39 UTC 2021
Author: jghali
Date: Mon May 10 21:47:39 2021
New Revision: 24644
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24644
Log:
Some cleanup for marks.h header
Modified:
trunk/Scribus/scribus/marks.cpp
trunk/Scribus/scribus/marks.h
trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
trunk/Scribus/scribus/scribus.cpp
trunk/Scribus/scribus/scribusdoc.cpp
trunk/Scribus/scribus/text/storytext.cpp
Modified: trunk/Scribus/scribus/marks.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24644&path=/trunk/Scribus/scribus/marks.cpp
==============================================================================
--- trunk/Scribus/scribus/marks.cpp (original)
+++ trunk/Scribus/scribus/marks.cpp Mon May 10 21:47:39 2021
@@ -20,45 +20,35 @@
m_data = d;
}
-void Mark::getMark(QString& l, MarkType& t) const
+void Mark::getDestMark(QString& l, MarkType& t) const
{
- l = m_data.destmarkName;
- t = m_data.destmarkType;
+ l = m_data.destMarkName;
+ t = m_data.destMarkType;
}
-void Mark::setMark(Mark* mP)
+void Mark::setDestMark(Mark* mP)
{
if (mP == nullptr)
{
- m_data.destmarkName.clear();
- m_data.destmarkType = MARKNoType;
+ m_data.destMarkName.clear();
+ m_data.destMarkType = MARKNoType;
}
else
{
- m_data.destmarkName = mP->label;
- m_data.destmarkType = mP->getType();
+ m_data.destMarkName = mP->label;
+ m_data.destMarkType = mP->getType();
}
}
-void Mark::setMark(const QString& l, MarkType t)
+void Mark::setDestMark(const QString& l, MarkType t)
{
- m_data.destmarkName = l;
- m_data.destmarkType = t;
-}
-
-QString Mark::getString() const
-{
- return m_data.strtxt;
-}
-
-void Mark::setString(const QString& str)
-{
- m_data.strtxt = str;
+ m_data.destMarkName = l;
+ m_data.destMarkType = t;
}
void Mark::clearString()
{
- m_data.strtxt.clear();
+ m_data.text.clear();
}
void Mark::setNotePtr(TextNote* note)
@@ -73,12 +63,12 @@
bool Mark::hasString() const
{
- return !m_data.strtxt.isEmpty();
+ return !m_data.text.isEmpty();
}
bool Mark::hasMark() const
{
- return !m_data.destmarkName.isEmpty();
+ return !m_data.destMarkName.isEmpty();
}
bool Mark::isUnique() const
Modified: trunk/Scribus/scribus/marks.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24644&path=/trunk/Scribus/scribus/marks.h
==============================================================================
--- trunk/Scribus/scribus/marks.h (original)
+++ trunk/Scribus/scribus/marks.h Mon May 10 21:47:39 2021
@@ -25,16 +25,14 @@
struct MarkData
{
- QString strtxt;
- PageItem* itemPtr {nullptr};
- QString destmarkName;
- MarkType destmarkType {MARKNoType};
- TextNote* notePtr {nullptr};
- //fields used for resolving to pointers for load and copy
- QString itemName;
- MarkType markType {MARKNoType};
-
MarkData() {}
+
+ QString text;
+ QString itemName;
+ PageItem* itemPtr { nullptr };
+ TextNote* notePtr { nullptr };
+ QString destMarkName;
+ MarkType destMarkType {MARKNoType};
};
class SCRIBUS_API Mark
@@ -42,37 +40,45 @@
friend class ScribusDoc;
friend class ScribusMainWindow;
friend class BulNumMark;
+
//only ScribusDoc && ScribusMainWindow can create and delete marks
private:
Mark() : m_data() {}
Mark(const Mark& other);
public:
+ virtual ~Mark() {}
+
QString label;
int OwnPage {-1};
+ MarkType getType() const { return m_type; }
+ void setType(MarkType t) { m_type = t; }
+
+ const MarkData& getData() const { return m_data; }
+ void setData(const MarkData& d) { m_data = d; }
+
+ PageItem* getItemPtr() const { return m_data.itemPtr; }
+ void setItemPtr( PageItem* ptr ) { m_data.itemPtr = ptr; }
+
+ const QString getItemName() const { return m_data.itemName; }
+ void setItemName( const QString name) { m_data.itemName = name; }
+
+ const QString& getString() const { return m_data.text; }
+ void setString(const QString& str) { m_data.text = str; }
+
+ TextNote* getNotePtr() const { return m_data.notePtr; }
+ void setNotePtr(TextNote *note);
+
void setValues(const QString& l, int p, MarkType t, const MarkData& d);
- MarkType getType() const { return m_type; }
- void setType(MarkType t) { m_type = t; }
- const MarkData getData() const { return m_data; }
- void setData(const MarkData d) { m_data = d; }
- PageItem* getItemPtr() const { return m_data.itemPtr; }
- void setItemPtr( PageItem* ptr ) { m_data.itemPtr = ptr; }
- const QString getItemName() const { return m_data.itemName; }
- void setItemName( const QString name ) { m_data.itemName = name; }
-
//for marks to marks - return label and type of target mark by reference
- void getMark(QString& l, MarkType &t) const;
+ void getDestMark(QString& l, MarkType &t) const;
+ const QString& getDestMarkName() const { return m_data.destMarkName; }
+ MarkType getDestMarkType() const { return m_data.destMarkType; }
//for marks to marks - set label and type of target mark from mark pointer
- void setMark(Mark* mP);
- void setMark(const QString& l, MarkType t);
- MarkType getMarkType() const { return m_data.markType; }
- void setMarkType(MarkType t) { m_data.markType = t; }
- QString getString() const;
- void setString(const QString& str );
- TextNote* getNotePtr() const { return m_data.notePtr; }
- void setNotePtr(TextNote *note);
+ void setDestMark(Mark* mP);
+ void setDestMark(const QString& l, MarkType t);
bool hasItemPtr() const;
bool hasString() const;
@@ -82,8 +88,6 @@
bool isType(const MarkType t) const;
void clearString();
-
- virtual ~Mark() {}
protected:
MarkType m_type {MARKNoType};
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24644&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp Mon May 10 21:47:39 2021
@@ -3933,7 +3933,7 @@
MarkType mark2Type = (MarkType) attrs.valueAsInt("MARKtype");
Mark* mark2 = doc->getMark(mark2Label, mark2Type);
if (mark2 != nullptr) //mark is not defined yet, insert into temp list for update to pointers later
- mark->setMark(mark2);
+ mark->setDestMark(mark2);
else
{
QMap<QString, MarkType> mark2map;
@@ -7482,7 +7482,7 @@
Mark* mark2 = m_Doc->getMark(label2, type2);
if (mark2 != nullptr)
{
- mark->setMark(mark2);
+ mark->setDestMark(mark2);
}
else
{
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24644&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp Mon May 10 21:47:39 2021
@@ -1472,9 +1472,8 @@
docu.writeAttribute("str", mrk->getString());
else if (mrk->isType(MARK2MarkType) && mrk->hasMark())
{
- QString label;
- MarkType type;
- mrk->getMark(label, type);
+ QString label = mrk->getDestMarkName();
+ MarkType type = mrk->getDestMarkType();
docu.writeAttribute("MARKlabel", label);
docu.writeAttribute("MARKtype", type);
}
Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24644&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Mon May 10 21:47:39 2021
@@ -9471,9 +9471,9 @@
Mark* mrk = nullptr;
Mark oldMark;
- MarkData markdata;
+ MarkData markData;
if (currItem != nullptr)
- markdata.itemName = currItem->itemName();
+ markData.itemName = currItem->itemName();
QString label, text;
NotesStyle* NStyle = nullptr;
bool insertExistedMark = false;
@@ -9484,7 +9484,7 @@
insertMDialog->values(label);
if (label.isEmpty())
label = tr("Anchor mark");
- markdata.itemPtr = currItem;
+ markData.itemPtr = currItem;
break;
case MARKVariableTextType:
mrk = insertMDialog->values(label, text);
@@ -9492,27 +9492,27 @@
return false; //FIX ME here user should be warned that inserting of mark fails and why
if (label.isEmpty())
label = tr("Mark with <%1> variable text").arg(text);
- markdata.strtxt = text;
+ markData.text = text;
break;
case MARK2ItemType:
- insertMDialog->values(label, markdata.itemPtr);
- if (markdata.itemPtr == nullptr)
+ insertMDialog->values(label, markData.itemPtr);
+ if (markData.itemPtr == nullptr)
return false; //FIX ME here user should be warned that inserting of mark fails and why
if (label.isEmpty())
- label = tr("Mark to %1 item").arg(markdata.itemPtr->itemName());
- markdata.strtxt = QString::number(markdata.itemPtr->OwnPage +1);
+ label = tr("Mark to %1 item").arg(markData.itemPtr->itemName());
+ markData.text = QString::number(markData.itemPtr->OwnPage +1);
break;
case MARK2MarkType:
//gets pointer to referenced mark
- Mark* mrkPtr;
- insertMDialog->values(label, mrkPtr);
- if (mrkPtr == nullptr)
+ Mark* markPtr;
+ insertMDialog->values(label, markPtr);
+ if (markPtr == nullptr)
return false; //FIX ME here user should be warned that inserting of mark fails and why
if (label.isEmpty())
- label = tr("Mark to %1 mark").arg(mrkPtr->label);
- markdata.strtxt = QString::number(mrkPtr->OwnPage + 1);
- markdata.destmarkName = mrkPtr->label;
- markdata.destmarkType = mrkPtr->getType();
+ label = tr("Mark to %1 mark").arg(markPtr->label);
+ markData.text = QString::number(markPtr->OwnPage + 1);
+ markData.destMarkName = markPtr->label;
+ markData.destMarkType = markPtr->getType();
break;
case MARKNoteMasterType:
//gets pointer to chosen notes style
@@ -9520,7 +9520,7 @@
if (NStyle == nullptr)
return false;
- markdata.notePtr = doc->newNote(NStyle);
+ markData.notePtr = doc->newNote(NStyle);
label = "NoteMark_" + NStyle->name();
if (NStyle->range() == NSRstory)
label += " in " + currItem->firstInChain()->itemName();
@@ -9546,12 +9546,12 @@
else
getUniqueName(label, doc->marksLabelsList(mrkType), "_");
mrk = doc->newMark();
- mrk->setValues(label, currItem->OwnPage, mrkType, markdata);
+ mrk->setValues(label, currItem->OwnPage, mrkType, markData);
}
else
{ // that must be variable text mark
oldMark = *mrk;
- mrk->setString(markdata.strtxt);
+ mrk->setString(markData.text);
mrk->label = label;
insertExistedMark = true;
doc->flag_updateMarksLabels = true;
@@ -9598,9 +9598,8 @@
is->set("strtxt", mrk->getString());
if (mrk->isType(MARK2MarkType))
{
- QString dName;
- MarkType dType;
- mrk->getMark(dName, dType);
+ QString dName = mrk->getDestMarkName();
+ MarkType dType = mrk->getDestMarkType();
is->set("dName", dName);
is->set("dType", (int) dType);
}
@@ -9648,9 +9647,8 @@
case MARK2MarkType:
{
editMDialog = (MarkInsert*) new Mark2Mark(doc->marksList(), mrk, this);
- QString l;
- MarkType t;
- mrk->getMark(l,t);
+ QString l = mrk->getDestMarkName();
+ MarkType t = mrk->getDestMarkType();
Mark* m = doc->getMark(l,t);
editMDialog->setValues(mrk->label, m);
}
@@ -9697,13 +9695,14 @@
editMDialog->setWindowTitle(tr("Edit %1").arg(editMDialog->windowTitle()));
if (editMDialog->exec())
{
- Mark oldMark = *mrk;
- Mark* Mrk = nullptr;
- MarkData markdata;
+ QString label, text;
+ QString oldLabel = mrk->label;
+ MarkData oldData = mrk->getData();
+ QString oldStr = mrk->getString();
+ Mark* diaMark = nullptr;
+ MarkData markData;
if (currItem != nullptr)
- markdata.itemName = currItem->itemName();
- QString label, text;
- QString oldStr = mrk->getString();
+ markData.itemName = currItem->itemName();
bool newMark = false;
bool replaceMark = false;
switch (mrk->getType())
@@ -9715,29 +9714,30 @@
label = tr("Anchor mark");
if (mrk->label != label)
{
- getUniqueName(label,doc->marksLabelsList(mrk->getType()), "_"); //FIX ME here user should be warned that inserted mark`s label was changed
+ getUniqueName(label, doc->marksLabelsList(mrk->getType()), "_"); //FIX ME here user should be warned that inserted mark`s label was changed
mrk->label = label;
emit UpdateRequest(reqMarksUpdate);
}
break;
case MARKVariableTextType:
- Mrk = editMDialog->values(label, text);
+ diaMark = editMDialog->values(label, text);
if (text.isEmpty())
return false; //FIX ME here user should be warned that editing of mark fails and why
if (label.isEmpty())
label = tr("Mark with <%1> variable text").arg(text);
- if (Mrk != nullptr)
+ if (diaMark != nullptr)
{
- if (Mrk != mrk)
+ if (diaMark != mrk)
{
- currItem->itemText.replaceMark(currItem->itemText.cursorPosition(), Mrk);
- mrk = Mrk;
- oldMark = *mrk;
+ currItem->itemText.replaceMark(currItem->itemText.cursorPosition(), diaMark);
+ mrk = diaMark;
+ oldLabel = mrk->label;
+ oldData = mrk->getData();
replaceMark = true;
}
if (mrk->label != label)
{
- getUniqueName(label,doc->marksLabelsList(mrk->getType()), "_"); //FIX ME here user should be warned that inserted mark`s label was changed
+ getUniqueName(label, doc->marksLabelsList(mrk->getType()), "_"); //FIX ME here user should be warned that inserted mark`s label was changed
mrk->label = label;
emit UpdateRequest(reqMarksUpdate);
}
@@ -9749,48 +9749,48 @@
}
else
{
- markdata.strtxt = text;
+ markData.text = text;
mrk = doc->newMark();
- getUniqueName(label,doc->marksLabelsList(mrk->getType()), "_"); //FIX ME here user should be warned that inserted mark`s label was changed
- mrk->setValues(label, currItem->OwnPage, MARKVariableTextType, markdata);
+ getUniqueName(label, doc->marksLabelsList(mrk->getType()), "_"); //FIX ME here user should be warned that inserted mark`s label was changed
+ mrk->setValues(label, currItem->OwnPage, MARKVariableTextType, markData);
currItem->itemText.replaceMark(currItem->itemText.cursorPosition(), mrk);
docWasChanged = true;
newMark = true;
}
break;
case MARK2ItemType:
- editMDialog->values(label, markdata.itemPtr);
- if (markdata.itemPtr == nullptr)
+ editMDialog->values(label, markData.itemPtr);
+ if (markData.itemPtr == nullptr)
return false; //FIX ME here user should be warned that inserting of mark fails and why
if (label.isEmpty())
- label = tr("Mark to %1 item").arg(markdata.itemPtr->itemName());
- if (markdata.itemPtr != mrk->getItemPtr())
+ label = tr("Mark to %1 item").arg(markData.itemPtr->itemName());
+ if (markData.itemPtr != mrk->getItemPtr())
{
- mrk->setItemPtr(markdata.itemPtr);
- mrk->setString(doc->getSectionPageNumberForPageIndex(markdata.itemPtr->OwnPage));
+ mrk->setItemPtr(markData.itemPtr);
+ mrk->setString(doc->getSectionPageNumberForPageIndex(markData.itemPtr->OwnPage));
docWasChanged = true;
}
if (mrk->label != label)
{
- getUniqueName(label,doc->marksLabelsList(mrk->getType()), "_"); //FIX ME here user should be warned that inserted mark`s label was changed
+ getUniqueName(label, doc->marksLabelsList(mrk->getType()), "_"); //FIX ME here user should be warned that inserted mark`s label was changed
mrk->label = label;
}
break;
case MARK2MarkType:
{
//gets pointer to referenced mark
- Mark* mrkPtr = nullptr;
- editMDialog->values(label, mrkPtr);
- if (mrkPtr == nullptr)
+ Mark* markPtr = nullptr;
+ editMDialog->values(label, markPtr);
+ if (markPtr == nullptr)
return false; //FIX ME here user should be warned that inserting of mark fails and why
if (label.isEmpty())
- label = tr("Mark to %1 mark").arg(mrkPtr->label);
- QString destLabel = mrkPtr->label;
- MarkType destType = mrkPtr->getType();
- if (markdata.destmarkName != destLabel || markdata.destmarkType != destType)
+ label = tr("Mark to %1 mark").arg(markPtr->label);
+ QString destLabel = markPtr->label;
+ MarkType destType = markPtr->getType();
+ if (markData.destMarkName != destLabel || markData.destMarkType != destType)
{
- mrk->setMark(mrkPtr);
- mrk->setString(doc->getSectionPageNumberForPageIndex(mrkPtr->OwnPage));
+ mrk->setDestMark(markPtr);
+ mrk->setString(doc->getSectionPageNumberForPageIndex(markPtr->OwnPage));
docWasChanged = true;
}
if (mrk->label != label)
@@ -9831,9 +9831,8 @@
is->set("MARK", QString("new"));
if (mrk->isType(MARK2MarkType))
{
- QString dName;
- MarkType dType;
- mrk->getMark(dName, dType);
+ QString dName = mrk->getDestMarkName();
+ MarkType dType = mrk->getDestMarkType();
is->set("dName", dName);
is->set("dType", (int) dType);
}
@@ -9849,36 +9848,32 @@
is->set("MARK", QString("replace"));
else
is->set("MARK", QString("edit"));
- if (mrk->label != oldMark.label)
+ if (mrk->label != oldLabel)
{
- is->set("labelOLD", oldMark.label);
+ is->set("labelOLD", oldLabel);
is->set("labelNEW", mrk->label);
doc->flag_updateMarksLabels = true;
}
- if (mrk->getString() != oldMark.getString())
+ if (mrk->getString() != oldData.text)
{
- is->set("strtxtOLD", oldMark.getString());
+ is->set("strtxtOLD", oldData.text);
is->set("strtxtNEW", mrk->getString());
}
if (mrk->isType(MARK2MarkType))
{
- QString dNameOLD;
- MarkType dTypeOLD;
- oldMark.getMark(dNameOLD, dTypeOLD);
- QString dName;
- MarkType dType;
- mrk->getMark(dName, dType);
- if (dName != dNameOLD || dType != dTypeOLD)
+ QString dName = mrk->getDestMarkName();
+ MarkType dType = mrk->getDestMarkType();
+ if (dName != oldData.destMarkName || dType != oldData.destMarkType)
{
- is->set("dNameOLD", dNameOLD);
- is->set("dTypeOLD", (int) dTypeOLD);
+ is->set("dNameOLD", oldData.destMarkName);
+ is->set("dTypeOLD", (int) oldData.destMarkType);
is->set("dNameNEW", dName);
is->set("dTypeNEW", (int) dType);
}
}
- if (mrk->isType(MARK2ItemType) && mrk->getItemPtr() != oldMark.getItemPtr())
+ if (mrk->isType(MARK2ItemType) && mrk->getItemPtr() != oldData.itemPtr)
{
- is->insertItem("itemPtrOLD", oldMark.getItemPtr());
+ is->insertItem("itemPtrOLD", oldData.itemPtr);
is->insertItem("itemPtrNEW", mrk->getItemPtr());
}
}
Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24644&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Mon May 10 21:47:39 2021
@@ -1964,7 +1964,7 @@
invalidateVariableTextFrames(mrk, false);
}
if (is->contains("dNameOLD"))
- mrk->setMark(is->get("dNameOLD"), (MarkType) is->getInt("dTypeOLD"));
+ mrk->setDestMark(is->get("dNameOLD"), (MarkType) is->getInt("dTypeOLD"));
if (is->getItem("itemPtrOLD") != nullptr)
mrk->setItemPtr((PageItem*) is->getItem("itemPtrOLD"));
}
@@ -1996,7 +1996,7 @@
invalidateVariableTextFrames(mrk, false);
}
if (is->contains("dName"))
- mrk->setMark(is->get("dName"), (MarkType) is->getInt("dType"));
+ mrk->setDestMark(is->get("dName"), (MarkType) is->getInt("dType"));
if (is->getItem("itemPtr") != nullptr)
mrk->setItemPtr((PageItem*) is->getItem("itemPtr"));
}
@@ -2050,7 +2050,7 @@
if (is->contains("strtxt"))
mrk->setString(is->get("strtxt"));
if (is->contains("dName"))
- mrk->setMark(is->get("dName"), (MarkType) is->getInt("dType"));
+ mrk->setDestMark(is->get("dName"), (MarkType) is->getInt("dType"));
if (is->getItem("itemPtr") != nullptr)
mrk->setItemPtr((PageItem*) is->getItem("itemPtr"));
if (mrk->isType(MARKNoteMasterType))
@@ -2087,7 +2087,7 @@
invalidateVariableTextFrames(mrk, false);
}
if (is->contains("dNameNEW"))
- mrk->setMark(is->get("dNameNEW"), (MarkType) is->getInt("dTypeNEW"));
+ mrk->setDestMark(is->get("dNameNEW"), (MarkType) is->getInt("dTypeNEW"));
if (is->getItem("itemPtrNEW") != nullptr)
mrk->setItemPtr((PageItem*) is->getItem("itemPtrNEW"));
}
@@ -17005,9 +17005,8 @@
continue;
if (m->isType(MARK2MarkType))
{
- QString l;
- MarkType t;
- m->getMark(l, t);
+ QString l = m->getDestMarkName();
+ MarkType t = m->getDestMarkType();
if (mrk == getMark(l, t))
{
setUndoDelMark(m);
@@ -17042,9 +17041,8 @@
ims->set("at", findMarkCPos(mrk, master));
if (mrk->isType(MARK2MarkType))
{
- QString dName;
- MarkType dType;
- mrk->getMark(dName, dType);
+ QString dName = mrk->getDestMarkName();
+ MarkType dType = mrk->getDestMarkType();
ims->set("dName", dName);
ims->set("dType", (int) dType);
}
@@ -17200,9 +17198,8 @@
}
else if (mrk->isType(MARK2MarkType))
{
- QString l;
- MarkType t;
- mrk->getMark(l, t);
+ QString l = mrk->getDestMarkName();
+ MarkType t = mrk->getDestMarkType();
Mark* destMark = getMark(l, t);
if (destMark != nullptr)
{
Modified: trunk/Scribus/scribus/text/storytext.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24644&path=/trunk/Scribus/scribus/text/storytext.cpp
==============================================================================
--- trunk/Scribus/scribus/text/storytext.cpp (original)
+++ trunk/Scribus/scribus/text/storytext.cpp Mon May 10 21:47:39 2021
@@ -2278,10 +2278,9 @@
mark_attr.insert("item", mrk->getItemPtr()->itemName());
else if (mrk->isType(MARK2MarkType))
{
- QString l;
- MarkType t;
- mrk->getMark(l, t);
- if (m_doc->getMark(l,t) != nullptr)
+ QString l = mrk->getDestMarkName();
+ MarkType t = mrk->getDestMarkType();
+ if (m_doc->getMark(l, t) != nullptr)
{
mark_attr.insert("mark_l", l);
mark_attr.insert("mark_t", QString::number((int) t));
@@ -2560,7 +2559,7 @@
if (mrk->isType(MARK2MarkType) && (m_lIt != attr.end()) && (m_tIt != attr.end()))
{
Mark* targetMark = doc->getMark(Xml_data(m_lIt), (MarkType) parseInt(Xml_data(m_tIt)));
- mrk->setMark(targetMark);
+ mrk->setDestMark(targetMark);
if (targetMark == nullptr)
mrk->setString("0");
else
More information about the scribus-commit
mailing list