diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index a841181be4..52c9a2a257 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,8 @@ +2002-11-17 John Levon + + * qfont_loader.h: + * qfont_loader.C: fix totally broken update code + 2002-11-17 John Levon * Makefile.am: diff --git a/src/frontends/qt2/QDocumentDialog.C b/src/frontends/qt2/QDocumentDialog.C index e439acfa0d..62249e4173 100644 --- a/src/frontends/qt2/QDocumentDialog.C +++ b/src/frontends/qt2/QDocumentDialog.C @@ -103,11 +103,6 @@ QDocumentDialog::QDocumentDialog(QDocument * form) titleL->setFont(f); setTitle(LAYOUT); - // FIXME: Edwin, please change this by making each module have - // a change_adaptor(), and connecting inside designer; then - // connect each module's change_adaptor to the main form's - // one here. - // preamble connect(preambleModule->preambleMLE, SIGNAL(textChanged()), this , SLOT(change_adaptor())); diff --git a/src/frontends/qt2/qfont_loader.C b/src/frontends/qt2/qfont_loader.C index 8b2a179dae..211c349626 100644 --- a/src/frontends/qt2/qfont_loader.C +++ b/src/frontends/qt2/qfont_loader.C @@ -38,6 +38,15 @@ using std::endl; qfont_loader::qfont_loader() { + for (int i1 = 0; i1 < LyXFont::NUM_FAMILIES; ++i1) { + for (int i2 = 0; i2 < 2; ++i2) { + for (int i3 = 0; i3 < 4; ++i3) { + for (int i4 = 0; i4 < 10; ++i4) { + fontinfo_[i1][i2][i3][i4] = 0; + } + } + } + } } @@ -48,18 +57,16 @@ qfont_loader::~qfont_loader() void qfont_loader::update() { -#warning crashes ???? -#if 0 for (int i1 = 0; i1 < LyXFont::NUM_FAMILIES; ++i1) { - for (int i2 = 0; i1 < 2; ++i2) { - for (int i3 = 0; i1 < 4; ++i3) { - for (int i4 = 0; i1 < 10; ++i4) { - fontinfo_[i1][i2][i3][i4].reset(0); + for (int i2 = 0; i2 < 2; ++i2) { + for (int i3 = 0; i3 < 4; ++i3) { + for (int i4 = 0; i4 < 10; ++i4) { + delete fontinfo_[i1][i2][i3][i4]; + fontinfo_[i1][i2][i3][i4] = 0; } } } } -#endif } @@ -222,10 +229,10 @@ qfont_loader::font_info const * qfont_loader::getfontinfo(LyXFont const & f) // FIXME } - font_info * fi = fontinfo_[f.family()][f.series()][f.realShape()][f.size()].get(); + font_info const * fi = fontinfo_[f.family()][f.series()][f.realShape()][f.size()]; if (!fi) { fi = new font_info(f); - fontinfo_[f.family()][f.series()][f.realShape()][f.size()].reset(fi); + fontinfo_[f.family()][f.series()][f.realShape()][f.size()] = fi; } return fi; diff --git a/src/frontends/qt2/qfont_loader.h b/src/frontends/qt2/qfont_loader.h index 12dd7dc92f..8c01b202cf 100644 --- a/src/frontends/qt2/qfont_loader.h +++ b/src/frontends/qt2/qfont_loader.h @@ -21,8 +21,6 @@ #include #include -#include - /** * Qt font loader for LyX. Matches LyXFonts against * actual QFont instances, and also caches metrics. @@ -61,7 +59,7 @@ private: font_info const * getfontinfo(LyXFont const & f); /// BUTT ugly ! - boost::scoped_ptr fontinfo_[LyXFont::NUM_FAMILIES][2][4][10]; + font_info const * fontinfo_[LyXFont::NUM_FAMILIES][2][4][10]; }; extern qfont_loader fontloader;