r19600 by jghali - #12778, patch 08/17: should fix masked function warning, but in a different way

scribus-commit scribus-commit at lists.scribus.net
Sat Oct 18 14:46:03 UTC 2014


Author: jghali
Date: Sat Oct 18 14:46:03 2014
New Revision: 19600

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19600
Log:
#12778, patch 08/17: should fix masked function warning, but in a different way

Modified:
    trunk/Scribus/scribus/notesstyles.h
    trunk/Scribus/scribus/numeration.cpp
    trunk/Scribus/scribus/numeration.h
    trunk/Scribus/scribus/ui/marknote.cpp
    trunk/Scribus/scribus/ui/marknote.h

Modified: trunk/Scribus/scribus/notesstyles.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19600&path=/trunk/Scribus/scribus/notesstyles.h
==============================================================================
--- trunk/Scribus/scribus/notesstyles.h (original)
+++ trunk/Scribus/scribus/notesstyles.h Sat Oct 18 14:46:03 2014
@@ -34,37 +34,37 @@
 	~NotesStyle() {}
 	bool operator!=(const NotesStyle& n2);
 
-	const QString name() { return nameStr; }
+	QString name() const { return nameStr; }
 	void setName(const QString s) { nameStr = s; }
-	const int start() { return startNum; }
+	int start() const { return startNum; }
 	void setStart(const int i) { startNum = i; }
 	void setRange(NumerationRange ns) { numRange = ns; }
-	const NumerationRange range() { return numRange; }
-	const QString prefix() { return prefixStr; }
+	const NumerationRange& range() const { return numRange; }
+	QString prefix() const { return prefixStr; }
 	void setPrefix (const QString str) { prefixStr = str; }
-	const QString suffix() { return suffixStr; }
+	QString suffix() const { return suffixStr; }
 	void setSuffix (const QString str) { suffixStr = str; }
 
-	const QString numString(const int num) { return numeration.numString(num); }
+	QString numString(const int num) const { return numeration.numString(num); }
 	void setType(const NumFormat type) { numeration.numFormat = type; }
-	const NumFormat getType() { return numeration.numFormat; }
+	const NumFormat& getType() const { return numeration.numFormat; }
 
-	bool isEndNotes() { return m_endNotesStyle; }
-	bool isAutoNotesHeight() { return autoNotesHeight; }
-	void setAutoNotesHeight(const bool set) { autoNotesHeight = set; }
-	bool isAutoNotesWidth() { return autoNotesWidth; }
-	void setAutoNotesWidth(const bool set) { autoNotesWidth = set; }
-	bool isAutoRemoveEmptyNotesFrames() { return autoRemoveEmptyNotesFrames; }
-	void setAutoRemoveEmptyNotesFrames(const bool set) { autoRemoveEmptyNotesFrames = set; }
-	bool isAutoWeldNotesFrames() { return autoWeldNotesFrames; }
-	void setAutoWeldNotesFrames(const bool set) { autoWeldNotesFrames = set; }
-	bool isSuperscriptInNote() { return superscriptInNote; }
-	void setSuperscriptInNote(const bool set) { superscriptInNote = set; }
-	bool isSuperscriptInMaster() { return superscriptInMaster; }
-	void setSuperscriptInMaster(const bool set) { superscriptInMaster = set; }
-	const QString marksChStyle() { return marksCharStyle; }
+	bool isEndNotes() const { return m_endNotesStyle; }
+	bool isAutoNotesHeight() const { return autoNotesHeight; }
+	void setAutoNotesHeight(bool set) { autoNotesHeight = set; }
+	bool isAutoNotesWidth() const { return autoNotesWidth; }
+	void setAutoNotesWidth(bool set) { autoNotesWidth = set; }
+	bool isAutoRemoveEmptyNotesFrames() const { return autoRemoveEmptyNotesFrames; }
+	void setAutoRemoveEmptyNotesFrames(bool set) { autoRemoveEmptyNotesFrames = set; }
+	bool isAutoWeldNotesFrames() const { return autoWeldNotesFrames; }
+	void setAutoWeldNotesFrames(bool set) { autoWeldNotesFrames = set; }
+	bool isSuperscriptInNote() const { return superscriptInNote; }
+	void setSuperscriptInNote(bool set) { superscriptInNote = set; }
+	bool isSuperscriptInMaster() const { return superscriptInMaster; }
+	void setSuperscriptInMaster(bool set) { superscriptInMaster = set; }
+	const QString marksChStyle() const { return marksCharStyle; }
 	void setMarksCharStyle(const QString styleName) { marksCharStyle = styleName; }
-	const QString notesParStyle() { return notesParaStyle; }
+	const QString notesParStyle() const { return notesParaStyle; }
 	void setNotesParStyle(const QString styleName) { notesParaStyle = styleName; }
 
 	void setEndNotes(bool);

