small cleanup and removal of warnings

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5446 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2002-10-19 10:32:57 +00:00
parent e47acda4ea
commit c6e27f082c
9 changed files with 83 additions and 46 deletions

View File

@ -1,3 +1,24 @@
2002-10-19 Lars Gullik Bjønnes <larsbj@gullik.net>
* qfont_loader.C (update): move loop vars into for scopes.
(get): add some debug msg.
(font_info): ditto
(getfontinfo): simplify slightly
* QParagraph.C (setWidgetsFromVSpace): initilize item
* QERT.C (update_contents): initialize rb
* QDocument.C (build_dialog): move int n inside for scope.
* QCharacter.C (findPos2nd): add a typedef
* FileDialog_private.C: include order changed.
(LyXFileDialog): some reformat
* FileDialog.C: include order changed.
(FileDialog): fix wrong use of new.
2002-10-17 Juergen Spitzmueller <j.spitzmueller@gmx.de>
* ui/QSendtoDialog.ui: fix layout

View File

@ -13,17 +13,18 @@
#endif
#include <config.h>
#include <gettext.h>
#include <utility>
#include "commandtags.h"
#include "LString.h"
#include "frontends/FileDialog.h"
#include "FileDialog_private.h"
#include "debug.h"
#include "gettext.h"
#include <qapplication.h>
#include <utility>
using std::make_pair;
using std::pair;
using std::endl;
@ -34,7 +35,7 @@ struct FileDialog::Private {
};
FileDialog::FileDialog(LyXView *lv, string const & t, kb_action s, Button b1, Button b2)
: private_(new FileDialog::Private()), lv_(lv), title_(t), success_(s)
: private_(new FileDialog::Private), lv_(lv), title_(t), success_(s)
{
private_->b1 = b1;
private_->b2 = b2;

View File

@ -14,17 +14,19 @@
#pragma implementation
#endif
#include <qapplication.h>
#include <qtoolbutton.h>
#include "FileDialog_private.h"
#include "QtLyXView.h"
#include "debug.h"
#include "funcrequest.h"
#include "lyxfunc.h"
#include "FileDialog_private.h"
#include "support/lstrings.h"
#include <qapplication.h>
#include <qfiledialog.h>
#include <qtoolbutton.h>
namespace {
/// return the Qt form of the label
string const getLabel(string const & str) {
@ -40,9 +42,12 @@ namespace {
}
}
LyXFileDialog::LyXFileDialog(string const & p, string const & m, string const & t,
LyXFileDialog::LyXFileDialog(string const & p, string const & m,
string const & t,
FileDialog::Button const & b1, FileDialog::Button const & b2)
: QFileDialog(p.c_str(), m.c_str(), qApp->mainWidget(), t.c_str(), true),
: QFileDialog(p.c_str(), m.c_str(),
qApp->mainWidget(), t.c_str(), true),
b1_(0), b2_(0)
{
setCaption(t.c_str());

View File

@ -101,7 +101,10 @@ namespace {
template<class A, class B>
int findPos2nd(vector<std::pair<A,B> > const & vec, B const & val)
{
vector<std::pair<A,B> >::const_iterator cit = vec.begin();
typedef typename vector<std::pair<A, B> >::const_iterator
const_iterator;
const_iterator cit = vec.begin();
for (; cit != vec.end(); ++cit) {
if (cit->second == val)
return int(cit - vec.begin());

View File

@ -97,8 +97,7 @@ void QDocument::build_dialog()
dialog_->packagesModule->lspacingCO->insertItem(
_("Custom"),Spacing::Other);
int n;
for (n=0; tex_graphics[n][0]; ++n) {
for (int n = 0; tex_graphics[n][0]; ++n) {
QString enc = tex_graphics[n];
dialog_->packagesModule->psdriverCO->insertItem(enc);
}
@ -116,7 +115,7 @@ void QDocument::build_dialog()
dialog_->layoutModule->classCO->insertItem(cit->description().c_str());
}
for (n=0; tex_fonts[n][0]; ++n) {
for (int n = 0; tex_fonts[n][0]; ++n) {
QString font = tex_fonts[n];
dialog_->layoutModule->fontsCO->insertItem(font);
}
@ -469,7 +468,6 @@ void QDocument::update_contents()
dialog_->updatePagestyle(controller().textClass().opt_pagestyle(),
controller().params().pagestyle);
for (int n = 0; tex_fonts[n][0]; ++n) {
if (tex_fonts[n]==controller().params().fonts) {
dialog_->layoutModule->fontsCO->setCurrentItem(n);

View File

@ -54,7 +54,7 @@ void QERT::apply()
void QERT::update_contents()
{
QRadioButton * rb;
QRadioButton * rb = 0;
switch (controller().params().status) {
case InsetERT::Open: rb = dialog_->openRB; break;

View File

@ -223,7 +223,7 @@ void setWidgetsFromVSpace(VSpace const & space,
value->setEnabled(false);
unit->setEnabled(false);
int item;
int item = 0;
switch (space.kind()) {
case VSpace::NONE:
item = 0;

View File

@ -40,14 +40,10 @@ qfont_loader::~qfont_loader()
void qfont_loader::update()
{
int i1,i2,i3,i4;
// fuck this !
for (i1 = 0; i1 < LyXFont::NUM_FAMILIES; ++i1) {
for (i2 = 0; i1 < 2; ++i2) {
for (i3 = 0; i1 < 4; ++i3) {
for (i4 = 0; i1 < 10; ++i4) {
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);
}
}
@ -62,8 +58,12 @@ QFont const & qfont_loader::get(LyXFont const & f)
if (lyxerr.debugging(Debug::FONT)) {
lyxerr[Debug::FONT] << "Font '" << f.stateText(0)
<< "' matched by\n" << ret.rawName().latin1() << endl;
<< "' matched by\n" << ret.rawName() << endl;
}
lyxerr[Debug::FONT] << "The font has size: "
<< ret.pointSizeFloat() << endl;
return ret;
}
@ -128,6 +128,16 @@ qfont_loader::font_info::font_info(LyXFont const & f)
break;
}
// Is this an exact match?
if (font.exactMatch()) {
lyxerr[Debug::FONT] << "This font is an exact match" << endl;
} else {
lyxerr[Debug::FONT] << "This font is NOT an exact match"
<< endl;
}
lyxerr[Debug::FONT] << "XFLD: " << font.rawName() << endl;
metrics = QFontMetrics(font);
}
@ -139,13 +149,12 @@ qfont_loader::font_info const * qfont_loader::getfontinfo(LyXFont const & f)
}
font_info * fi = fontinfo_[f.family()][f.series()][f.realShape()][f.size()].get();
if (fi) {
return fi;
} else {
if (!fi) {
fi = new font_info(f);
fontinfo_[f.family()][f.series()][f.realShape()][f.size()].reset(fi);
return fi;
}
return fi;
}