freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2-demos] master 00aa25e 2/4: [ftinspect] Minor.


From: Werner LEMBERG
Subject: [freetype2-demos] master 00aa25e 2/4: [ftinspect] Minor.
Date: Thu, 05 May 2016 08:29:35 +0000

branch: master
commit 00aa25e33fd0dc1f695610e4c5de123b853f390f
Author: Werner Lemberg <address@hidden>
Commit: Werner Lemberg <address@hidden>

    [ftinspect] Minor.
    
    * src/ftinspect.cpp (faceRequester): Use reference.
    (MainGUI::loadFonts): Simplify.
---
 ChangeLog         |    7 +++++++
 src/ftinspect.cpp |    5 ++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e71acea..647345a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2016-05-05  Werner Lemberg  <address@hidden>
 
+       [ftinspect] Minor.
+
+       * src/ftinspect.cpp (faceRequester): Use reference.
+       (MainGUI::loadFonts): Simplify.
+
+2016-05-05  Werner Lemberg  <address@hidden>
+
        [ftinspect] Make `MainGUI' and `Engine' classes more symmetric.
 
        Also avoid `const' issues.
diff --git a/src/ftinspect.cpp b/src/ftinspect.cpp
index f79c892..22ffb82 100644
--- a/src/ftinspect.cpp
+++ b/src/ftinspect.cpp
@@ -23,7 +23,7 @@ faceRequester(FTC_FaceID faceID,
   MainGUI* gui = static_cast<MainGUI*>(requestData);
   FaceID* id = static_cast<FaceID*>(faceID);
 
-  Font font = gui->fonts[id->fontIndex];
+  Font& font = gui->fonts[id->fontIndex];
   int faceIndex = id->faceIndex;
 
   if (id->instanceIndex >= 0)
@@ -195,8 +195,7 @@ MainGUI::loadFonts()
   }
 
   // if we have new fonts, set the current index to the first new one
-  if (!fonts.isEmpty()
-      && oldSize < fonts.size())
+  if (oldSize < fonts.size())
     currentFontIndex = oldSize;
 
   checkCurrentFontIndex();



reply via email to

[Prev in Thread] Current Thread [Next in Thread]