/trunk/Scribus/Scribus.pro |
---|
229,6 → 229,7 |
scribus/tablehandle.h \ |
scribus/tablepainter.h \ |
scribus/tableutils.h \ |
scribus/textnote.h \ |
scribus/textwriter.h \ |
scribus/tocgenerator.h \ |
scribus/transaction.h \ |
1348,6 → 1349,7 |
scribus/tableborder.cpp \ |
scribus/tablecell.cpp \ |
scribus/tableutils.cpp \ |
scribus/textnote.cpp \ |
scribus/textwriter.cpp \ |
scribus/tocgenerator.cpp \ |
scribus/transaction.cpp \ |
/trunk/Scribus/scribus/CMakeLists.txt |
---|
264,6 → 264,7 |
tableborder.cpp |
tablecell.cpp |
tableutils.cpp |
textnote.cpp |
textwriter.cpp |
tocgenerator.cpp |
transaction.cpp |
/trunk/Scribus/scribus/gtaction.cpp |
---|
46,6 → 46,7 |
#include "sccolorengine.h" |
#include "scribusdoc.h" |
#include "scribus.h" |
#include "textnote.h" |
#include "undomanager.h" |
#include "util.h" |
#include "util_text.h" |
52,22 → 53,14 |
#include "ui/contentpalette.h" |
#include "ui/missing.h" |
gtAction::gtAction(bool append, PageItem* pageitem) : |
m_prefsManager(PrefsManager::instance()) |
{ m_textFrame = pageitem; |
m_ScMW=m_textFrame->doc()->scMW(); |
gtAction::gtAction(bool append, PageItem* pageitem) |
: m_prefsManager(PrefsManager::instance()) |
{ |
m_textFrame = pageitem; |
m_ScMW = m_textFrame->doc()->scMW(); |
m_it = m_textFrame; |
m_lastParagraphStyle = -1; |
m_inPara = false; |
m_isFirstWrite = true; |
m_lastCharWasLineChange = false; |
m_currentFrameStyle = ""; |
m_doAppend = append; |
m_updateParagraphStyles = false; |
m_overridePStyleFont = true; |
m_undoManager = UndoManager::instance(); |
m_noteStory = nullptr; |
m_note = nullptr; |
} |
void gtAction::setProgressInfo() |
/trunk/Scribus/scribus/gtaction.h |
---|
59,7 → 59,6 |
gtAction(bool append, PageItem *pageitem); |
~gtAction(); |
void setTextFrame(PageItem* frame); |
void setProgressInfo(); |
void setProgressInfoDone(); |
void setInfo(const QString& infoText); |
84,23 → 83,27 |
void setOverridePStyleFont(bool newOPSF); |
private: |
UndoManager* m_undoManager; |
ScribusMainWindow* m_ScMW; |
PageItem *m_textFrame; |
PageItem *m_it; |
int m_lastParagraphStyle; |
bool m_inPara; |
bool m_isFirstWrite; |
PrefsManager& m_prefsManager; |
UndoManager* m_undoManager { nullptr }; |
ScribusMainWindow* m_ScMW { nullptr }; |
PageItem *m_textFrame { nullptr }; |
PageItem *m_it { nullptr }; |
int m_lastParagraphStyle { -1 }; |
bool m_inPara { false }; |
bool m_isFirstWrite { true }; |
bool m_doAppend; |
bool m_lastCharWasLineChange; |
bool m_updateParagraphStyles; |
bool m_lastCharWasLineChange { false }; |
bool m_updateParagraphStyles { false }; |
/* If paragraph style is used should the font style of the gtpstyle be used |
or should writer respect the font set in the real paragraph style |
*/ |
bool m_overridePStyleFont; |
bool m_overridePStyleFont { true }; |
QString m_currentFrameStyle; |
FontFamilyMap m_families; |
StoryText* m_noteStory { nullptr }; |
TextNote* m_note { nullptr }; |
int findParagraphStyle(const QString& name); |
int findParagraphStyle(gtParagraphStyle* pstyle); |
int applyParagraphStyle(gtParagraphStyle* pstyle); |
109,10 → 112,7 |
QString findFontName(gtFont* font); |
void updateParagraphStyle(int pstyleIndex, gtParagraphStyle* pstyle); |
QString parseColor(const QString &s); |
void finalize(); |
PrefsManager& m_prefsManager; |
StoryText* m_noteStory; |
TextNote* m_note; |
void finalize(); |
}; |
#endif |
/trunk/Scribus/scribus/notesstyles.cpp |
---|
2,28 → 2,30 |
#include "marks.h" |
#include "util.h" |
void NotesStyle::setEndNotes(bool setendnotes) |
void NotesStyle::setEndNotes(bool isEndnoteStyle) |
{ |
if (m_endNotesStyle != setendnotes) |
if (m_endNotesStyle != isEndnoteStyle) |
{ |
m_endNotesStyle = setendnotes; |
m_endNotesStyle = isEndnoteStyle; |
} |
} |
bool NotesStyle::operator!=(const NotesStyle& n2) |
bool NotesStyle::operator!=(const NotesStyle& n2) const |
{ |
return ((m_nameStr != n2.m_nameStr) || (m_startNum != n2.m_startNum) || (m_endNotesStyle != n2.m_endNotesStyle) || |
(getType() != static_cast<NotesStyle>(n2).getType()) || (m_numRange != n2.m_numRange) || |
(m_prefixStr != n2.m_prefixStr) || (m_suffixStr != n2.m_suffixStr) || |
(m_autoNotesHeight != n2.m_autoNotesHeight) || (m_autoNotesWidth != n2.m_autoNotesWidth) || |
(m_autoRemoveEmptyNotesFrames != n2.m_autoRemoveEmptyNotesFrames) || (m_autoWeldNotesFrames != n2.m_autoWeldNotesFrames) || |
(m_superscriptInMaster != n2.m_superscriptInMaster) || (m_superscriptInNote != n2.m_superscriptInNote) || |
(m_marksCharStyle != n2.m_marksCharStyle) || (m_notesParaStyle != n2.m_notesParaStyle) |
return ((m_nameStr != n2.m_nameStr) || |
(m_startNum != n2.m_startNum) || |
(m_endNotesStyle != n2.m_endNotesStyle) || |
(getType() != static_cast<NotesStyle>(n2).getType()) || |
(m_numRange != n2.m_numRange) || |
(m_prefixStr != n2.m_prefixStr) || |
(m_suffixStr != n2.m_suffixStr) || |
(m_autoNotesHeight != n2.m_autoNotesHeight) || |
(m_autoNotesWidth != n2.m_autoNotesWidth) || |
(m_autoRemoveEmptyNotesFrames != n2.m_autoRemoveEmptyNotesFrames) || |
(m_autoWeldNotesFrames != n2.m_autoWeldNotesFrames) || |
(m_superscriptInMaster != n2.m_superscriptInMaster) || |
(m_superscriptInNote != n2.m_superscriptInNote) || |
(m_marksCharStyle != n2.m_marksCharStyle) || |
(m_notesParaStyle != n2.m_notesParaStyle) |
); |
} |
QString TextNote::numString() |
{ |
return notesStyle()->numString(m_number); |
} |
/trunk/Scribus/scribus/notesstyles.h |
---|
5,6 → 5,7 |
#include <QObject> |
#include <QString> |
#include <QList> |
#include "numeration.h" |
#include "pagestructs.h" |
#include "scpage.h" |
30,24 → 31,30 |
public: |
NotesStyle() {} |
~NotesStyle() {} |
bool operator!=(const NotesStyle& n2); |
QString name() const { return m_nameStr; } |
bool operator!=(const NotesStyle& n2) const; |
const QString& name() const { return m_nameStr; } |
void setName(const QString& s) { m_nameStr = s; } |
int start() const { return m_startNum; } |
void setStart(const int i) { m_startNum = i; } |
void setStart(int i) { m_startNum = i; } |
void setRange(NumerationRange ns) { m_numRange = ns; } |
const NumerationRange& range() const { return m_numRange; } |
QString prefix() const { return m_prefixStr; } |
const QString& prefix() const { return m_prefixStr; } |
void setPrefix (const QString& str) { m_prefixStr = str; } |
QString suffix() const { return m_suffixStr; } |
const QString& suffix() const { return m_suffixStr; } |
void setSuffix (const QString& str) { m_suffixStr = str; } |
QString numString(const int num) const { return m_numeration.numString(num); } |
void setType(const NumFormat type) { m_numeration.numFormat = type; } |
QString numString(int num) const { return m_numeration.numString(num); } |
void setType(NumFormat type) { m_numeration.numFormat = type; } |
const NumFormat& getType() const { return m_numeration.numFormat; } |
bool isEndNotes() const { return m_endNotesStyle; } |
void setEndNotes(bool isEndnoteStyle); |
bool isAutoNotesHeight() const { return m_autoNotesHeight; } |
void setAutoNotesHeight(bool set) { m_autoNotesHeight = set; } |
bool isAutoNotesWidth() const { return m_autoNotesWidth; } |
60,13 → 67,11 |
void setSuperscriptInNote(bool set) { m_superscriptInNote = set; } |
bool isSuperscriptInMaster() const { return m_superscriptInMaster; } |
void setSuperscriptInMaster(bool set) { m_superscriptInMaster = set; } |
const QString marksChStyle() const { return m_marksCharStyle; } |
const QString& marksChStyle() const { return m_marksCharStyle; } |
void setMarksCharStyle(const QString& styleName) { m_marksCharStyle = styleName; } |
const QString notesParStyle() const { return m_notesParaStyle; } |
const QString& notesParStyle() const { return m_notesParaStyle; } |
void setNotesParStyle(const QString& styleName) { m_notesParaStyle = styleName; } |
void setEndNotes(bool); |
private: |
QString m_nameStr {"Default"}; //unique name of notes style |
int m_startNum {1}; //numeration starts with that number |
86,37 → 91,5 |
QString m_notesParaStyle; |
}; |
class SCRIBUS_API TextNote : public QObject |
{ |
Q_OBJECT |
friend class ScribusDoc; |
private: |
//only ScribusDoc can create and delete notes |
TextNote(NotesStyle *nStyle) : m_notesStyle(nStyle) { } |
~TextNote() {} |
public: |
void setNotesStyle (NotesStyle* ns) { m_notesStyle = ns; } |
NotesStyle* notesStyle() { return m_notesStyle; } |
int num() { return m_number; } |
void setNum(const int i) { m_number = i; } |
QString numString(); |
Mark* masterMark() { return m_noteMasterMark; } |
void setMasterMark(Mark* m) { m_noteMasterMark = m; } |
Mark* noteMark() { return m_noteFrameMark; } |
void setNoteMark(Mark* m) { m_noteFrameMark = m; } |
const QString saxedText() { return m_noteSaxedText; } |
void setSaxedText(const QString& string) { m_noteSaxedText = string; } |
void clearSaxedText() { m_noteSaxedText.clear(); textLen = 0; } |
bool isEndNote() { return m_notesStyle->isEndNotes(); } |
int textLen {0}; |
protected: |
NotesStyle *m_notesStyle {nullptr}; |
QString m_noteSaxedText; |
Mark *m_noteMasterMark {nullptr}; |
Mark *m_noteFrameMark {nullptr}; |
int m_number {0}; |
}; |
#endif // NOTESSTYLES_H |
/trunk/Scribus/scribus/pageitem_noteframe.cpp |
---|
8,6 → 8,7 |
#include "pageitem_textframe.h" |
#include "scribusdoc.h" |
#include "textnote.h" |
#include "undomanager.h" |
#include "util.h" |
#include "util_text.h" |
319,42 → 320,38 |
int pos = 0; |
int startPos = 0; |
TextNote *note = nullptr; |
Mark* prevMrk = nullptr; |
Mark* prevMark = nullptr; |
while (pos < itemText.length()) |
{ |
if (itemText.hasMark(pos)) |
if (itemText.hasMark(pos, MARKNoteFrameType)) |
{ |
Mark* mark = itemText.mark(pos); |
if (mark->isType(MARKNoteFrameType)) |
if (prevMark != nullptr) |
{ |
if (prevMrk != nullptr) |
note = prevMark->getNotePtr(); |
if (note != nullptr) |
{ |
note = prevMrk->getNotePtr(); |
if (note != nullptr) |
int offset = 0; |
if (itemText.text(pos - 1) == SpecialChars::PARSEP) |
++offset; |
int len = pos - startPos -offset; |
if (len <= 0) |
note->clearSaxedText(); |
else |
{ |
int offset = 0; |
if (itemText.text(pos-1) == SpecialChars::PARSEP) |
++offset; |
int len = pos - startPos -offset; |
if (len <= 0) |
note->clearSaxedText(); |
else |
{ |
note->setSaxedText(getItemTextSaxed(startPos, len)); |
note->textLen = len; |
} |
itemText.deselectAll(); |
note->setSaxedText(getItemTextSaxed(startPos, len)); |
note->textLen = len; |
} |
itemText.deselectAll(); |
} |
prevMrk = mark; |
startPos = pos +1; |
} |
prevMark = itemText.mark(pos); |
startPos = pos + 1; |
} |
++pos; |
} |
if (prevMrk != nullptr) |
if (prevMark != nullptr) |
{ |
note = prevMrk->getNotePtr(); |
note = prevMark->getNotePtr(); |
Q_ASSERT(note != nullptr); |
if (startPos != pos) |
{ |
416,20 → 413,3 |
weldList.clear(); |
} |
} |
int PageItem_NoteFrame::findNoteCpos(TextNote* note) |
{ |
//find position of note in note`s frame |
if (itemText.length() == 0) |
return -1; |
for (int pos=0; pos < itemText.length(); ++pos) |
{ |
Mark* mark = itemText.mark(pos); |
if (itemText.hasMark(pos) && mark->isType(MARKNoteFrameType)) |
{ |
if (mark->getNotePtr() == note) |
return (pos); |
} |
} |
return -1; |
} |
/trunk/Scribus/scribus/pageitem_noteframe.h |
---|
67,11 → 67,6 |
//insert note at end of text in noteframe |
void insertNote(TextNote* note); |
//not used??? |
//find position of note marker in text |
int findNoteCpos(TextNote* note); |
}; |
#endif // PAGEITEM_NOTEFRAME_H |
/trunk/Scribus/scribus/pageitem_textframe.cpp |
---|
60,6 → 60,7 |
#include "text/textshaper.h" |
#include "text/shapedtext.h" |
#include "text/shapedtextfeed.h" |
#include "textnote.h" |
#include "ui/guidemanager.h" |
#include "ui/marksmanager.h" |
#include "undomanager.h" |
5594,7 → 5595,7 |
else |
return nullptr; |
} |
MarkType typ = isNoteFrame()? MARKNoteFrameType : MARKNoteMasterType; |
MarkType typ = isNoteFrame() ? MARKNoteFrameType : MARKNoteMasterType; |
for (int pos = start; pos < stop; ++pos) |
{ |
if (itemText.hasMark(pos) && itemText.mark(pos)->isType(typ)) |
/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp |
---|
45,6 → 45,7 |
#include "scribusdoc.h" |
#include "sctextstream.h" |
#include "scxmlstreamreader.h" |
#include "textnote.h" |
#include "undomanager.h" |
#include "ui/missing.h" |
#include "units.h" |
/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp |
---|
10,17 → 10,16 |
#include <ctime> |
#include <memory> |
#include <QCursor> |
#include <QFileInfo> |
#include <QList> |
#include <QDataStream> |
#include <QScopedPointer> |
#include "../../formatidlist.h" |
#include "api/api_application.h" |
#include "commonstrings.h" |
#include "ui/missing.h" |
#include "prefsmanager.h" |
#include "qtiocompressor.h" |
#include "resourcecollection.h" |
#include "scconfig.h" |
#include "scpaths.h" |
#include "scpattern.h" |
#include "scribusdoc.h" |
#include "scribusview.h" |
#include "hyphenator.h" |
#include "notesstyles.h" |
#include "pageitem_arc.h" |
32,21 → 31,22 |
#include "pageitem_regularpolygon.h" |
#include "pageitem_spiral.h" |
#include "pageitem_table.h" |
#include "api/api_application.h" |
#include "prefsmanager.h" |
#include "qtiocompressor.h" |
#include "resourcecollection.h" |
#include "scconfig.h" |
#include "scpaths.h" |
#include "scpattern.h" |
#include "scribusdoc.h" |
#include "scribusview.h" |
#include "scxmlstreamwriter.h" |
#include "textnote.h" |
#include "ui/missing.h" |
#include "units.h" |
#include "util.h" |
#include "util_math.h" |
#include "util_color.h" |
#include <QCursor> |
#include <QFileInfo> |
#include <QList> |
#include <QDataStream> |
#include <QScopedPointer> |
#include "scxmlstreamwriter.h" |
QString Scribus150Format::saveElements(double xp, double yp, double wp, double hp, Selection* selection, QByteArray &prevData) |
{ |
ResourceCollection lists; |
/trunk/Scribus/scribus/scribus.cpp |
---|
157,6 → 157,7 |
#include "serializer.h" |
#include "storyloader.h" |
#include "styleoptions.h" |
#include "textnote.h" |
#include "tocgenerator.h" |
#include "ui/about.h" |
#include "ui/aboutplugins.h" |
/trunk/Scribus/scribus/scribusdoc.cpp |
---|
97,6 → 97,7 |
#include "selection.h" |
#include "serializer.h" |
#include "tableborder.h" |
#include "textnote.h" |
#include "text/textlayoutpainter.h" |
#include "text/textshaper.h" |
#include "ui/guidemanager.h" |
1229,7 → 1230,7 |
currItem->replaceNamedResources(newNames); |
} |
// replace names in styles... |
for (int i=m_docParagraphStyles.count()-1; i >= 0; --i) |
for (int i = m_docParagraphStyles.count() - 1; i >= 0; --i) |
{ |
if (newNames.styles().contains(m_docParagraphStyles[i].name())) |
m_docParagraphStyles.remove(i); |
1236,7 → 1237,7 |
else |
m_docParagraphStyles[i].replaceNamedResources(newNames); |
} |
for (int i=m_docCharStyles.count()-1; i >= 0; --i) |
for (int i = m_docCharStyles.count() - 1; i >= 0; --i) |
{ |
if (newNames.charStyles().contains(m_docCharStyles[i].name())) |
m_docCharStyles.remove(i); |
1361,7 → 1362,7 |
replaceStyles(deletion); |
} |
// repair charstyle context: |
for (int i=0; i < m_docParagraphStyles.count(); ++i) |
for (int i = 0; i < m_docParagraphStyles.count(); ++i) |
{ |
ParagraphStyle& sty(m_docParagraphStyles[i]); |
if (m_docParagraphStyles.isDefault(sty)) |
1388,7 → 1389,7 |
{ |
QMap<QString, QString> deletion; |
QString deflt(""); |
for (int i=0; i < m_docCharStyles.count(); ++i) |
for (int i = 0; i < m_docCharStyles.count(); ++i) |
{ |
const QString& nam(m_docCharStyles[i].name()); |
if (newStyles.find(nam) < 0) |
16874,14 → 16875,10 |
continue; |
if (item->prevInChain() != nullptr) |
continue; |
// for (int j = item->firstInFrame(); j <= item->lastInFrame(); ++j) |
for (int j = 0; j < item->itemText.length(); ++j) |
if (item->itemText.findMark(mrk) >= 0) |
{ |
if (item->itemText.hasMark(j, mrk)) |
{ |
lastItem = item; |
return item; |
} |
lastItem = item; |
return item; |
} |
} |
lastItem = nullptr; |
16968,7 → 16965,7 |
int markPos = findMarkCPos(mrk, item); |
while (markPos > -1) |
{ |
if (mrk->isType(MARKNoteFrameType) && markPos > 1 && item->itemText.text(markPos -1) == SpecialChars::PARSEP) |
if (mrk->isType(MARKNoteFrameType) && markPos > 1 && item->itemText.text(markPos - 1) == SpecialChars::PARSEP) |
item->itemText.removeChars(markPos - 1, 2); |
else |
item->itemText.removeChars(markPos, 1); |
17414,39 → 17411,37 |
for (int pos = frame->firstInFrame(); pos <= frame->lastInFrame(); ++pos) |
{ |
if (!frame->itemText.hasMark(pos, MARKNoteMasterType)) |
continue; |
Mark* mark = frame->itemText.mark(pos); |
if (frame->itemText.hasMark(pos) && mark->isType(MARKNoteMasterType)) |
TextNote* note = mark->getNotePtr(); |
if (note == nullptr || note->notesStyle() != nStyle) |
continue; |
QString numStr = nStyle->prefix() + nStyle->numString(noteNum) + nStyle->suffix(); |
QString mStr = mark->getString(); |
QString label = mark->label; |
if ((mStr != numStr) || flag_updateMarksLabels || flag_updateEndNotes) |
{ |
if (mark->getNotePtr() == nullptr) |
continue; |
if (mark->getNotePtr()->notesStyle() == nStyle) |
{ |
QString numStr = nStyle->prefix() + nStyle->numString(noteNum) + nStyle->suffix(); |
QString mStr = mark->getString(); |
QString label = mark->label; |
if ((mStr != numStr) || flag_updateMarksLabels || flag_updateEndNotes) |
{ |
doUpdate = true; |
mark->setString(numStr); |
label = "NoteMark_" + nStyle->name(); |
if (nStyle->range() == NSRstory) |
label += " in " + frame->firstInChain()->itemName(); |
label += "_" + QString::number(noteNum); |
mark->label = label; |
} |
TextNote* note = mark->getNotePtr(); |
note->setNum(noteNum); |
note->masterMark()->setItemPtr(frame); |
if (note->noteMark() != nullptr) |
{ |
note->noteMark()->setString(numStr); |
label = label.replace("NoteMark","NoteFrameMark"); |
note->noteMark()->label = label; |
} |
++index; |
++noteNum; |
} |
doUpdate = true; |
mark->setString(numStr); |
label = "NoteMark_" + nStyle->name(); |
if (nStyle->range() == NSRstory) |
label += " in " + frame->firstInChain()->itemName(); |
label += "_" + QString::number(noteNum); |
mark->label = label; |
} |
note->setNum(noteNum); |
note->masterMark()->setItemPtr(frame); |
if (note->noteMark() != nullptr) |
{ |
note->noteMark()->setString(numStr); |
label = label.replace("NoteMark","NoteFrameMark"); |
note->noteMark()->label = label; |
} |
++index; |
++noteNum; |
} |
PageItem_NoteFrame* nF = nullptr; |
if (nStyle->isEndNotes()) |
17933,7 → 17928,7 |
} |
} |
m_Selection->delaySignalsOn(); |
if (m_Selection->findItem(nF)!=-1) |
if (m_Selection->findItem(nF) != -1) |
{ |
if (appMode == modeEdit) |
view()->requestMode(modeNormal); |
/trunk/Scribus/scribus/text/storytext.cpp |
---|
27,6 → 27,7 |
//FIXME: this include must go to sctextstruct.h ! |
#include <QList> |
#include <cassert> //added to make Fedora-5 happy |
#include "fpoint.h" |
#include "notesstyles.h" |
#include "scfonts.h" |
34,6 → 35,7 |
#include "sctext_shared.h" |
#include "selection.h" |
#include "storytext.h" |
#include "textnote.h" |
// |
#include "util.h" |
#include "resourcecollection.h" |
1142,6 → 1144,26 |
return -1; |
} |
int StoryText::findNote(const TextNote* textNote) const |
{ |
if (d->len <= 0) |
return -1; |
int len = d->len; |
for (int i = 0; i < len; ++i) |
{ |
const ScText* textItem = d->at(i); |
if (textItem->ch != SpecialChars::OBJECT || textItem->mark == nullptr) |
continue; |
if (textItem->mark->getType() != MARKNoteFrameType) |
continue; |
if (textItem->mark->getNotePtr() == textNote) |
return i; |
} |
return -1; |
} |
bool StoryText::hasMark(int pos, const Mark* mrk) const |
{ |
if (pos < 0) |
1150,12 → 1172,25 |
assert(pos >= 0); |
assert(pos < length()); |
StoryText* that = const_cast<StoryText *>(this); |
if (that->d->at(pos)->ch == SpecialChars::OBJECT) |
return that->d->at(pos)->hasMark(mrk); |
if (d->at(pos)->ch == SpecialChars::OBJECT) |
return d->at(pos)->hasMark(mrk); |
return false; |
} |
bool StoryText::hasMark(int pos, MarkType markType) const |
{ |
if (pos < 0) |
pos += length(); |
assert(pos >= 0); |
assert(pos < length()); |
const ScText* textItem = d->at(pos); |
if (textItem->ch != SpecialChars::OBJECT) |
return false; |
return (textItem->mark && textItem->mark->isType(markType)); |
} |
Mark* StoryText::mark(int pos) const |
{ |
if (pos < 0) |
1164,8 → 1199,7 |
assert(pos >= 0); |
assert(pos < length()); |
StoryText* that = const_cast<StoryText *>(this); |
return that->d->at(pos)->mark; |
return d->at(pos)->mark; |
} |
1205,7 → 1239,6 |
currStyle.setFeatures(s.featureList()); |
} |
void StoryText::replaceMark(int pos, Mark* mrk) |
{ |
if (pos < 0) |
1236,7 → 1269,6 |
return pos >= 0 && pos < length() && text(pos).isLowSurrogate(); |
} |
LayoutFlags StoryText::flags(int pos) const |
{ |
if (pos < 0) |
2171,13 → 2203,13 |
} |
*/ |
ScText* StoryText::item(int index) |
ScText* StoryText::item(int index) |
{ |
assert( index < length() ); |
return const_cast<StoryText *>(this)->d->at(index); |
} |
const ScText* StoryText::item(int index) const |
const ScText* StoryText::item(int index) const |
{ |
assert( index < length() ); |
return const_cast<StoryText *>(this)->d->at(index); |
/trunk/Scribus/scribus/text/storytext.h |
---|
44,10 → 44,11 |
class CharStyle; |
class ParagraphStyle; |
class PageItem; |
class ResourceCollection; |
class ScribusDoc; |
class ScText_Shared; |
class ResourceCollection; |
class ShapedTextCache; |
class TextNote; |
U_NAMESPACE_BEGIN |
class BreakIterator; |
175,12 → 176,16 |
bool hasObject(int pos) const; |
PageItem* getItem(int pos) const; // deprecated |
int findMark(const Mark* mrk, int startPos = 0) const; |
bool hasMark(int pos, const Mark* mrk = nullptr) const; |
bool hasMark(int pos, MarkType markType) const; |
Mark *mark(int pos) const; |
void replaceMark(int pos, Mark* mrk); |
void applyMarkCharstyle(Mark* mrk, CharStyle& currStyle) const; |
int findNote(const TextNote* textNote) const; |
bool isHighSurrogate(int pos) const; |
bool isLowSurrogate(int pos) const; |
/trunk/Scribus/scribus/text/textcontext.cpp |
---|
12,10 → 12,9 |
#include "styles/charstyle.h" |
#include "styles/paragraphstyle.h" |
#include "scribusdoc.h" |
#include "textnote.h" |
#include "util.h" |
static CharStyle* emptyCStyle; |
static ParagraphStyle* emptyPStyle; |
/trunk/Scribus/scribus/textnote.cpp |
---|
0,0 → 1,22 |
/* |
For general Scribus (>=1.3.2) copyright and licensing information please refer |
to the COPYING file provided with the program. Following this notice may exist |
a copyright and/or license notice that predates the release of Scribus 1.3.2 |
for which a new license (GPL+exception) is in place. |
*/ |
#include "notesstyles.h" |
#include "marks.h" |
#include "textnote.h" |
#include "util.h" |
void TextNote::clearSaxedText() |
{ |
m_noteSaxedText.clear(); |
textLen = 0; |
} |
QString TextNote::numString() const |
{ |
return notesStyle()->numString(m_number); |
} |
/trunk/Scribus/scribus/textnote.h |
---|
0,0 → 1,64 |
/* |
For general Scribus (>=1.3.2) copyright and licensing information please refer |
to the COPYING file provided with the program. Following this notice may exist |
a copyright and/or license notice that predates the release of Scribus 1.3.2 |
for which a new license (GPL+exception) is in place. |
*/ |
#ifndef TEXTNOTE_H |
#define TEXTNOTE_H |
#include <QDebug> |
#include <QObject> |
#include <QString> |
#include <QList> |
#include "scribusapi.h" |
class Mark; |
class NotesStyle; |
class ScribusDoc; |
class SCRIBUS_API TextNote : public QObject |
{ |
Q_OBJECT |
friend class ScribusDoc; |
private: |
//only ScribusDoc can create and delete notes |
TextNote(NotesStyle *nStyle) : m_notesStyle(nStyle) { } |
~TextNote() {} |
public: |
NotesStyle* notesStyle() { return m_notesStyle; } |
const NotesStyle* notesStyle() const { return m_notesStyle; } |
void setNotesStyle (NotesStyle* ns) { m_notesStyle = ns; } |
int num() const { return m_number; } |
void setNum(const int i) { m_number = i; } |
QString numString() const; |
Mark* masterMark() { return m_noteMasterMark; } |
const Mark* masterMark() const { return m_noteMasterMark; } |
void setMasterMark(Mark* m) { m_noteMasterMark = m; } |
Mark* noteMark() { return m_noteFrameMark; } |
const Mark* noteMark() const { return m_noteFrameMark; } |
void setNoteMark(Mark* m) { m_noteFrameMark = m; } |
const QString& saxedText() const { return m_noteSaxedText; } |
void setSaxedText(const QString& string) { m_noteSaxedText = string; } |
void clearSaxedText(); |
bool isEndNote() const { return m_notesStyle->isEndNotes(); } |
int textLen {0}; |
protected: |
NotesStyle *m_notesStyle {nullptr}; |
QString m_noteSaxedText; |
Mark *m_noteMasterMark {nullptr}; |
Mark *m_noteFrameMark {nullptr}; |
int m_number {0}; |
}; |
#endif // TEXTNOTE_H |
/trunk/Scribus/win32/msvc2015/scribus-main/Scribus.vcxproj |
---|
403,6 → 403,7 |
<moc Include="..\..\..\scribus\ui\fontreplacedialog.h" /> |
<ClInclude Include="..\..\..\scribus\fpoint.h" /> |
<ClInclude Include="..\..\..\scribus\fpointarray.h" /> |
<moc Include="..\..\..\scribus\textnote.h" /> |
<ClInclude Include="..\..\..\scribus\text\boxes.h" /> |
<ClInclude Include="..\..\..\scribus\text\frect.h" /> |
<ClInclude Include="..\..\..\scribus\text\fsize.h" /> |
503,7 → 504,7 |
<ClInclude Include="..\..\..\scribus\nfttemplate.h" /> |
<moc Include="..\..\..\scribus\ui\nftwidget.h" /> |
<moc Include="..\..\..\scribus\ui\nodeeditpalette.h" /> |
<moc Include="..\..\..\scribus\notesstyles.h" /> |
<ClInclude Include="..\..\..\scribus\notesstyles.h" /> |
<moc Include="..\..\..\scribus\ui\notesstyleseditor.h" /> |
<ClInclude Include="..\..\..\scribus\numeration.h" /> |
<moc Include="..\..\..\scribus\observable.h" /> |
907,6 → 908,7 |
<ClCompile Include="..\..\..\scribus\scprintengine_pdf.cpp" /> |
<ClCompile Include="..\..\..\scribus\selectionrubberband.cpp" /> |
<ClCompile Include="..\..\..\scribus\storyloader.cpp" /> |
<ClCompile Include="..\..\..\scribus\textnote.cpp" /> |
<ClCompile Include="..\..\..\scribus\text\boxes.cpp" /> |
<ClCompile Include="..\..\..\scribus\text\glyphcluster.cpp" /> |
<ClCompile Include="..\..\..\scribus\text\index.cpp" /> |
/trunk/Scribus/win32/msvc2015/scribus-main/Scribus.vcxproj.filters |
---|
842,6 → 842,9 |
<ClInclude Include="..\..\..\scribus\api\api_application.h"> |
<Filter>api</Filter> |
</ClInclude> |
<ClInclude Include="..\..\..\scribus\textnote.h"> |
<Filter>Header Files</Filter> |
</ClInclude> |
</ItemGroup> |
<ItemGroup> |
<ClCompile Include="..\..\..\scribus\desaxe\digester.cpp"> |
2572,6 → 2575,9 |
<ClCompile Include="..\..\..\scribus\ui\prefs_pane.cpp"> |
<Filter>Source Files</Filter> |
</ClCompile> |
<ClCompile Include="..\..\..\scribus\textnote.cpp"> |
<Filter>Source Files</Filter> |
</ClCompile> |
</ItemGroup> |
<ItemGroup> |
<ResourceCompile Include="Scribus.rc"> |
/trunk/Scribus/win32/msvc2017/scribus-main/Scribus.vcxproj |
---|
403,6 → 403,7 |
<moc Include="..\..\..\scribus\ui\fontreplacedialog.h" /> |
<ClInclude Include="..\..\..\scribus\fpoint.h" /> |
<ClInclude Include="..\..\..\scribus\fpointarray.h" /> |
<moc Include="..\..\..\scribus\textnote.h" /> |
<ClInclude Include="..\..\..\scribus\text\boxes.h" /> |
<ClInclude Include="..\..\..\scribus\text\frect.h" /> |
<ClInclude Include="..\..\..\scribus\text\fsize.h" /> |
503,7 → 504,7 |
<ClInclude Include="..\..\..\scribus\nfttemplate.h" /> |
<moc Include="..\..\..\scribus\ui\nftwidget.h" /> |
<moc Include="..\..\..\scribus\ui\nodeeditpalette.h" /> |
<moc Include="..\..\..\scribus\notesstyles.h" /> |
<ClInclude Include="..\..\..\scribus\notesstyles.h" /> |
<moc Include="..\..\..\scribus\ui\notesstyleseditor.h" /> |
<ClInclude Include="..\..\..\scribus\numeration.h" /> |
<moc Include="..\..\..\scribus\observable.h" /> |
907,6 → 908,7 |
<ClCompile Include="..\..\..\scribus\scprintengine_pdf.cpp" /> |
<ClCompile Include="..\..\..\scribus\selectionrubberband.cpp" /> |
<ClCompile Include="..\..\..\scribus\storyloader.cpp" /> |
<ClCompile Include="..\..\..\scribus\textnote.cpp" /> |
<ClCompile Include="..\..\..\scribus\text\boxes.cpp" /> |
<ClCompile Include="..\..\..\scribus\text\glyphcluster.cpp" /> |
<ClCompile Include="..\..\..\scribus\text\index.cpp" /> |
/trunk/Scribus/win32/msvc2017/scribus-main/Scribus.vcxproj.filters |
---|
842,6 → 842,9 |
<ClInclude Include="..\..\..\scribus\api\api_application.h"> |
<Filter>api</Filter> |
</ClInclude> |
<ClInclude Include="..\..\..\scribus\textnote.h"> |
<Filter>Header Files</Filter> |
</ClInclude> |
</ItemGroup> |
<ItemGroup> |
<ClCompile Include="..\..\..\scribus\desaxe\digester.cpp"> |
2572,6 → 2575,9 |
<ClCompile Include="..\..\..\scribus\ui\prefs_pane.cpp"> |
<Filter>Source Files</Filter> |
</ClCompile> |
<ClCompile Include="..\..\..\scribus\textnote.cpp"> |
<Filter>Source Files</Filter> |
</ClCompile> |
</ItemGroup> |
<ItemGroup> |
<ResourceCompile Include="Scribus.rc"> |
/trunk/Scribus/win32/msvc2019/scribus-main/Scribus.vcxproj |
---|
404,6 → 404,7 |
<moc Include="..\..\..\scribus\ui\fontreplacedialog.h" /> |
<ClInclude Include="..\..\..\scribus\fpoint.h" /> |
<ClInclude Include="..\..\..\scribus\fpointarray.h" /> |
<moc Include="..\..\..\scribus\textnote.h" /> |
<ClInclude Include="..\..\..\scribus\text\boxes.h" /> |
<ClInclude Include="..\..\..\scribus\text\frect.h" /> |
<ClInclude Include="..\..\..\scribus\text\fsize.h" /> |
504,7 → 505,7 |
<ClInclude Include="..\..\..\scribus\nfttemplate.h" /> |
<moc Include="..\..\..\scribus\ui\nftwidget.h" /> |
<moc Include="..\..\..\scribus\ui\nodeeditpalette.h" /> |
<moc Include="..\..\..\scribus\notesstyles.h" /> |
<ClInclude Include="..\..\..\scribus\notesstyles.h" /> |
<moc Include="..\..\..\scribus\ui\notesstyleseditor.h" /> |
<ClInclude Include="..\..\..\scribus\numeration.h" /> |
<moc Include="..\..\..\scribus\observable.h" /> |
908,6 → 909,7 |
<ClCompile Include="..\..\..\scribus\scprintengine_pdf.cpp" /> |
<ClCompile Include="..\..\..\scribus\selectionrubberband.cpp" /> |
<ClCompile Include="..\..\..\scribus\storyloader.cpp" /> |
<ClCompile Include="..\..\..\scribus\textnote.cpp" /> |
<ClCompile Include="..\..\..\scribus\text\boxes.cpp" /> |
<ClCompile Include="..\..\..\scribus\text\glyphcluster.cpp" /> |
<ClCompile Include="..\..\..\scribus\text\index.cpp" /> |
/trunk/Scribus/win32/msvc2019/scribus-main/Scribus.vcxproj.filters |
---|
842,6 → 842,9 |
<ClInclude Include="..\..\..\scribus\api\api_application.h"> |
<Filter>api</Filter> |
</ClInclude> |
<ClInclude Include="..\..\..\scribus\textnote.h"> |
<Filter>Header Files</Filter> |
</ClInclude> |
</ItemGroup> |
<ItemGroup> |
<ClCompile Include="..\..\..\scribus\desaxe\digester.cpp"> |
2572,6 → 2575,9 |
<ClCompile Include="..\..\..\scribus\ui\prefs_pane.cpp"> |
<Filter>Source Files</Filter> |
</ClCompile> |
<ClCompile Include="..\..\..\scribus\textnote.cpp"> |
<Filter>Source Files</Filter> |
</ClCompile> |
</ItemGroup> |
<ItemGroup> |
<ResourceCompile Include="Scribus.rc"> |