Q3IntDict->QHash (various font tables)

svn path=/trunk/KDE/kdegraphics/okular/; revision=1077795
This commit is contained in:
Luigi Toscano 2010-01-20 22:42:01 +00:00
parent 201216da37
commit 3329a8cd2b
8 changed files with 19 additions and 19 deletions

View file

@ -224,10 +224,10 @@ void TeXFontDefinition::mark_as_used()
// For virtual fonts, also go through the list of referred fonts
if (flags & TeXFontDefinition::FONT_VIRTUAL) {
Q3IntDictIterator<TeXFontDefinition> it(vf_table);
while( it.current() ) {
it.current()->flags |= TeXFontDefinition::FONT_IN_USE;
++it;
QHashIterator<int,TeXFontDefinition*> it(vf_table);
while( it.hasNext() ) {
it.next();
it.value()->flags |= TeXFontDefinition::FONT_IN_USE;
}
}
}

View file

@ -15,7 +15,7 @@
#ifndef _FONT_H
#define _FONT_H
#include <Q3IntDict>
#include <QHash>
#include <cstdio>
@ -110,7 +110,7 @@ class TeXFontDefinition {
// used by (loaded) virtual fonts
macro* macrotable;
// used by (loaded) virtual fonts, list of fonts used by this vf,
Q3IntDict<TeXFontDefinition> vf_table;
QHash<int,TeXFontDefinition*> vf_table;
// acessible by number
// used by (loaded) virtual fonts, list of fonts used by this vf
TeXFontDefinition* first_font;

View file

@ -207,10 +207,10 @@ void dvifile::read_postamble()
// Insert font in dictionary and make sure the dictionary is big
// enough.
if (tn_table.size()-2 <= tn_table.count())
if (tn_table.capacity()-2 <= tn_table.count())
// Not quite optimal. The size of the dictionary should be a
// prime for optimal performance. I don't care.
tn_table.resize(tn_table.size()*2);
tn_table.reserve(tn_table.capacity()*2);
tn_table.insert(TeXnumber, fontp);
}

View file

@ -13,7 +13,7 @@
#include "bigEndianByteReader.h"
#include <Q3IntDict>
#include <QHash>
#include <QIODevice>
#include <QMap>
#include <QVector>
@ -69,7 +69,7 @@ class dvifile : public bigEndianByteReader
KDVI ensures that the user is only informed once. */
bool sourceSpecialMarker;
Q3IntDict<TeXFontDefinition> tn_table;
QHash<int,TeXFontDefinition*> tn_table;
/** Returns the number of centimeters per DVI unit in this DVI
file. */

View file

@ -23,7 +23,7 @@
#include <ksharedptr.h>
#include <kurl.h>
#include <kprogressdialog.h>
#include <Q3IntDict>
#include <QHash>
#include <QPolygon>
#include <QStack>
#include <QVector>
@ -82,7 +82,7 @@ struct drawinf {
TeXFontDefinition* fontp;
set_char_proc set_char_p;
Q3IntDict<TeXFontDefinition>* fonttable;
QHash<int,TeXFontDefinition*>* fonttable;
TeXFontDefinition* _virtual;
};

View file

@ -281,7 +281,7 @@ void dviRenderer::draw_part(double current_dimconv, bool is_vfmacro)
(this->*currinf.set_char_p)(ch, ch);
} else
if (FNTNUM0 <= ch && ch <= (unsigned char) (FNTNUM0 + 63)) {
currinf.fontp = currinf.fonttable->find(ch - FNTNUM0);
currinf.fontp = currinf.fonttable->value(ch - FNTNUM0);
if (currinf.fontp == NULL) {
errorMsg = i18n("The DVI code referred to font #%1, which was not previously defined.", ch - FNTNUM0);
return;
@ -502,7 +502,7 @@ void dviRenderer::draw_part(double current_dimconv, bool is_vfmacro)
case FNT1:
case FNT2:
case FNT3:
currinf.fontp = currinf.fonttable->find(readUINT(ch - FNT1 + 1));
currinf.fontp = currinf.fonttable->value(readUINT(ch - FNT1 + 1));
if (currinf.fontp == NULL) {
errorMsg = i18n("The DVI code referred to a font which was not previously defined.");
return;
@ -511,7 +511,7 @@ void dviRenderer::draw_part(double current_dimconv, bool is_vfmacro)
break;
case FNT4:
currinf.fontp = currinf.fonttable->find(readINT(ch - FNT1 + 1));
currinf.fontp = currinf.fonttable->value(readINT(ch - FNT1 + 1));
if (currinf.fontp == NULL) {
errorMsg = i18n("The DVI code referred to a font which was not previously defined.");
return;

View file

@ -642,7 +642,7 @@ void dviRenderer::prescan(parseSpecials specialParser)
}
if (FNTNUM0 <= ch && ch <= (unsigned char) (FNTNUM0 + 63)) {
currinf.fontp = currinf.fonttable->find(ch - FNTNUM0);
currinf.fontp = currinf.fonttable->value(ch - FNTNUM0);
if (currinf.fontp == NULL) {
errorMsg = i18n("The DVI code referred to font #%1, which was not previously defined.", ch - FNTNUM0);
return;
@ -761,7 +761,7 @@ void dviRenderer::prescan(parseSpecials specialParser)
case FNT2:
case FNT3:
case FNT4:
currinf.fontp = currinf.fonttable->find(readUINT(ch - FNT1 + 1));
currinf.fontp = currinf.fonttable->value(readUINT(ch - FNT1 + 1));
if (currinf.fontp == NULL)
return;
currinf.set_char_p = currinf.fontp->set_char_p;

View file

@ -118,10 +118,10 @@ void TeXFontDefinition::read_VF_index()
// Insert font in dictionary and make sure the dictionary is big
// enough.
if (vf_table.size()-2 <= vf_table.count())
if (vf_table.capacity()-2 <= vf_table.count())
// Not quite optimal. The size of the dictionary should be a
// prime. I don't care.
vf_table.resize(vf_table.size()*2);
vf_table.reserve(vf_table.capacity()*2);
vf_table.insert(TeXnumber, newfontp);
if (first_font == NULL)