r24153 by jghali - Code cleanup: add a few overrides where possible

scribus-commit scribus-commit at lists.scribus.net
Mon Nov 2 01:30:27 UTC 2020


Author: jghali
Date: Mon Nov  2 01:30:27 2020
New Revision: 24153

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24153
Log:
Code cleanup: add a few overrides where possible

Modified:
    trunk/Scribus/scribus/fonts/ftface.h
    trunk/Scribus/scribus/fonts/scface.h
    trunk/Scribus/scribus/fonts/scface_ps.h
    trunk/Scribus/scribus/fonts/scface_ttf.cpp
    trunk/Scribus/scribus/fonts/scface_ttf.h

Modified: trunk/Scribus/scribus/fonts/ftface.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24153&path=/trunk/Scribus/scribus/fonts/ftface.h
==============================================================================
--- trunk/Scribus/scribus/fonts/ftface.h	(original)
+++ trunk/Scribus/scribus/fonts/ftface.h	Mon Nov  2 01:30:27 2020
@@ -76,8 +76,8 @@
 	QString pdfFontBBoxAsString()    const { return m_pdfFontBBox; }
 	QString italicAngleAsString()    const { return m_italicAngle; }
 
-	bool isItalic() const { return m_isItalic; }
-	bool isBold() const { return m_isBold; }
+	bool isItalic() const override { return m_isItalic; }
+	bool isBold() const override { return m_isBold; }
 
 //FIXME	QMap<QString,QString> fontDictionary(qreal sz=1.0) const;
 
@@ -85,15 +85,15 @@
 
 //	GlyphMetrics glyphBBox (gid_type gl, qreal sz) const;
 
-	void rawData   (QByteArray & bb) const;
+	void rawData(QByteArray & bb) const override;
 
 	static bool hasMicrosoftUnicodeCmap(FT_Face face);
 	static QString adobeGlyphName(FT_ULong charcode);
 	virtual bool glyphNames(ScFace::FaceEncoding& glyphList) const;
 
-	void load() const;
-	void unload() const;
-	void loadGlyph (ScFace::gid_type gl) const;
+	void load() const override;
+	void unload() const override;
+	void loadGlyph (ScFace::gid_type gl) const override;
 
 protected:
 	mutable FT_Face m_face;

Modified: trunk/Scribus/scribus/fonts/scface.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24153&path=/trunk/Scribus/scribus/fonts/scface.h
==============================================================================
--- trunk/Scribus/scribus/fonts/scface.h	(original)
+++ trunk/Scribus/scribus/fonts/scface.h	Mon Nov  2 01:30:27 2020
@@ -96,7 +96,8 @@
 
 	static const gid_type CONTROL_GLYPHS = 2000000000; // 2 billion
 