Modified: trunk/Scribus/scribus/numeration.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19600&path=/trunk/Scribus/scribus/numeration.cpp
==============================================================================
--- trunk/Scribus/scribus/numeration.cpp (original)
+++ trunk/Scribus/scribus/numeration.cpp Sat Oct 18 14:46:03 2014
@@ -1,7 +1,7 @@
 #include "numeration.h"
 #include "util.h"
 
-const QString getStringFromNum(NumFormat format, int num, const QChar leadingChar, const int charsLen)
+QString getStringFromNum(NumFormat format, int num, QChar leadingChar, int charsLen)
 {
 	QString str = getStringFromSequence(format, num);
 	if (charsLen > str.length())
@@ -9,7 +9,7 @@
 	return str;
 }
 
-const QString getAsterixStringFromNum(int num, QString asterix, const QChar leadingChar, const int charsLen)
+QString getAsterixStringFromNum(int num, QString asterix, QChar leadingChar, int charsLen)
 {
 	QString str = getStringFromSequence(Type_asterix, num, asterix);
 	if (charsLen > str.length())
@@ -17,7 +17,7 @@
 	return str;
 }
 
-const QString getFormatName(int format)
+QString getFormatName(int format)
 {
 	QString name = QString();
 	if (format == Type_1_2_3)
@@ -38,18 +38,17 @@
 	return name;
 }
 
-const QStringList getFormatList()
+QStringList getFormatList()
 {
 	QStringList list;
 	list << "1_2_3" << "i_ii_iii" << "I_II_III" << "a_b_c" << "A_B_C" << "*" << "CJK";
 	return list;
 }
 
-const QString Numeration::numString(const int num)
+QString Numeration::numString(int num) const
 {
 	if (numFormat == Type_asterix)
 		return getAsterixStringFromNum(num, asterix, lead, len);
 
 	return getStringFromNum(numFormat, num, lead, len);
-	
 }

Modified: trunk/Scribus/scribus/numeration.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19600&path=/trunk/Scribus/scribus/numeration.h
==============================================================================
--- trunk/Scribus/scribus/numeration.h (original)
+++ trunk/Scribus/scribus/numeration.h Sat Oct 18 14:46:03 2014
@@ -31,7 +31,8 @@
 public:
 	Numeration() : numFormat(Type_1_2_3), asterix(QString()), lead('0'), len(0), range(NSRdocument), prefix(QString()), suffix(QString()), start(1) {}
 	Numeration(NumFormat f) : numFormat(f), asterix("*") {}
-	const QString numString(const int num);
+	
+	QString numString(int num) const;
 
 	NumFormat numFormat;
 	QString asterix;
@@ -53,11 +54,11 @@
 
 //util functions for use without Numeration class
 //convert passed num to string using numeration style
-const QString getStringFromNum(NumFormat format, int num, const QChar leadingChar='0', const int charsLen=0);
+QString getStringFromNum(NumFormat format, int num, QChar leadingChar='0', int charsLen=0);
 //convert passed num to string with custom chars
-const QString getAsterixStringFromNum(int num, QString asterix, const QChar leadingChar='_', const int charsLen=0);
+QString getAsterixStringFromNum(int num, QString asterix, QChar leadingChar='_', int charsLen=0);
 //return numeration name from type
-const QString getFormatName(int format);
-const QStringList getFormatList();
+QString getFormatName(int format);
+QStringList getFormatList();
 
 #endif // NUMERATION_H

Modified: trunk/Scribus/scribus/ui/marknote.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19600&path=/trunk/Scribus/scribus/ui/marknote.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/marknote.cpp (original)
+++ trunk/Scribus/scribus/ui/marknote.cpp Sat Oct 18 14:46:03 2014
@@ -20,7 +20,7 @@
 	return (NotesStyle*) ItemList->itemData(index).value<void*>();
 }
 
-void MarkNote::setValues(NotesStyle* defaultStyle)
+void MarkNote::setValues(const NotesStyle* defaultStyle)
 {
 	ItemList->setCurrentIndex(ItemList->findText(defaultStyle->name()));
 }

Modified: trunk/Scribus/scribus/ui/marknote.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19600&path=/trunk/Scribus/scribus/ui/marknote.h
==============================================================================
--- trunk/Scribus/scribus/ui/marknote.h (original)
+++ trunk/Scribus/scribus/ui/marknote.h Sat Oct 18 14:46:03 2014
@@ -12,7 +12,7 @@
 public:
 	explicit MarkNote(const QList<NotesStyle*>& notesStylesList, QWidget *parent = NULL);
 	virtual NotesStyle* values();
-	virtual void setValues(NotesStyle* defaultStyle);
+	virtual void setValues(const NotesStyle* defaultStyle);
 
 protected:
 	void changeEvent(QEvent *e);




More information about the scribus-commit mailing list