From: Abdelrazak Younes Date: Thu, 25 May 2006 10:02:01 +0000 (+0000) Subject: qt3/qfont_loader.h: added comment about pointer reference. X-Git-Tag: 1.6.10~13194 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=04e8d1e65bc2e3bca05d0d997a5cd243e02e2a8e;p=features.git qt3/qfont_loader.h: added comment about pointer reference. qt4/qfont_loader.h: reverted to last version and added comment about pointer reference. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13927 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt3/qfont_loader.h b/src/frontends/qt3/qfont_loader.h index 3a03468d0c..7b56485845 100644 --- a/src/frontends/qt3/qfont_loader.h +++ b/src/frontends/qt3/qfont_loader.h @@ -83,6 +83,8 @@ public: /// Get font info (font + metrics) for the given LyX font. QLFontInfo & fontinfo(LyXFont const & f) { + // fi is a reference to the pointer type (QLFontInfo *) in the + // fontinfo_ table. QLFontInfo * & fi = fontinfo_[f.family()][f.series()][f.realShape()][f.size()]; if (!fi) diff --git a/src/frontends/qt4/qfont_loader.h b/src/frontends/qt4/qfont_loader.h index ef283ff046..d4c41ec2aa 100644 --- a/src/frontends/qt4/qfont_loader.h +++ b/src/frontends/qt4/qfont_loader.h @@ -83,13 +83,12 @@ public: /// Get font info (font + metrics) for the given LyX font. QLFontInfo & fontinfo(LyXFont const & f) { - QLFontInfo * fi = + // fi is a reference to the pointer type (QLFontInfo *) in the + // fontinfo_ table. + QLFontInfo * & fi = fontinfo_[f.family()][f.series()][f.realShape()][f.size()]; - if (!fi) { + if (!fi) fi = new QLFontInfo(f); - fontinfo_[f.family()][f.series()][f.realShape()][f.size()] - = fi; - } return *fi; }