-	struct GlyphData { 
+	struct GlyphData
+	{ 
 		FPointArray Outlines;
 		qreal x {0.0};
 		qreal y {0.0};
@@ -109,12 +110,16 @@
 
     
 	/// see accessors for ScFace for docs
-	class ScFaceData {
+	class ScFaceData 
+	{
 	public:
+		ScFaceData();
+		virtual ~ScFaceData();
+
 		/// controls destruction
-	mutable int refs {0};
+		mutable int refs {0};
 		/// controls load()
-	mutable int usage {0};
+		mutable int usage {0};
 
 		QString family;
 		QString fontFile {"(None)"};
@@ -141,10 +146,7 @@
 		bool hasGlyphNames {false};
 		gid_type maxGlyph {0};
 
-		ScFaceData();
-		virtual ~ScFaceData();
 	protected:
-
 		friend class ScFace;
 		Status m_cachedStatus {ScFace::UNKNOWN};
 

Modified: trunk/Scribus/scribus/fonts/scface_ps.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24153&path=/trunk/Scribus/scribus/fonts/scface_ps.h
==============================================================================
--- trunk/Scribus/scribus/fonts/scface_ps.h	(original)
+++ trunk/Scribus/scribus/fonts/scface_ps.h	Mon Nov  2 01:30:27 2020
@@ -32,11 +32,12 @@
 {
 	public:
 		ScFace_PostScript(const QString& fam, const QString& sty, const QString& alt, const QString& scname, const QString& psname, const QString& path, int face, const QStringList& features);
+		
+		void load() const override;
 
 		virtual QStringList findFontMetrics(const QString& fontPath) const;
 		virtual QStringList findFontMetrics(const QString& baseDir, const QString& baseName) const;
 		virtual bool loadFontMetrics(FT_Face face, const QString& fontPath) const;
-		virtual void load() const;
 };
 
 /*
@@ -49,7 +50,8 @@
 {
 	public:
 		ScFace_PFB(const QString& fam, const QString& sty, const QString& alt, const QString& scname, const QString& psname, const QString& path, int face, const QStringList& features);
-		virtual bool embedFont(QByteArray &str) const;
+
+		bool embedFont(QByteArray &str) const override;
 };
 
 /*
@@ -62,7 +64,8 @@
 {
 	public:
 		ScFace_PFA(const QString& fam, const QString& sty, const QString& alt, const QString& scname, const QString& psname, const QString& path, int face, const QStringList& features);
-		virtual bool embedFont(QByteArray &str) const;
+
+		bool embedFont(QByteArray &str) const override;
 };
 
 

Modified: trunk/Scribus/scribus/fonts/scface_ttf.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24153&path=/trunk/Scribus/scribus/fonts/scface_ttf.cpp
==============================================================================
--- trunk/Scribus/scribus/fonts/scface_ttf.cpp	(original)
+++ trunk/Scribus/scribus/fonts/scface_ttf.cpp	Mon Nov  2 01:30:27 2020
@@ -70,7 +70,7 @@
 	return FtFace::hasNames();
 }
 
-bool ScFace_ttf::glyphNames(ScFace::FaceEncoding& GList) const
+bool ScFace_ttf::glyphNames(ScFace::FaceEncoding& glyphList) const
 {
 	FT_ULong  charcode;
 	FT_UInt gindex = 0;
@@ -83,7 +83,7 @@
 	// For those fonts we consequently use Adobe Glyph names whenever possible.
 	const bool avoidFntNames = (formatCode != ScFace::TYPE42 && typeCode == ScFace::TTF) && hasMicrosoftUnicodeCmap(face);
 	if (!avoidFntNames)
-		return FtFace::glyphNames(GList);
+		return FtFace::glyphNames(glyphList);
 	
 //	qDebug() << "reading metrics for" << face->family_name << face->style_name;
 	charcode = FT_Get_First_Char(face, &gindex);
@@ -93,8 +93,8 @@
 		glEncoding.charcode  = charcode;
 		glEncoding.glyphName = adobeGlyphName(charcode);
 		glEncoding.toUnicode = QString::asprintf("%04lX", charcode);
-		GList.insert(gindex, glEncoding);
-		charcode = FT_Get_Next_Char(face, charcode, &gindex );
+		glyphList.insert(gindex, glEncoding);
+		charcode = FT_Get_Next_Char(face, charcode, &gindex);
 	}
 
 	return true;

Modified: trunk/Scribus/scribus/fonts/scface_ttf.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24153&path=/trunk/Scribus/scribus/fonts/scface_ttf.h
==============================================================================
--- trunk/Scribus/scribus/fonts/scface_ttf.h	(original)
+++ trunk/Scribus/scribus/fonts/scface_ttf.h	Mon Nov  2 01:30:27 2020
@@ -24,15 +24,15 @@
 	ScFace_ttf (const QString& fam, const QString& sty, const QString& alt, const QString& scname, const QString& psname, const QString& path, int face, const QStringList& features);
 	~ScFace_ttf();
 
-	void load () const;
-	void unload () const;
+	void load () const override;
+	void unload () const override;
 
-	bool embedFont(QByteArray &str) const;
-	void rawData(QByteArray & bb) const;
+	bool embedFont(QByteArray &str) const override;
+	void rawData(QByteArray & bb) const override;
 	
-	virtual bool glyphNames(ScFace::FaceEncoding& GList) const;
-	virtual bool hasNames() const;
-	virtual bool isSymbolic() const;
+	bool glyphNames(ScFace::FaceEncoding& glyphList) const override;
+	bool hasNames() const override;
+	bool isSymbolic() const override;
 
 private:
 	mutable sfnt::PostTable m_checkPost;




More information about the scribus-commit mailing list