Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 25292 → Rev 25295

/trunk/Scribus/scribus/storyloader.cpp
59,7 → 59,7
\brief Tests if the file "FileName" exists and determines the type of the file.
\retval int -1 if the file doesn't exist or any other error has occurred, 0 for the old Format, 1 for the new Format, 2 for EPS and PS files, 3 for SVG files and 4 for PDF files
*/
int StoryLoader::testData(const QByteArray& storyData)
int StoryLoader::testData(const QByteArray& storyData) const
{
int ret = -1;
 
115,7 → 115,7
return ret;
}
 
bool StoryLoader::saveStory(QByteArray& storyData, ScribusDoc& doc, StoryText &story, PageItem* item)
bool StoryLoader::saveStory(QByteArray& storyData, ScribusDoc& doc, StoryText &story, PageItem* item) const
{
QList<FileFormat>::const_iterator it;
if (!findFormat(FORMATID_SLA150EXPORT, it))
136,7 → 136,7
if (!(m_prefsManager.appPrefs.fontPrefs.askBeforeSubstitute))
return true;
 
qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
QApplication::changeOverrideCursor(QCursor(Qt::ArrowCursor));
FontReplaceDialog dia(nullptr, &m_replacedFonts);
if (!dia.exec())
return false;
155,12 → 155,12
return true;
}
 
void StoryLoader::informReplacementFonts()
void StoryLoader::informReplacementFonts() const
{
if (m_replacedFonts.count() == 0)
return;
 
qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
QApplication::changeOverrideCursor(QCursor(Qt::ArrowCursor));
QString mess = tr("Some fonts used by this document have been substituted:") + "\n\n";
for (auto it = m_replacedFonts.begin(); it != m_replacedFonts.end(); ++it)
{
169,7 → 169,7
ScMessageBox::warning(ScCore->primaryMainWindow(), CommonStrings::trWarning, mess);
}
 
bool StoryLoader::findFormat(uint formatId, QList<FileFormat>::const_iterator &it)
bool StoryLoader::findFormat(uint formatId, QList<FileFormat>::const_iterator &it) const
{
QList<FileFormat> fileFormats(LoadSavePlugin::supportedFormats());
it = fileFormats.constBegin();
182,7 → 182,7
return false;
}
 
bool StoryLoader::findFormat(const QByteArray& data, QList<FileFormat>::const_iterator &it)
bool StoryLoader::findFormat(const QByteArray& data, QList<FileFormat>::const_iterator &it) const
{
QList<FileFormat> fileFormats(LoadSavePlugin::supportedFormats());
it = fileFormats.constBegin();
/trunk/Scribus/scribus/storyloader.h
35,13 → 35,13
StoryLoader();
~StoryLoader() override = default;
 
int testData(const QByteArray& storyData);
int testData(const QByteArray& storyData)const;
 
bool loadStory(const QByteArray& storyData, ScribusDoc& doc, StoryText &story, PageItem* item = nullptr);
bool saveStory(QByteArray& storyData, ScribusDoc& doc, StoryText &story, PageItem* item = nullptr);
bool saveStory(QByteArray& storyData, ScribusDoc& doc, StoryText &story, PageItem* item = nullptr)const;
 
bool postLoad(ScribusDoc* currDoc);
void informReplacementFonts();
void informReplacementFonts()const;
 
const FileFormat * const formatSLA12x;
const FileFormat * const formatSLA13x;
52,8 → 52,8
QMap<QString, QString> m_replacedFonts;
PrefsManager& m_prefsManager;
 
bool findFormat(uint formatId, QList<FileFormat>::const_iterator &it);
bool findFormat(const QByteArray& data, QList<FileFormat>::const_iterator &it);
bool findFormat(uint formatId, QList<FileFormat>::const_iterator &it) const;
bool findFormat(const QByteArray& data, QList<FileFormat>::const_iterator &it) const;
};
 
#endif
/trunk/Scribus/scribus/ui/hruler.cpp
427,7 → 427,7
emit MarkerMoved(textBase(), marker);
return;
}
if ((m_mousePressed) && (m_rulerCode == rc_tab) && ((mousePos.y() > height()) || (mousePos.y() < 0)))
if (m_mousePressed && (m_rulerCode == rc_tab) && ((mousePos.y() > height()) || (mousePos.y() < 0)))
{
setCursor(IconManager::instance().loadCursor("DelPoint.png", 1, 1));
return;
587,7 → 587,7
}
 
 
void Hruler::drawMarker(QPainter& p)
void Hruler::drawMarker(QPainter& p) const
{
// draw slim marker
QPolygon cr;
600,7 → 600,7
}
 
 
void Hruler::drawMarks(QPainter& p)
void Hruler::drawMarks(QPainter& p) const
{
const QPalette& palette = this->palette();
const QColor& textColor = palette.color(QPalette::Text);
659,7 → 659,7
}
}
 
