r23643 by jghali - Add clearString() method to Mark class
scribus-commit
scribus-commit at lists.scribus.net
Wed Apr 22 12:42:06 UTC 2020
Author: jghali
Date: Wed Apr 22 12:42:06 2020
New Revision: 23643
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23643
Log:
Add clearString() method to Mark class
Modified:
trunk/Scribus/scribus/gtaction.cpp
trunk/Scribus/scribus/marks.cpp
trunk/Scribus/scribus/marks.h
trunk/Scribus/scribus/scribus.cpp
trunk/Scribus/scribus/scribusdoc.cpp
Modified: trunk/Scribus/scribus/gtaction.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23643&path=/trunk/Scribus/scribus/gtaction.cpp
==============================================================================
--- trunk/Scribus/scribus/gtaction.cpp (original)
+++ trunk/Scribus/scribus/gtaction.cpp Wed Apr 22 12:42:06 2020
@@ -152,7 +152,7 @@
if (m_noteStory->text(m_noteStory->length() -1) == SpecialChars::PARSEP)
m_noteStory->removeChars(m_noteStory->length() -1, 1);
m_note->setSaxedText(saxedText(m_noteStory));
- mrk->setString("");
+ mrk->clearString();
mrk->OwnPage = m_it->OwnPage;
m_it->itemText.insertMark(mrk);
if (UndoManager::undoEnabled())
@@ -298,7 +298,7 @@
mrk->setType(MARKNoteMasterType);
mrk->setNotePtr(m_note);
m_note->setMasterMark(mrk);
- mrk->setString("");
+ mrk->clearString();
mrk->OwnPage = m_it->OwnPage;
m_it->itemText.insertMark(mrk);
story->applyCharStyle(lastStyleStart, story->length()-lastStyleStart, lastStyle);
Modified: trunk/Scribus/scribus/marks.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23643&path=/trunk/Scribus/scribus/marks.cpp
==============================================================================
--- trunk/Scribus/scribus/marks.cpp (original)
+++ trunk/Scribus/scribus/marks.cpp Wed Apr 22 12:42:06 2020
@@ -56,6 +56,11 @@
m_data.strtxt = str;
}
+void Mark::clearString()
+{
+ m_data.strtxt.clear();
+}
+
void Mark::setNotePtr(TextNote* note)
{
m_data.notePtr = note;
@@ -73,7 +78,7 @@
bool Mark::hasMark() const
{
- return m_data.destmarkName != "";
+ 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=23643&path=/trunk/Scribus/scribus/marks.h
==============================================================================
--- trunk/Scribus/scribus/marks.h (original)
+++ trunk/Scribus/scribus/marks.h Wed Apr 22 12:42:06 2020
@@ -81,6 +81,8 @@
bool isNoteType() const;
bool isType(const MarkType t) const;
+ void clearString();
+
virtual ~Mark() {}
protected:
Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23643&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Wed Apr 22 12:42:06 2020
@@ -9594,7 +9594,7 @@
mrk->setType(MARKNoteMasterType);
mrk->setNotePtr(doc->newNote(nStyle));
mrk->getNotePtr()->setMasterMark(mrk);
- mrk->setString("");
+ mrk->clearString();
mrk->OwnPage = currItem->OwnPage;
currItem->itemText.insertMark(mrk);
currItem->invalidateLayout();
@@ -9757,7 +9757,7 @@
if (mrkType == MARKNoteMasterType)
{
mrk->getNotePtr()->setMasterMark(mrk);
- mrk->setString("");
+ mrk->clearString();
}
if (UndoManager::undoEnabled())
Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23643&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Wed Apr 22 12:42:06 2020
@@ -17468,24 +17468,18 @@
}
}
else
- mrk->setString("");
+ mrk->clearString();
}
else if (mrk->isType(MARK2MarkType))
{
QString l;
MarkType t;
mrk->getMark(l, t);
- Mark* destMark = getMark(l,t);
+ Mark* destMark = getMark(l, t);
if (destMark != nullptr)
{
PageItem* dItem = findFirstMarkItem(destMark);
- if (dItem == nullptr)
- {
- destMark->OwnPage = -1;
- mrk->setString("");
- docWasChanged = true;
- }
- else
+ if (dItem != nullptr)
{
destMark->OwnPage = dItem->OwnPage;
mrk->setString(getSectionPageNumberForPageIndex(destMark->OwnPage));
@@ -17495,10 +17489,16 @@
docWasChanged = true;
}
}
+ else
+ {
+ destMark->OwnPage = -1;
+ mrk->clearString();
+ docWasChanged = true;
+ }
}
else
{
- mrk->setString("");
+ mrk->clearString();
docWasChanged = true;
}
}
More information about the scribus-commit
mailing list