void Hruler::drawTextMarks(double pos, double endPos, QPainter& p)
void Hruler::drawTextMarks(double pos, double endPos, QPainter& p) const
{
double xl;
763,13 → 763,13
}
}
 
void Hruler::drawNumber(const QString& txt, int x, int y0, QPainter & p)
void Hruler::drawNumber(const QString& txt, int x, int y0, QPainter & p) const
{
const int y = y0 - 3 + topline;
p.drawText(x,y,txt);
}
 
double Hruler::ruleSpacing()
double Hruler::ruleSpacing() const
{
return m_iter;
}
850,7 → 850,7
{
double sc = m_view->scale();
m_cor = 1;
int docUnitIndex=m_doc->unitIndex();
int docUnitIndex = m_doc->unitIndex();
switch (docUnitIndex)
{
case SC_PT:
/trunk/Scribus/scribus/ui/hruler.h
64,7 → 64,7
Hruler(ScribusView *pa, ScribusDoc *doc);
~Hruler() {}
 
double ruleSpacing();
double ruleSpacing() const;
void setItem(PageItem * item);
void textMode(bool state) { m_textEditMode = state; }
double textBase() const; // left text edge in canvas coord
86,10 → 86,10
void enterEvent(QEnterEvent *m) override;
void leaveEvent(QEvent *m) override;
 
void drawMarks(QPainter& p);
void drawTextMarks(double pos, double endPos, QPainter& p);
void drawMarker(QPainter& p);
void drawNumber(const QString& num, int startx, int starty, QPainter & p);
void drawMarks(QPainter& p) const;
void drawTextMarks(double pos, double endPos, QPainter& p) const;
void drawMarker(QPainter& p) const;
void drawNumber(const QString& num, int startx, int starty, QPainter & p) const;
void updateTabList();
 
PageItem* m_currItem {nullptr};
/trunk/Scribus/scribus/ui/vruler.cpp
56,7 → 56,7
m_mousePressed = true;
if (!m_doc->guidesPrefs().guidesShown)
return;
qApp->setOverrideCursor(QCursor(Qt::SplitHCursor));
QApplication::setOverrideCursor(QCursor(Qt::SplitHCursor));
m_view->startGesture(rulerGesture);
m_view->registerMousePress(m->globalPosition());
}
67,7 → 67,7
return;
if (rulerGesture->isActive())
rulerGesture->mouseReleaseEvent(m);
qApp->restoreOverrideCursor();
QApplication::restoreOverrideCursor();
m_mousePressed = false;
}
 
160,7 → 160,7
p.end();
}
 
void Vruler::drawNumber(const QString& num, int starty, QPainter *p)
void Vruler::drawNumber(const QString& num, int starty, QPainter *p) const
{
int textY = starty;
for (int i = 0; i < num.length(); ++i)
170,7 → 170,7
}
}
 
double Vruler::ruleSpacing()
double Vruler::ruleSpacing() const
{
return m_iter;
}
189,7 → 189,7
void Vruler::unitChange()
{
double sc = m_view->scale();
m_cor=1;
m_cor = 1;
int docUnitIndex = m_doc->unitIndex();
switch (docUnitIndex)
{
/trunk/Scribus/scribus/ui/vruler.h
47,7 → 47,7
Vruler(ScribusView *pa, ScribusDoc *doc);
~Vruler() {}
double ruleSpacing();
double ruleSpacing() const;
void shift(double pos) { m_offset = pos; }
void shiftRel(double dist) { m_offset += dist; }
 
62,8 → 62,9
void mousePressEvent(QMouseEvent *m) override;
void mouseReleaseEvent(QMouseEvent *m) override;
void mouseMoveEvent(QMouseEvent *m) override;
void drawNumber(const QString& num, int starty, QPainter *p);
 
void drawNumber(const QString& num, int starty, QPainter *p) const;
 
RulerGesture* rulerGesture {nullptr};
ScribusDoc* m_doc {nullptr};
ScribusView* m_view {nullptr};