Adapt to new KWarning/kFatal/kDebug api

svn path=/trunk/KDE/kdegraphics/okular/; revision=695802
This commit is contained in:
Laurent Montel 2007-08-02 23:54:14 +00:00
parent dea213be87
commit d7193013e2
25 changed files with 203 additions and 203 deletions

View file

@ -38,20 +38,20 @@ extern "C"
{ {
int KDE_EXPORT kdemain( int argc, char **argv ) int KDE_EXPORT kdemain( int argc, char **argv )
{ {
kDebug() << "*** kio_msits Init" << endl; kDebug() << "*** kio_msits Init";
KComponentData instance( "kio_msits" ); KComponentData instance( "kio_msits" );
if ( argc != 4 ) if ( argc != 4 )
{ {
kDebug() << "Usage: kio_msits protocol domain-socket1 domain-socket2" << endl; kDebug() << "Usage: kio_msits protocol domain-socket1 domain-socket2";
exit (-1); exit (-1);
} }
ProtocolMSITS slave ( argv[2], argv[3] ); ProtocolMSITS slave ( argv[2], argv[3] );
slave.dispatchLoop(); slave.dispatchLoop();
kDebug() << "*** kio_msits Done" << endl; kDebug() << "*** kio_msits Done";
return 0; return 0;
} }
} }
@ -83,12 +83,12 @@ void ProtocolMSITS::get( const KUrl& url )
QString fileName; QString fileName;
chmUnitInfo ui; chmUnitInfo ui;
kDebug() << "kio_msits::get() " << url.path() << endl; kDebug() << "kio_msits::get() " << url.path();
if ( !parseLoadAndLookup ( url, fileName ) ) if ( !parseLoadAndLookup ( url, fileName ) )
return; // error() has been called by parseLoadAndLookup return; // error() has been called by parseLoadAndLookup
kDebug() << "kio_msits::get: parseLoadAndLookup returned " << fileName << endl; kDebug() << "kio_msits::get: parseLoadAndLookup returned " << fileName;
if ( isDirectory (fileName) ) if ( isDirectory (fileName) )
{ {
@ -98,7 +98,7 @@ void ProtocolMSITS::get( const KUrl& url )
if ( !ResolveObject ( fileName, &ui) ) if ( !ResolveObject ( fileName, &ui) )
{ {
kDebug() << "kio_msits::get: could not resolve filename " << fileName << endl; kDebug() << "kio_msits::get: could not resolve filename " << fileName;
error( KIO::ERR_DOES_NOT_EXIST, url.prettyUrl() ); error( KIO::ERR_DOES_NOT_EXIST, url.prettyUrl() );
return; return;
} }
@ -107,14 +107,14 @@ void ProtocolMSITS::get( const KUrl& url )
if ( RetrieveObject (&ui, (unsigned char*) buf.data(), 0, ui.length) == 0 ) if ( RetrieveObject (&ui, (unsigned char*) buf.data(), 0, ui.length) == 0 )
{ {
kDebug() << "kio_msits::get: could not retrieve filename " << fileName << endl; kDebug() << "kio_msits::get: could not retrieve filename " << fileName;
error( KIO::ERR_NO_CONTENT, url.prettyUrl() ); error( KIO::ERR_NO_CONTENT, url.prettyUrl() );
return; return;
} }
totalSize( ui.length ); totalSize( ui.length );
KMimeType::Ptr result = KMimeType::findByNameAndContent( fileName, buf ); KMimeType::Ptr result = KMimeType::findByNameAndContent( fileName, buf );
kDebug() << "Emitting mimetype " << result->name() << endl; kDebug() << "Emitting mimetype " << result->name();
mimeType( result->name() ); mimeType( result->name() );
data( buf ); data( buf );
@ -126,7 +126,7 @@ void ProtocolMSITS::get( const KUrl& url )
bool ProtocolMSITS::parseLoadAndLookup ( const KUrl& url, QString& abspath ) bool ProtocolMSITS::parseLoadAndLookup ( const KUrl& url, QString& abspath )
{ {
kDebug() << "ProtocolMSITS::parseLoadAndLookup (const KUrl&) " << url.path() << endl; kDebug() << "ProtocolMSITS::parseLoadAndLookup (const KUrl&) " << url.path();
int pos = url.path().indexOf ("::"); int pos = url.path().indexOf ("::");
@ -139,7 +139,7 @@ bool ProtocolMSITS::parseLoadAndLookup ( const KUrl& url, QString& abspath )
QString filename = url.path().left (pos); QString filename = url.path().left (pos);
abspath = url.path().mid (pos + 2); // skip :: abspath = url.path().mid (pos + 2); // skip ::
kDebug() << "ProtocolMSITS::parseLoadAndLookup: filename " << filename << ", path " << abspath << endl; kDebug() << "ProtocolMSITS::parseLoadAndLookup: filename " << filename << ", path " << abspath;
if ( filename.isEmpty() ) if ( filename.isEmpty() )
{ {
@ -151,7 +151,7 @@ bool ProtocolMSITS::parseLoadAndLookup ( const KUrl& url, QString& abspath )
if ( m_chmFile && filename == m_openedFile ) if ( m_chmFile && filename == m_openedFile )
return true; return true;
kDebug() << "Opening a new CHM file " << filename << endl; kDebug() << "Opening a new CHM file " << filename;
// First try to open a temporary file // First try to open a temporary file
chmFile * tmpchm; chmFile * tmpchm;
@ -169,7 +169,7 @@ bool ProtocolMSITS::parseLoadAndLookup ( const KUrl& url, QString& abspath )
m_chmFile = tmpchm; m_chmFile = tmpchm;
m_openedFile = filename; m_openedFile = filename;
kDebug() << "A CHM file " << filename << " has beed opened successfully" << endl; kDebug() << "A CHM file " << filename << " has beed opened successfully";
return true; return true;
} }
@ -212,7 +212,7 @@ void ProtocolMSITS::stat (const KUrl & url)
QString fileName; QString fileName;
chmUnitInfo ui; chmUnitInfo ui;
kDebug() << "kio_msits::stat (const KUrl& url) " << url.path() << endl; kDebug() << "kio_msits::stat (const KUrl& url) " << url.path();
if ( !parseLoadAndLookup ( url, fileName ) ) if ( !parseLoadAndLookup ( url, fileName ) )
return; // error() has been called by parseLoadAndLookup return; // error() has been called by parseLoadAndLookup
@ -223,7 +223,7 @@ void ProtocolMSITS::stat (const KUrl & url)
return; return;
} }
kDebug() << "kio_msits::stat: adding an entry for " << fileName << endl; kDebug() << "kio_msits::stat: adding an entry for " << fileName;
UDSEntry entry; UDSEntry entry;
if ( isDirectory ( fileName ) ) if ( isDirectory ( fileName ) )
@ -249,7 +249,7 @@ void ProtocolMSITS::listDir (const KUrl & url)
{ {
QString filepath; QString filepath;
kDebug() << "kio_msits::listDir (const KUrl& url) " << url.path() << endl; kDebug() << "kio_msits::listDir (const KUrl& url) " << url.path();
if ( !parseLoadAndLookup ( url, filepath ) ) if ( !parseLoadAndLookup ( url, filepath ) )
return; // error() has been called by parseLoadAndLookup return; // error() has been called by parseLoadAndLookup
@ -262,7 +262,7 @@ void ProtocolMSITS::listDir (const KUrl & url)
return; return;
} }
kDebug() << "kio_msits::listDir: enumerating directory " << filepath << endl; kDebug() << "kio_msits::listDir: enumerating directory " << filepath;
QVector<QString> listing; QVector<QString> listing;

View file

@ -34,7 +34,7 @@ TeXFontDefinition::TeXFontDefinition(const QString &nfontname, double _displayRe
class fontPool *pool, double _enlargement) class fontPool *pool, double _enlargement)
{ {
#ifdef DEBUG_FONT #ifdef DEBUG_FONT
kDebug(kvs::dvi) << "TeXFontDefinition::TeXFontDefinition(...); fontname=" << nfontname << ", enlargement=" << _enlargement << endl; kDebug(kvs::dvi) << "TeXFontDefinition::TeXFontDefinition(...); fontname=" << nfontname << ", enlargement=" << _enlargement;
#endif #endif
enlargement = _enlargement; enlargement = _enlargement;
@ -60,7 +60,7 @@ TeXFontDefinition::TeXFontDefinition(const QString &nfontname, double _displayRe
TeXFontDefinition::~TeXFontDefinition() TeXFontDefinition::~TeXFontDefinition()
{ {
#ifdef DEBUG_FONT #ifdef DEBUG_FONT
kDebug(kvs::dvi) << "discarding font " << fontname << " at " << (int)(enlargement * MFResolutions[font_pool->getMetafontMode()] + 0.5) << " dpi" << endl; kDebug(kvs::dvi) << "discarding font " << fontname << " at " << (int)(enlargement * MFResolutions[font_pool->getMetafontMode()] + 0.5) << " dpi";
#endif #endif
if (font != 0) { if (font != 0) {
@ -86,7 +86,7 @@ TeXFontDefinition::~TeXFontDefinition()
void TeXFontDefinition::fontNameReceiver(const QString& fname) void TeXFontDefinition::fontNameReceiver(const QString& fname)
{ {
#ifdef DEBUG_FONT #ifdef DEBUG_FONT
kDebug(kvs::dvi) << "void TeXFontDefinition::fontNameReceiver( " << fname << " )" << endl; kDebug(kvs::dvi) << "void TeXFontDefinition::fontNameReceiver( " << fname << " )";
#endif #endif
flags |= TeXFontDefinition::FONT_LOADED; flags |= TeXFontDefinition::FONT_LOADED;
@ -120,7 +120,7 @@ void TeXFontDefinition::fontNameReceiver(const QString& fname)
font = new TeXFont_PK(this); font = new TeXFont_PK(this);
set_char_p = &dviRenderer::set_char; set_char_p = &dviRenderer::set_char;
if ((checksum != 0) && (checksum != font->checksum)) if ((checksum != 0) && (checksum != font->checksum))
kWarning(kvs::dvi) << i18n("Checksum mismatch for font file %1", filename) << endl; kWarning(kvs::dvi) << i18n("Checksum mismatch for font file %1", filename) ;
fontTypeName = "TeX PK"; fontTypeName = "TeX PK";
return; return;
} }
@ -152,12 +152,12 @@ void TeXFontDefinition::fontNameReceiver(const QString& fname)
if (enc.isEmpty() == false) { if (enc.isEmpty() == false) {
#ifdef DEBUG_FONT #ifdef DEBUG_FONT
kDebug(kvs::dvi) << "Font " << fontname << " uses encoding " << enc << endl; kDebug(kvs::dvi) << "Font " << fontname << " uses encoding " << enc;
#endif #endif
font = new TeXFont_PFB(this, font_pool->encodingPool.findByName(enc), font_pool->fontsByTeXName.findSlant(fontname) ); font = new TeXFont_PFB(this, font_pool->encodingPool.findByName(enc), font_pool->fontsByTeXName.findSlant(fontname) );
} else { } else {
#ifdef DEBUG_FONT #ifdef DEBUG_FONT
kDebug(kvs::dvi) << "Font " << fontname << " does not have an encoding." << endl; kDebug(kvs::dvi) << "Font " << fontname << " does not have an encoding.";
#endif #endif
font = new TeXFont_PFB(this); font = new TeXFont_PFB(this);
} }
@ -214,7 +214,7 @@ void TeXFontDefinition::setDisplayResolution(double _displayResolution_in_dpi)
void TeXFontDefinition::mark_as_used() void TeXFontDefinition::mark_as_used()
{ {
#ifdef DEBUG_FONT #ifdef DEBUG_FONT
kDebug(kvs::dvi) << "TeXFontDefinition::mark_as_used()" << endl; kDebug(kvs::dvi) << "TeXFontDefinition::mark_as_used()";
#endif #endif
if (flags & TeXFontDefinition::FONT_IN_USE) if (flags & TeXFontDefinition::FONT_IN_USE)

View file

@ -29,9 +29,9 @@ TeXFont_PFB::TeXFont_PFB(TeXFontDefinition *parent, fontEncoding *enc, double sl
{ {
#ifdef DEBUG_PFB #ifdef DEBUG_PFB
if (enc != 0) if (enc != 0)
kDebug(kvs::dvi) << "TeXFont_PFB::TeXFont_PFB( parent=" << parent << ", encoding=" << enc->encodingFullName << " )" << endl; kDebug(kvs::dvi) << "TeXFont_PFB::TeXFont_PFB( parent=" << parent << ", encoding=" << enc->encodingFullName << " )";
else else
kDebug(kvs::dvi) << "TeXFont_PFB::TeXFont_PFB( parent=" << parent << ", encoding=0 )" << endl; kDebug(kvs::dvi) << "TeXFont_PFB::TeXFont_PFB( parent=" << parent << ", encoding=0 )";
#endif #endif
fatalErrorInFontLoading = false; fatalErrorInFontLoading = false;
@ -80,12 +80,12 @@ TeXFont_PFB::TeXFont_PFB(TeXFontDefinition *parent, fontEncoding *enc, double sl
// the FreeType library function 'FT_Get_Name_Index()' to // the FreeType library function 'FT_Get_Name_Index()' to
// associate glyph indices to those names. // associate glyph indices to those names.
#ifdef DEBUG_PFB #ifdef DEBUG_PFB
kDebug(kvs::dvi) << "Trying to associate glyph indices to names from the encoding vector." << endl; kDebug(kvs::dvi) << "Trying to associate glyph indices to names from the encoding vector.";
#endif #endif
for(int i=0; i<256; i++) { for(int i=0; i<256; i++) {
charMap[i] = FT_Get_Name_Index( face, (FT_String *)(enc->glyphNameVector[i].toAscii().data()) ); charMap[i] = FT_Get_Name_Index( face, (FT_String *)(enc->glyphNameVector[i].toAscii().data()) );
#ifdef DEBUG_PFB #ifdef DEBUG_PFB
kDebug(kvs::dvi) << i << ": " << enc->glyphNameVector[i] << ", GlyphIndex=" << charMap[i] << endl; kDebug(kvs::dvi) << i << ": " << enc->glyphNameVector[i] << ", GlyphIndex=" << charMap[i];
#endif #endif
} }
} else { } else {
@ -105,7 +105,7 @@ TeXFont_PFB::TeXFont_PFB(TeXFontDefinition *parent, fontEncoding *enc, double sl
// Feed the charMap array with the charmap data found in the // Feed the charMap array with the charmap data found in the
// previous step. // previous step.
#ifdef DEBUG_PFB #ifdef DEBUG_PFB
kDebug(kvs::dvi) << "No encoding given: using charmap platform=7, encoding=2 that is contained in the font." << endl; kDebug(kvs::dvi) << "No encoding given: using charmap platform=7, encoding=2 that is contained in the font.";
#endif #endif
for(int i=0; i<256; i++) for(int i=0; i<256; i++)
charMap[i] = FT_Get_Char_Index( face, i ); charMap[i] = FT_Get_Char_Index( face, i );
@ -120,7 +120,7 @@ TeXFont_PFB::TeXFont_PFB(TeXFontDefinition *parent, fontEncoding *enc, double sl
} else { } else {
// As a last resort, we use the identity map. // As a last resort, we use the identity map.
#ifdef DEBUG_PFB #ifdef DEBUG_PFB
kDebug(kvs::dvi) << "No encoding given, no suitable charmaps found in the font: using identity charmap." << endl; kDebug(kvs::dvi) << "No encoding given, no suitable charmaps found in the font: using identity charmap.";
#endif #endif
for(int i=0; i<256; i++) for(int i=0; i<256; i++)
charMap[i] = i; charMap[i] = i;
@ -139,7 +139,7 @@ TeXFont_PFB::~TeXFont_PFB()
glyph* TeXFont_PFB::getGlyph(quint16 ch, bool generateCharacterPixmap, const QColor& color) glyph* TeXFont_PFB::getGlyph(quint16 ch, bool generateCharacterPixmap, const QColor& color)
{ {
#ifdef DEBUG_PFB #ifdef DEBUG_PFB
kDebug(kvs::dvi) << "TeXFont_PFB::getGlyph( ch=" << ch << ", '" << (char)(ch) << "', generateCharacterPixmap=" << generateCharacterPixmap << " )" << endl; kDebug(kvs::dvi) << "TeXFont_PFB::getGlyph( ch=" << ch << ", '" << (char)(ch) << "', generateCharacterPixmap=" << generateCharacterPixmap << " )";
#endif #endif
// Paranoia checks // Paranoia checks

View file

@ -79,7 +79,7 @@ TeXFont_PK::TeXFont_PK(TeXFontDefinition *parent)
: TeXFont(parent) : TeXFont(parent)
{ {
#ifdef DEBUG_PK #ifdef DEBUG_PK
kDebug(kvs::dvi) << "TeXFont_PK::TeXFont_PK( parent=" << parent << ")" << endl; kDebug(kvs::dvi) << "TeXFont_PK::TeXFont_PK( parent=" << parent << ")";
#endif #endif
for(unsigned int i=0; i<TeXFontDefinition::max_num_of_chars_in_font; i++) for(unsigned int i=0; i<TeXFontDefinition::max_num_of_chars_in_font; i++)
@ -89,13 +89,13 @@ TeXFont_PK::TeXFont_PK(TeXFontDefinition *parent)
kError(kvs::dvi) << i18n("Cannot open font file %1.", parent->filename) << endl; kError(kvs::dvi) << i18n("Cannot open font file %1.", parent->filename) << endl;
#ifdef DEBUG_PK #ifdef DEBUG_PK
else else
kDebug(kvs::dvi) << "TeXFont_PK::TeXFont_PK(): file opened successfully" << endl; kDebug(kvs::dvi) << "TeXFont_PK::TeXFont_PK(): file opened successfully";
#endif #endif
read_PK_index(); read_PK_index();
#ifdef DEBUG_PK #ifdef DEBUG_PK
kDebug(kvs::dvi) << "TeXFont_PK::TeXFont_PK() ended" << endl; kDebug(kvs::dvi) << "TeXFont_PK::TeXFont_PK() ended";
#endif #endif
} }
@ -114,7 +114,7 @@ TeXFont_PK::~TeXFont_PK()
glyph* TeXFont_PK::getGlyph(quint16 ch, bool generateCharacterPixmap, const QColor& color) glyph* TeXFont_PK::getGlyph(quint16 ch, bool generateCharacterPixmap, const QColor& color)
{ {
#ifdef DEBUG_PK #ifdef DEBUG_PK
kDebug(kvs::dvi) << "TeXFont_PK::getGlyph( ch=" << ch << ", generateCharacterPixmap=" << generateCharacterPixmap << " )" << endl; kDebug(kvs::dvi) << "TeXFont_PK::getGlyph( ch=" << ch << ", generateCharacterPixmap=" << generateCharacterPixmap << " )";
#endif #endif
// Paranoia checks // Paranoia checks
@ -368,7 +368,7 @@ static quint32 bit_masks[33] = {
int TeXFont_PK::PK_get_nyb(FILE *fp) int TeXFont_PK::PK_get_nyb(FILE *fp)
{ {
#ifdef DEBUG_PK #ifdef DEBUG_PK
kDebug(kvs::dvi) << "PK_get_nyb" << endl; kDebug(kvs::dvi) << "PK_get_nyb";
#endif #endif
unsigned temp; unsigned temp;
@ -385,7 +385,7 @@ int TeXFont_PK::PK_get_nyb(FILE *fp)
int TeXFont_PK::PK_packed_num(FILE *fp) int TeXFont_PK::PK_packed_num(FILE *fp)
{ {
#ifdef DEBUG_PK #ifdef DEBUG_PK
kDebug(kvs::dvi) << "PK_packed_num" << endl; kDebug(kvs::dvi) << "PK_packed_num";
#endif #endif
int i, j; int i, j;
@ -417,7 +417,7 @@ int TeXFont_PK::PK_packed_num(FILE *fp)
void TeXFont_PK::PK_skip_specials() void TeXFont_PK::PK_skip_specials()
{ {
#ifdef DEBUG_PK #ifdef DEBUG_PK
kDebug(kvs::dvi) << "TeXFont_PK::PK_skip_specials() called" << endl; kDebug(kvs::dvi) << "TeXFont_PK::PK_skip_specials() called";
#endif #endif
int i,j; int i,j;
@ -425,7 +425,7 @@ void TeXFont_PK::PK_skip_specials()
#ifdef DEBUG_PK #ifdef DEBUG_PK
if (fp == 0) if (fp == 0)
kDebug(kvs::dvi) << "TeXFont_PK::PK_skip_specials(): file == 0" << endl; kDebug(kvs::dvi) << "TeXFont_PK::PK_skip_specials(): file == 0";
#endif #endif
do { do {
@ -455,7 +455,7 @@ void TeXFont_PK::PK_skip_specials()
while (PK_flag_byte != PK_POST && PK_flag_byte >= PK_CMD_START); while (PK_flag_byte != PK_POST && PK_flag_byte >= PK_CMD_START);
#ifdef DEBUG_PK #ifdef DEBUG_PK
kDebug(kvs::dvi) << "TeXFont_PK::PK_skip_specials() ended" << endl; kDebug(kvs::dvi) << "TeXFont_PK::PK_skip_specials() ended";
#endif #endif
} }
@ -463,7 +463,7 @@ void TeXFont_PK::PK_skip_specials()
void TeXFont_PK::read_PK_char(unsigned int ch) void TeXFont_PK::read_PK_char(unsigned int ch)
{ {
#ifdef DEBUG_PK #ifdef DEBUG_PK
kDebug(kvs::dvi) << "read_PK_char" << endl; kDebug(kvs::dvi) << "read_PK_char";
#endif #endif
int i, j; int i, j;
@ -492,7 +492,7 @@ void TeXFont_PK::read_PK_char(unsigned int ch)
n = 1; n = 1;
#ifdef DEBUG_PK #ifdef DEBUG_PK
kDebug(kvs::dvi) << "loading pk char " << ch << ", char type " << n << endl; kDebug(kvs::dvi) << "loading pk char " << ch << ", char type " << n;
#endif #endif
if (characterBitmaps[ch] == 0) if (characterBitmaps[ch] == 0)
@ -550,7 +550,7 @@ void TeXFont_PK::read_PK_char(unsigned int ch)
// (Ultra-)Sparc processors. // (Ultra-)Sparc processors.
#ifdef DEBUG_PK #ifdef DEBUG_PK
kDebug(kvs::dvi) << "big Endian byte ordering" << endl; kDebug(kvs::dvi) << "big Endian byte ordering";
#endif #endif
if (PK_dyn_f == 14) { /* get raster by bits */ if (PK_dyn_f == 14) { /* get raster by bits */
@ -636,7 +636,7 @@ void TeXFont_PK::read_PK_char(unsigned int ch)
// Intel and Alpha processors. // Intel and Alpha processors.
#ifdef DEBUG_PK #ifdef DEBUG_PK
kDebug(kvs::dvi) << "small Endian byte ordering" << endl; kDebug(kvs::dvi) << "small Endian byte ordering";
#endif #endif
if (PK_dyn_f == 14) { /* get raster by bits */ if (PK_dyn_f == 14) { /* get raster by bits */
@ -712,7 +712,7 @@ void TeXFont_PK::read_PK_char(unsigned int ch)
void TeXFont_PK::read_PK_index() void TeXFont_PK::read_PK_index()
{ {
#ifdef DEBUG_PK #ifdef DEBUG_PK
kDebug(kvs::dvi) << "TeXFont_PK::read_PK_index() called" << endl; kDebug(kvs::dvi) << "TeXFont_PK::read_PK_index() called";
#endif #endif
if (file == 0) { if (file == 0) {
@ -734,7 +734,7 @@ void TeXFont_PK::read_PK_index()
int hppp = sfour(file); int hppp = sfour(file);
int vppp = sfour(file); int vppp = sfour(file);
if (hppp != vppp) if (hppp != vppp)
kWarning(kvs::dvi) << i18n("Font has non-square aspect ratio ") << vppp << ":" << hppp << endl; kWarning(kvs::dvi) << i18n("Font has non-square aspect ratio ") << vppp << ":" << hppp ;
// Read glyph directory (really a whole pass over the file). // Read glyph directory (really a whole pass over the file).
for (;;) { for (;;) {
@ -761,10 +761,10 @@ void TeXFont_PK::read_PK_index()
glyphtable[ch].x2 = PK_flag_byte; glyphtable[ch].x2 = PK_flag_byte;
fseek(file, (long) bytes_left, SEEK_CUR); fseek(file, (long) bytes_left, SEEK_CUR);
#ifdef DEBUG_PK #ifdef DEBUG_PK
kDebug(kvs::dvi) << "Scanning pk char " << ch << "at " << glyphtable[ch].addr << endl; kDebug(kvs::dvi) << "Scanning pk char " << ch << "at " << glyphtable[ch].addr;
#endif #endif
} }
#ifdef DEBUG_PK #ifdef DEBUG_PK
kDebug(kvs::dvi) << "TeXFont_PK::read_PK_index() called" << endl; kDebug(kvs::dvi) << "TeXFont_PK::read_PK_index() called";
#endif #endif
} }

View file

@ -21,7 +21,7 @@ TeXFont_TFM::TeXFont_TFM(TeXFontDefinition *parent)
: TeXFont(parent) : TeXFont(parent)
{ {
#ifdef DEBUG_TFM #ifdef DEBUG_TFM
kDebug(kvs::dvi) << "TeXFont_TFM::TeXFont_TFM( parent=" << parent << " )" << endl; kDebug(kvs::dvi) << "TeXFont_TFM::TeXFont_TFM( parent=" << parent << " )";
#endif #endif
QFile file( parent->filename ); QFile file( parent->filename );
@ -36,7 +36,7 @@ TeXFont_TFM::TeXFont_TFM(TeXFontDefinition *parent)
quint16 lf, lh, bc, ec, nw, nh, nd; quint16 lf, lh, bc, ec, nw, nh, nd;
stream >> lf >> lh >> bc >> ec >> nw >> nh >> nd; stream >> lf >> lh >> bc >> ec >> nw >> nh >> nd;
#ifdef DEBUG_TFM #ifdef DEBUG_TFM
kDebug(kvs::dvi) << "lf= " << lf << endl kDebug(kvs::dvi) << "lf= " << lf
<< "lh= " << lh << endl << "lh= " << lh << endl
<< "bc= " << bc << endl << "bc= " << bc << endl
<< "ec= " << ec << endl << "ec= " << ec << endl
@ -54,7 +54,7 @@ TeXFont_TFM::TeXFont_TFM(TeXFontDefinition *parent)
file.seek(24); file.seek(24);
stream >> checksum >> design_size_in_TeX_points.value; stream >> checksum >> design_size_in_TeX_points.value;
#ifdef DEBUG_TFM #ifdef DEBUG_TFM
kDebug(kvs::dvi) << "checksum = " << checksum << endl kDebug(kvs::dvi) << "checksum = " << checksum
<< "design_size = " << design_size_in_TeX_points.toDouble() << " TeX Points" << endl << "design_size = " << design_size_in_TeX_points.toDouble() << " TeX Points" << endl
<< " = " << design_size_in_TeX_points.toDouble()*254.0/7227.0 << " cm" << endl; << " = " << design_size_in_TeX_points.toDouble()*254.0/7227.0 << " cm" << endl;
#endif #endif
@ -121,7 +121,7 @@ TeXFont_TFM::~TeXFont_TFM()
glyph* TeXFont_TFM::getGlyph(quint16 characterCode, bool generateCharacterPixmap, const QColor& color) glyph* TeXFont_TFM::getGlyph(quint16 characterCode, bool generateCharacterPixmap, const QColor& color)
{ {
#ifdef DEBUG_TFM #ifdef DEBUG_TFM
kDebug(kvs::dvi) << "TeXFont_TFM::getGlyph( ch=" << ch << ", generateCharacterPixmap=" << generateCharacterPixmap << " )" << endl; kDebug(kvs::dvi) << "TeXFont_TFM::getGlyph( ch=" << ch << ", generateCharacterPixmap=" << generateCharacterPixmap << " )";
#endif #endif
// Paranoia checks // Paranoia checks

View file

@ -195,7 +195,7 @@ void dvifile::read_postamble()
command_pointer += len; command_pointer += len;
#ifdef DEBUG_FONTS #ifdef DEBUG_FONTS
kDebug(kvs::dvi) << "Postamble: define font \"" << fontname << "\" scale=" << scale << " design=" << design << endl; kDebug(kvs::dvi) << "Postamble: define font \"" << fontname << "\" scale=" << scale << " design=" << design;
#endif #endif
// According to section A.4 of the DVI driver standard, this font // According to section A.4 of the DVI driver standard, this font
@ -233,7 +233,7 @@ void dvifile::read_postamble()
void dvifile::prepare_pages() void dvifile::prepare_pages()
{ {
#ifdef DEBUG_DVIFILE #ifdef DEBUG_DVIFILE
kDebug(kvs::dvi) << "prepare_pages" << endl; kDebug(kvs::dvi) << "prepare_pages";
#endif #endif
if (page_offset.resize(total_pages+1) == false) { if (page_offset.resize(total_pages+1) == false) {
@ -266,7 +266,7 @@ void dvifile::prepare_pages()
dvifile::dvifile(const QString& fname, fontPool* pool) dvifile::dvifile(const QString& fname, fontPool* pool)
{ {
#ifdef DEBUG_DVIFILE #ifdef DEBUG_DVIFILE
kDebug(kvs::dvi) << "init_dvi_file: " << fname << endl; kDebug(kvs::dvi) << "init_dvi_file: " << fname;
#endif #endif
errorMsg.clear(); errorMsg.clear();
@ -312,7 +312,7 @@ dvifile::dvifile(const QString& fname, fontPool* pool)
dvifile::~dvifile() dvifile::~dvifile()
{ {
#ifdef DEBUG_DVIFILE #ifdef DEBUG_DVIFILE
kDebug(kvs::dvi) << "destroy dvi-file" << endl; kDebug(kvs::dvi) << "destroy dvi-file";
#endif #endif
// Delete converted PDF files // Delete converted PDF files

View file

@ -69,7 +69,7 @@ dviRenderer::dviRenderer()
currentlyDrawnPage(0) currentlyDrawnPage(0)
{ {
#ifdef DEBUG_DVIRENDERER #ifdef DEBUG_DVIRENDERER
//kDebug(kvs::dvi) << "dviRenderer( parent=" << par << " )" << endl; //kDebug(kvs::dvi) << "dviRenderer( parent=" << par << " )";
#endif #endif
// connect(&font_pool, SIGNAL( setStatusBarText( const QString& ) ), this, SIGNAL( setStatusBarText( const QString& ) ) ); // connect(&font_pool, SIGNAL( setStatusBarText( const QString& ) ), this, SIGNAL( setStatusBarText( const QString& ) ) );
@ -82,7 +82,7 @@ dviRenderer::dviRenderer()
dviRenderer::~dviRenderer() dviRenderer::~dviRenderer()
{ {
#ifdef DEBUG_DVIRENDERER #ifdef DEBUG_DVIRENDERER
kDebug(kvs::dvi) << "~dviRenderer" << endl; kDebug(kvs::dvi) << "~dviRenderer";
#endif #endif
QMutexLocker locker(&mutex); QMutexLocker locker(&mutex);
@ -117,7 +117,7 @@ void dviRenderer::showInfo()
void dviRenderer::drawPage(RenderedDocumentPagePixmap* page) void dviRenderer::drawPage(RenderedDocumentPagePixmap* page)
{ {
#ifdef DEBUG_DVIRENDERER #ifdef DEBUG_DVIRENDERER
//kDebug(kvs::dvi) << "dviRenderer::drawPage(documentPage *) called, page number " << page->pageNumber << endl; //kDebug(kvs::dvi) << "dviRenderer::drawPage(documentPage *) called, page number " << page->pageNumber;
#endif #endif
// Paranoid safety checks // Paranoid safety checks
@ -177,7 +177,7 @@ void dviRenderer::drawPage(RenderedDocumentPagePixmap* page)
} }
else else
{ {
kDebug(kvs::dvi) << "painter creation failed." << endl; kDebug(kvs::dvi) << "painter creation failed.";
} }
page->img = img; page->img = img;
//page->setImage(img); //page->setImage(img);
@ -324,7 +324,7 @@ void dviRenderer::showThatSourceInformationIsPresent()
void dviRenderer::embedPostScript() void dviRenderer::embedPostScript()
{ {
#ifdef DEBUG_DVIRENDERER #ifdef DEBUG_DVIRENDERER
kDebug(kvs::dvi) << "dviRenderer::embedPostScript()" << endl; kDebug(kvs::dvi) << "dviRenderer::embedPostScript()";
#endif #endif
if (!dviFile) if (!dviFile)
@ -370,7 +370,7 @@ void dviRenderer::embedPostScript()
// Prescan phase starts here // Prescan phase starts here
#ifdef PERFORMANCE_MEASUREMENT #ifdef PERFORMANCE_MEASUREMENT
//kDebug(kvs::dvi) << "Time elapsed till prescan phase starts " << performanceTimer.elapsed() << "ms" << endl; //kDebug(kvs::dvi) << "Time elapsed till prescan phase starts " << performanceTimer.elapsed() << "ms";
//QTime preScanTimer; //QTime preScanTimer;
//preScanTimer.start(); //preScanTimer.start();
#endif #endif
@ -399,7 +399,7 @@ void dviRenderer::embedPostScript()
#ifdef PERFORMANCE_MEASUREMENT #ifdef PERFORMANCE_MEASUREMENT
//kDebug(kvs::dvi) << "Time required for prescan phase: " << preScanTimer.restart() << "ms" << endl; //kDebug(kvs::dvi) << "Time required for prescan phase: " << preScanTimer.restart() << "ms";
#endif #endif
current_page = currPageSav; current_page = currPageSav;
_isModified = true; _isModified = true;
@ -432,7 +432,7 @@ bool dviRenderer::isValidFile(const QString& filename) const
bool dviRenderer::setFile(const QString &fname, const KUrl &base) bool dviRenderer::setFile(const QString &fname, const KUrl &base)
{ {
#ifdef DEBUG_DVIRENDERER #ifdef DEBUG_DVIRENDERER
kDebug(kvs::dvi) << "dviRenderer::setFile( fname='" << fname << "' )"<<endl; //, ref='" << ref << "', sourceMarker=" << sourceMarker << " )" << endl; kDebug(kvs::dvi) << "dviRenderer::setFile( fname='" << fname << "' )"; //, ref='" << ref << "', sourceMarker=" << sourceMarker << " )";
#endif #endif
//QMutexLocker lock(&mutex); //QMutexLocker lock(&mutex);
@ -531,7 +531,7 @@ bool dviRenderer::setFile(const QString &fname, const KUrl &base)
// PRESCAN STARTS HERE // PRESCAN STARTS HERE
#ifdef PERFORMANCE_MEASUREMENT #ifdef PERFORMANCE_MEASUREMENT
//kDebug(kvs::dvi) << "Time elapsed till prescan phase starts " << performanceTimer.elapsed() << "ms" << endl; //kDebug(kvs::dvi) << "Time elapsed till prescan phase starts " << performanceTimer.elapsed() << "ms";
//QTime preScanTimer; //QTime preScanTimer;
//preScanTimer.start(); //preScanTimer.start();
#endif #endif
@ -580,7 +580,7 @@ bool dviRenderer::setFile(const QString &fname, const KUrl &base)
#endif #endif
#ifdef PERFORMANCE_MEASUREMENT #ifdef PERFORMANCE_MEASUREMENT
//kDebug(kvs::dvi) << "Time required for prescan phase: " << preScanTimer.restart() << "ms" << endl; //kDebug(kvs::dvi) << "Time required for prescan phase: " << preScanTimer.restart() << "ms";
#endif #endif
current_page = currPageSav; current_page = currPageSav;
// PRESCAN ENDS HERE // PRESCAN ENDS HERE

View file

@ -77,7 +77,7 @@ extern QPainter *foreGroundPainter;
void dviRenderer::set_char(unsigned int cmd, unsigned int ch) void dviRenderer::set_char(unsigned int cmd, unsigned int ch)
{ {
#ifdef DEBUG_RENDER #ifdef DEBUG_RENDER
kDebug(kvs::dvi) << "set_char #" << ch << endl; kDebug(kvs::dvi) << "set_char #" << ch;
#endif #endif
glyph *g; glyph *g;
@ -206,7 +206,7 @@ void dviRenderer::set_empty_char(unsigned int, unsigned int)
void dviRenderer::set_vf_char(unsigned int cmd, unsigned int ch) void dviRenderer::set_vf_char(unsigned int cmd, unsigned int ch)
{ {
#ifdef DEBUG_RENDER #ifdef DEBUG_RENDER
kDebug(kvs::dvi) << "dviRenderer::set_vf_char( cmd=" << cmd << ", ch=" << ch << " )" << endl; kDebug(kvs::dvi) << "dviRenderer::set_vf_char( cmd=" << cmd << ", ch=" << ch << " )";
#endif #endif
static unsigned char c; static unsigned char c;
@ -247,7 +247,7 @@ void dviRenderer::set_vf_char(unsigned int cmd, unsigned int ch)
void dviRenderer::set_no_char(unsigned int cmd, unsigned int ch) void dviRenderer::set_no_char(unsigned int cmd, unsigned int ch)
{ {
#ifdef DEBUG_RENDER #ifdef DEBUG_RENDER
kDebug(kvs::dvi) << "dviRenderer::set_no_char( cmd=" << cmd << ", ch =" << ch << " )" << endl; kDebug(kvs::dvi) << "dviRenderer::set_no_char( cmd=" << cmd << ", ch =" << ch << " )" ;
#endif #endif
if (currinf._virtual) { if (currinf._virtual) {
@ -267,7 +267,7 @@ void dviRenderer::set_no_char(unsigned int cmd, unsigned int ch)
void dviRenderer::draw_part(double current_dimconv, bool is_vfmacro) void dviRenderer::draw_part(double current_dimconv, bool is_vfmacro)
{ {
#ifdef DEBUG_RENDER #ifdef DEBUG_RENDER
kDebug(kvs::dvi) << "draw_part" << endl; kDebug(kvs::dvi) << "draw_part";
#endif #endif
qint32 RRtmp=0, WWtmp=0, XXtmp=0, YYtmp=0, ZZtmp=0; qint32 RRtmp=0, WWtmp=0, XXtmp=0, YYtmp=0, ZZtmp=0;
@ -368,7 +368,7 @@ void dviRenderer::draw_part(double current_dimconv, bool is_vfmacro)
// that at the end of a page, the stack should always be // that at the end of a page, the stack should always be
// empty. // empty.
if (!stack.isEmpty()) { if (!stack.isEmpty()) {
kDebug(kvs::dvi) << "DRAW: The stack was not empty when the EOP command was encountered." << endl; kDebug(kvs::dvi) << "DRAW: The stack was not empty when the EOP command was encountered.";
errorMsg = i18n("The stack was not empty when the EOP command was encountered."); errorMsg = i18n("The stack was not empty when the EOP command was encountered.");
return; return;
} }
@ -590,14 +590,14 @@ void dviRenderer::draw_page()
// elapsed till the kdvi_multipage was constructed, and print // elapsed till the kdvi_multipage was constructed, and print
// it. Set the flag so that is message will not be printed again. // it. Set the flag so that is message will not be printed again.
if (performanceFlag == 0) { if (performanceFlag == 0) {
kDebug(kvs::dvi) << "Time elapsed till the first page is drawn: " << performanceTimer.restart() << "ms" << endl; kDebug(kvs::dvi) << "Time elapsed till the first page is drawn: " << performanceTimer.restart() << "ms";
performanceFlag = 1; performanceFlag = 1;
} }
#endif #endif
#ifdef DEBUG_RENDER #ifdef DEBUG_RENDER
kDebug(kvs::dvi) <<"draw_page" << endl; kDebug(kvs::dvi) <<"draw_page";
#endif #endif
#if 0 #if 0

View file

@ -41,7 +41,7 @@ extern void parse_special_argument(const QString& strg, const char* argument_nam
void dviRenderer::prescan_embedPS(char *cp, quint8 *beginningOfSpecialCommand) void dviRenderer::prescan_embedPS(char *cp, quint8 *beginningOfSpecialCommand)
{ {
#ifdef DEBUG_PRESCAN #ifdef DEBUG_PRESCAN
kDebug(kvs::dvi) << "dviRenderer::prescan_embedPS( cp = " << cp << " ) " << endl; kDebug(kvs::dvi) << "dviRenderer::prescan_embedPS( cp = " << cp << " ) ";
#endif #endif
// Encapsulated Postscript File // Encapsulated Postscript File
@ -226,7 +226,7 @@ void dviRenderer::prescan_embedPS(char *cp, quint8 *beginningOfSpecialCommand)
void dviRenderer::prescan_removePageSizeInfo(char *cp, quint8 *beginningOfSpecialCommand) void dviRenderer::prescan_removePageSizeInfo(char *cp, quint8 *beginningOfSpecialCommand)
{ {
#ifdef DEBUG_PRESCAN #ifdef DEBUG_PRESCAN
kDebug(kvs::dvi) << "dviRenderer::prescan_embedPS( cp = " << cp << " ) " << endl; kDebug(kvs::dvi) << "dviRenderer::prescan_embedPS( cp = " << cp << " ) ";
#endif #endif
// Encapsulated Postscript File // Encapsulated Postscript File
@ -241,7 +241,7 @@ void dviRenderer::prescan_removePageSizeInfo(char *cp, quint8 *beginningOfSpecia
void dviRenderer::prescan_ParsePapersizeSpecial(const QString& _cp) void dviRenderer::prescan_ParsePapersizeSpecial(const QString& _cp)
{ {
#ifdef DEBUG_PRESCAN #ifdef DEBUG_PRESCAN
kDebug(kvs::dvi) << "Papersize-Special : papersize" << _cp << endl; kDebug(kvs::dvi) << "Papersize-Special : papersize" << _cp;
#endif #endif
QString cp = _cp.simplified(); QString cp = _cp.simplified();
@ -280,7 +280,7 @@ void dviRenderer::prescan_ParseHTMLAnchorSpecial(const QString& _cp)
void dviRenderer::prescan_ParsePSHeaderSpecial(const QString& cp) void dviRenderer::prescan_ParsePSHeaderSpecial(const QString& cp)
{ {
#ifdef DEBUG_PRESCAN #ifdef DEBUG_PRESCAN
kDebug(kvs::dvi) << "PostScript-special, header " << cp.latin1() << endl; kDebug(kvs::dvi) << "PostScript-special, header " << cp.latin1();
#endif #endif
QString _file = cp; QString _file = cp;
@ -303,7 +303,7 @@ void dviRenderer::prescan_ParsePSHeaderSpecial(const QString& cp)
void dviRenderer::prescan_ParsePSBangSpecial(const QString& cp) void dviRenderer::prescan_ParsePSBangSpecial(const QString& cp)
{ {
#ifdef DEBUG_PRESCAN #ifdef DEBUG_PRESCAN
kDebug(kvs::dvi) << "PostScript-special, literal header " << cp.latin1() << endl; kDebug(kvs::dvi) << "PostScript-special, literal header " << cp.latin1();
#endif #endif
PS_interface->PostScriptHeaderString->append( " @defspecial \n" ); PS_interface->PostScriptHeaderString->append( " @defspecial \n" );
@ -330,7 +330,7 @@ void dviRenderer::prescan_ParsePSQuoteSpecial(const QString& cp)
void dviRenderer::prescan_ParsePSSpecial(const QString& cp) void dviRenderer::prescan_ParsePSSpecial(const QString& cp)
{ {
#ifdef DEBUG_PRESCAN #ifdef DEBUG_PRESCAN
kDebug(kvs::dvi) << "PostScript-special, direct PostScript " << cp << endl; kDebug(kvs::dvi) << "PostScript-special, direct PostScript " << cp;
#endif #endif
// Unfortunately, in some TeX distribution the hyperref package uses // Unfortunately, in some TeX distribution the hyperref package uses
@ -394,7 +394,7 @@ void dviRenderer::prescan_ParsePSSpecial(const QString& cp)
void dviRenderer::prescan_ParsePSFileSpecial(const QString& cp) void dviRenderer::prescan_ParsePSFileSpecial(const QString& cp)
{ {
#ifdef DEBUG_PRESCAN #ifdef DEBUG_PRESCAN
kDebug(kvs::dvi) << "epsf-special: psfile=" << cp <<endl; kDebug(kvs::dvi) << "epsf-special: psfile=" << cp;
#endif #endif
QString include_command = cp.simplified(); QString include_command = cp.simplified();
@ -618,7 +618,7 @@ void dviRenderer::prescan_setChar(unsigned int ch)
void dviRenderer::prescan(parseSpecials specialParser) void dviRenderer::prescan(parseSpecials specialParser)
{ {
#ifdef DEBUG_PRESCAN #ifdef DEBUG_PRESCAN
kDebug(kvs::dvi) << "dviRenderer::prescan( ... )" << endl; kDebug(kvs::dvi) << "dviRenderer::prescan( ... )";
#endif #endif
if (resolutionInDPI == 0.0) if (resolutionInDPI == 0.0)

View file

@ -26,7 +26,7 @@ DVI_SourceFileSplitter::DVI_SourceFileSplitter(const QString &srclink, const QSt
bool possibleNumberMixUp = false; bool possibleNumberMixUp = false;
#ifdef DEBUG_SOURCESPLITTER #ifdef DEBUG_SOURCESPLITTER
kDebug(kvs::dvi) << "DVI_SourceSplitter: srclink " << srclink << endl; kDebug(kvs::dvi) << "DVI_SourceSplitter: srclink " << srclink;
#endif #endif
//remove src: if necessary //remove src: if necessary
@ -46,7 +46,7 @@ DVI_SourceFileSplitter::DVI_SourceFileSplitter(const QString &srclink, const QSt
linepart = linepart.trimmed(); linepart = linepart.trimmed();
#ifdef DEBUG_SOURCESPLITTER #ifdef DEBUG_SOURCESPLITTER
kDebug(kvs::dvi) << "DVI_SourceSplitter: filepart " << filepart << " linepart " << linepart << endl; kDebug(kvs::dvi) << "DVI_SourceSplitter: filepart " << filepart << " linepart " << linepart;
#endif #endif
//test if the file exists //test if the file exists
@ -70,12 +70,12 @@ DVI_SourceFileSplitter::DVI_SourceFileSplitter(const QString &srclink, const QSt
{ {
tempInfo.setFile(linepart.right(index) + tempFileName); tempInfo.setFile(linepart.right(index) + tempFileName);
#ifdef DEBUG_SOURCESPLITTER #ifdef DEBUG_SOURCESPLITTER
kDebug(kvs::dvi) << "DVI_SourceSplitter: trying " << tempInfo.fileName() << endl; kDebug(kvs::dvi) << "DVI_SourceSplitter: trying " << tempInfo.fileName();
#endif #endif
if ( tempInfo.exists() ) { found = true; break;} if ( tempInfo.exists() ) { found = true; break;}
tempInfo.setFile(linepart.right(index) + tempFileName + ".tex"); tempInfo.setFile(linepart.right(index) + tempFileName + ".tex");
#ifdef DEBUG_SOURCESPLITTER #ifdef DEBUG_SOURCESPLITTER
kDebug(kvs::dvi) << "DVI_SourceSplitter: trying " << tempInfo.fileName() << endl; kDebug(kvs::dvi) << "DVI_SourceSplitter: trying " << tempInfo.fileName();
#endif #endif
if ( tempInfo.exists() ) { found = true; break;} if ( tempInfo.exists() ) { found = true; break;}
} }
@ -92,6 +92,6 @@ DVI_SourceFileSplitter::DVI_SourceFileSplitter(const QString &srclink, const QSt
if (!ok) m_line = 0; if (!ok) m_line = 0;
#ifdef DEBUG_SOURCESPLITTER #ifdef DEBUG_SOURCESPLITTER
kDebug(kvs::dvi) << "DVI_SourceSplitter: result: file " << m_fileInfo.absoluteFilePath() << " line " << m_line << endl; kDebug(kvs::dvi) << "DVI_SourceSplitter: result: file " << m_fileInfo.absoluteFilePath() << " line " << m_line;
#endif #endif
} }

View file

@ -23,7 +23,7 @@
fontEncoding::fontEncoding(const QString &encName) fontEncoding::fontEncoding(const QString &encName)
{ {
#ifdef DEBUG_FONTENC #ifdef DEBUG_FONTENC
kDebug(kvs::dvi) << "fontEncoding( " << encName << " )" << endl; kDebug(kvs::dvi) << "fontEncoding( " << encName << " )";
#endif #endif
_isValid = false; _isValid = false;
@ -50,7 +50,7 @@ fontEncoding::fontEncoding(const QString &encName)
} }
#ifdef DEBUG_FONTENC #ifdef DEBUG_FONTENC
kDebug(kvs::dvi) << "FileName of the encoding: " << encFileName << endl; kDebug(kvs::dvi) << "FileName of the encoding: " << encFileName;
#endif #endif
QFile file( encFileName ); QFile file( encFileName );
@ -68,7 +68,7 @@ fontEncoding::fontEncoding(const QString &encName)
// Find the name of the encoding // Find the name of the encoding
encodingFullName = fileContent.section('[', 0, 0).simplified().mid(1); encodingFullName = fileContent.section('[', 0, 0).simplified().mid(1);
#ifdef DEBUG_FONTENC #ifdef DEBUG_FONTENC
kDebug(kvs::dvi) << "encodingFullName: " << encodingFullName << endl; kDebug(kvs::dvi) << "encodingFullName: " << encodingFullName;
#endif #endif
fileContent = fileContent.section('[', 1, 1).section(']',0,0).simplified(); fileContent = fileContent.section('[', 1, 1).section(']',0,0).simplified();
@ -78,7 +78,7 @@ fontEncoding::fontEncoding(const QString &encName)
for ( QStringList::Iterator it = glyphNameList.begin(); (it != glyphNameList.end())&&(i<256); ++it ) { for ( QStringList::Iterator it = glyphNameList.begin(); (it != glyphNameList.end())&&(i<256); ++it ) {
glyphNameVector[i] = (*it).simplified(); glyphNameVector[i] = (*it).simplified();
#ifdef DEBUG_FONTENC #ifdef DEBUG_FONTENC
kDebug(kvs::dvi) << i << ": " << glyphNameVector[i] << endl; kDebug(kvs::dvi) << i << ": " << glyphNameVector[i];
#endif #endif
i++; i++;
} }

View file

@ -112,7 +112,7 @@ fontMap::fontMap()
kError(kvs::dvi) << QString("fontMap::fontMap(): The file '%1' could not be opened.").arg(map_fileName) << endl; kError(kvs::dvi) << QString("fontMap::fontMap(): The file '%1' could not be opened.").arg(map_fileName) << endl;
#ifdef DEBUG_FONTMAP #ifdef DEBUG_FONTMAP
kDebug(kvs::dvi) << "FontMap file parsed. Results:" << endl; kDebug(kvs::dvi) << "FontMap file parsed. Results:";
QMap<QString, fontMapEntry>::Iterator it; QMap<QString, fontMapEntry>::Iterator it;
for ( it = fontMapEntries.begin(); it != fontMapEntries.end(); ++it ) for ( it = fontMapEntries.begin(); it != fontMapEntries.end(); ++it )
kDebug(kvs::dvi) << "TeXName: " << it.key() kDebug(kvs::dvi) << "TeXName: " << it.key()

View file

@ -44,7 +44,7 @@ fontPool::fontPool()
0) 0)
{ {
#ifdef DEBUG_FONTPOOL #ifdef DEBUG_FONTPOOL
kDebug(kvs::dvi) << "fontPool::fontPool() called" << endl; kDebug(kvs::dvi) << "fontPool::fontPool() called";
#endif #endif
setObjectName("Font Pool"); setObjectName("Font Pool");
@ -89,12 +89,12 @@ fontPool::fontPool()
if ((result == 0xff) || (result == 0x00)) { if ((result == 0xff) || (result == 0x00)) {
#ifdef DEBUG_FONTPOOL #ifdef DEBUG_FONTPOOL
kDebug(kvs::dvi) << "fontPool::fontPool(): QPixmap does not support the alpha channel" << endl; kDebug(kvs::dvi) << "fontPool::fontPool(): QPixmap does not support the alpha channel";
#endif #endif
QPixmapSupportsAlpha = false; QPixmapSupportsAlpha = false;
} else { } else {
#ifdef DEBUG_FONTPOOL #ifdef DEBUG_FONTPOOL
kDebug(kvs::dvi) << "fontPool::fontPool(): QPixmap supports the alpha channel" << endl; kDebug(kvs::dvi) << "fontPool::fontPool(): QPixmap supports the alpha channel";
#endif #endif
QPixmapSupportsAlpha = true; QPixmapSupportsAlpha = true;
} }
@ -104,7 +104,7 @@ fontPool::fontPool()
fontPool::~fontPool() fontPool::~fontPool()
{ {
#ifdef DEBUG_FONTPOOL #ifdef DEBUG_FONTPOOL
kDebug(kvs::dvi) << "fontPool::~fontPool() called" << endl; kDebug(kvs::dvi) << "fontPool::~fontPool() called";
#endif #endif
#ifdef HAVE_FREETYPE #ifdef HAVE_FREETYPE
@ -169,7 +169,7 @@ TeXFontDefinition* fontPool::appendx(const QString& fontname, quint32 checksum,
QString fontPool::status() QString fontPool::status()
{ {
#ifdef DEBUG_FONTPOOL #ifdef DEBUG_FONTPOOL
kDebug(kvs::dvi) << "fontPool::status() called" << endl; kDebug(kvs::dvi) << "fontPool::status() called";
#endif #endif
QString text; QString text;
@ -225,7 +225,7 @@ QString fontPool::status()
bool fontPool::areFontsLocated() bool fontPool::areFontsLocated()
{ {
#ifdef DEBUG_FONTPOOL #ifdef DEBUG_FONTPOOL
kDebug(kvs::dvi) << "fontPool::areFontsLocated() called" << endl; kDebug(kvs::dvi) << "fontPool::areFontsLocated() called";
#endif #endif
// Is there a font whose name we did not try to find out yet? // Is there a font whose name we did not try to find out yet?
@ -237,7 +237,7 @@ bool fontPool::areFontsLocated()
} }
#ifdef DEBUG_FONTPOOL #ifdef DEBUG_FONTPOOL
kDebug(kvs::dvi) << "... yes, all fonts are located (but not necessarily loaded)." << endl; kDebug(kvs::dvi) << "... yes, all fonts are located (but not necessarily loaded).";
#endif #endif
return true; // That says that all fonts are located. return true; // That says that all fonts are located.
} }
@ -406,7 +406,7 @@ void fontPool::locateFonts(bool makePK, bool locateTFMonly, bool *virtualFontsFo
if (matchingFiles.isEmpty() != true) { if (matchingFiles.isEmpty() != true) {
#ifdef DEBUG_FONTPOOL #ifdef DEBUG_FONTPOOL
kDebug(kvs::dvi) << "Associated " << fontp->fontname << " to " << matchingFiles.first() << endl; kDebug(kvs::dvi) << "Associated " << fontp->fontname << " to " << matchingFiles.first();
#endif #endif
QString fname = matchingFiles.first(); QString fname = matchingFiles.first();
fontp->fontNameReceiver(fname); fontp->fontNameReceiver(fname);
@ -430,7 +430,7 @@ void fontPool::locateFonts(bool makePK, bool locateTFMonly, bool *virtualFontsFo
void fontPool::setCMperDVIunit( double _CMperDVI ) void fontPool::setCMperDVIunit( double _CMperDVI )
{ {
#ifdef DEBUG_FONTPOOL #ifdef DEBUG_FONTPOOL
kDebug(kvs::dvi) << "fontPool::setCMperDVIunit( " << _CMperDVI << " )" << endl; kDebug(kvs::dvi) << "fontPool::setCMperDVIunit( " << _CMperDVI << " )";
#endif #endif
if (CMperDVIunit == _CMperDVI) if (CMperDVIunit == _CMperDVI)
@ -449,7 +449,7 @@ void fontPool::setCMperDVIunit( double _CMperDVI )
void fontPool::setDisplayResolution( double _displayResolution_in_dpi ) void fontPool::setDisplayResolution( double _displayResolution_in_dpi )
{ {
#ifdef DEBUG_FONTPOOL #ifdef DEBUG_FONTPOOL
kDebug(kvs::dvi) << "fontPool::setDisplayResolution( displayResolution_in_dpi=" << _displayResolution_in_dpi << " ) called" << endl; kDebug(kvs::dvi) << "fontPool::setDisplayResolution( displayResolution_in_dpi=" << _displayResolution_in_dpi << " ) called";
#endif #endif
// Ignore minute changes by less than 2 DPI. The difference would // Ignore minute changes by less than 2 DPI. The difference would
@ -458,7 +458,7 @@ void fontPool::setDisplayResolution( double _displayResolution_in_dpi )
// changes the window size by 1 pixel all the time. // changes the window size by 1 pixel all the time.
if ( fabs(displayResolution_in_dpi - _displayResolution_in_dpi) <= 2.0 ) { if ( fabs(displayResolution_in_dpi - _displayResolution_in_dpi) <= 2.0 ) {
#ifdef DEBUG_FONTPOOL #ifdef DEBUG_FONTPOOL
kDebug(kvs::dvi) << "fontPool::setDisplayResolution(...): resolution wasn't changed. Aborting." << endl; kDebug(kvs::dvi) << "fontPool::setDisplayResolution(...): resolution wasn't changed. Aborting.";
#endif #endif
return; return;
} }
@ -493,7 +493,7 @@ void fontPool::markFontsAsLocated()
void fontPool::mark_fonts_as_unused() void fontPool::mark_fonts_as_unused()
{ {
#ifdef DEBUG_FONTPOOL #ifdef DEBUG_FONTPOOL
kDebug(kvs::dvi) << "fontPool::mark_fonts_as_unused() called" << endl; kDebug(kvs::dvi) << "fontPool::mark_fonts_as_unused() called";
#endif #endif
TeXFontDefinition *fontp = fontList.first(); TeXFontDefinition *fontp = fontList.first();
@ -507,7 +507,7 @@ void fontPool::mark_fonts_as_unused()
void fontPool::release_fonts() void fontPool::release_fonts()
{ {
#ifdef DEBUG_FONTPOOL #ifdef DEBUG_FONTPOOL
kDebug(kvs::dvi) << "Release_fonts" << endl; kDebug(kvs::dvi) << "Release_fonts";
#endif #endif
TeXFontDefinition *fontp = fontList.first(); TeXFontDefinition *fontp = fontList.first();

View file

@ -40,14 +40,14 @@ DviGenerator::DviGenerator() : Okular::Generator(),
bool DviGenerator::loadDocument( const QString & fileName, QVector< Okular::Page * > &pagesVector ) bool DviGenerator::loadDocument( const QString & fileName, QVector< Okular::Page * > &pagesVector )
{ {
//kDebug() << "file: " << qPrintable( fileName ) << endl; //kDebug() << "file: " << qPrintable( fileName );
KUrl base( fileName ); KUrl base( fileName );
m_dviRenderer = new dviRenderer(); m_dviRenderer = new dviRenderer();
if ( ! m_dviRenderer->setFile( fileName, base ) ) if ( ! m_dviRenderer->setFile( fileName, base ) )
return false; return false;
kDebug() << "# of pages: " << m_dviRenderer->dviFile->total_pages << endl; kDebug() << "# of pages: " << m_dviRenderer->dviFile->total_pages;
m_resolution = Okular::Utils::dpiY(); m_resolution = Okular::Utils::dpiY();
loadPages( pagesVector, 0 ); loadPages( pagesVector, 0 );
@ -223,7 +223,7 @@ void DviGenerator::generatePixmap( Okular::PixmapRequest *request )
if ( ! pageInfo->img.isNull() ) if ( ! pageInfo->img.isNull() )
{ {
kDebug() << "Image OK" << endl; kDebug() << "Image OK";
request->page()->setPixmap( request->id(), new QPixmap( QPixmap::fromImage( pageInfo->img ) ) ); request->page()->setPixmap( request->id(), new QPixmap( QPixmap::fromImage( pageInfo->img ) ) );
@ -241,7 +241,7 @@ void DviGenerator::generatePixmap( Okular::PixmapRequest *request )
Okular::TextPage* DviGenerator::textPage( Okular::Page *page ) Okular::TextPage* DviGenerator::textPage( Okular::Page *page )
{ {
kDebug() << "DviGenerator::textPage( Okular::Page * page )" << endl; kDebug() << "DviGenerator::textPage( Okular::Page * page )";
dviPageInfo *pageInfo = new dviPageInfo(); dviPageInfo *pageInfo = new dviPageInfo();
pageSize ps; pageSize ps;
@ -377,7 +377,7 @@ void DviGenerator::loadPages( QVector< Okular::Page * > &pagesVector, int orient
int numofpages = m_dviRenderer->dviFile->total_pages; int numofpages = m_dviRenderer->dviFile->total_pages;
pagesVector.resize( numofpages ); pagesVector.resize( numofpages );
//kDebug() << "resolution: " << m_resolution << ", dviFile->preferred? " << endl; //kDebug() << "resolution: " << m_resolution << ", dviFile->preferred? ";
/* get the suggested size */ /* get the suggested size */
if ( m_dviRenderer->dviFile->suggestedPageSize ) if ( m_dviRenderer->dviFile->suggestedPageSize )
@ -401,7 +401,7 @@ void DviGenerator::loadPages( QVector< Okular::Page * > &pagesVector, int orient
for ( int i = 0; i < numofpages; ++i ) for ( int i = 0; i < numofpages; ++i )
{ {
//kDebug() << "getting status of page " << i << ":" << endl; //kDebug() << "getting status of page " << i << ":";
if ( pagesVector[i] ) if ( pagesVector[i] )
{ {
@ -414,7 +414,7 @@ void DviGenerator::loadPages( QVector< Okular::Page * > &pagesVector, int orient
(Okular::Rotation)orientation ); (Okular::Rotation)orientation );
pagesVector[i] = page; pagesVector[i] = page;
} }
kDebug() << "pagesVector successfully inizialized ! " << endl; kDebug() << "pagesVector successfully inizialized ! ";
// filling the pages with the source references rects // filling the pages with the source references rects
const QVector<DVI_SourceFileAnchor>& sourceAnchors = m_dviRenderer->sourceAnchors(); const QVector<DVI_SourceFileAnchor>& sourceAnchors = m_dviRenderer->sourceAnchors();

View file

@ -16,7 +16,7 @@
glyph::glyph() glyph::glyph()
{ {
#ifdef DEBUG_GLYPH #ifdef DEBUG_GLYPH
kDebug(kvs::dvi) << "glyph::glyph()" << endl; kDebug(kvs::dvi) << "glyph::glyph()";
#endif #endif
addr = 0; addr = 0;

View file

@ -66,7 +66,7 @@ ghostscript_interface::~ghostscript_interface() {
void ghostscript_interface::setPostScript(const PageNumber& page, const QString& PostScript) { void ghostscript_interface::setPostScript(const PageNumber& page, const QString& PostScript) {
#ifdef DEBUG_PSGS #ifdef DEBUG_PSGS
kDebug(kvs::dvi) << "ghostscript_interface::setPostScript( " << page << ", ... )" << endl; kDebug(kvs::dvi) << "ghostscript_interface::setPostScript( " << page << ", ... )";
#endif #endif
if (pageList.find(page) == 0) { if (pageList.find(page) == 0) {
@ -90,7 +90,7 @@ void ghostscript_interface::setIncludePath(const QString &_includePath) {
void ghostscript_interface::setBackgroundColor(const PageNumber& page, const QColor& background_color, bool permanent) { void ghostscript_interface::setBackgroundColor(const PageNumber& page, const QColor& background_color, bool permanent) {
#ifdef DEBUG_PSGS #ifdef DEBUG_PSGS
kDebug(kvs::dvi) << "ghostscript_interface::setBackgroundColor( " << page << ", " << background_color << " )" << endl; kDebug(kvs::dvi) << "ghostscript_interface::setBackgroundColor( " << page << ", " << background_color << " )";
#endif #endif
if (pageList.find(page) == 0) { if (pageList.find(page) == 0) {
@ -112,7 +112,7 @@ void ghostscript_interface::setBackgroundColor(const PageNumber& page, const QCo
void ghostscript_interface::restoreBackgroundColor(const PageNumber& page) void ghostscript_interface::restoreBackgroundColor(const PageNumber& page)
{ {
#ifdef DEBUG_PSGS #ifdef DEBUG_PSGS
kDebug(kvs::dvi) << "ghostscript_interface::restoreBackgroundColor( " << page << " )" << endl; kDebug(kvs::dvi) << "ghostscript_interface::restoreBackgroundColor( " << page << " )";
#endif #endif
if (pageList.find(page) == 0) if (pageList.find(page) == 0)
return; return;
@ -126,7 +126,7 @@ void ghostscript_interface::restoreBackgroundColor(const PageNumber& page)
QColor ghostscript_interface::getBackgroundColor(const PageNumber& page) const { QColor ghostscript_interface::getBackgroundColor(const PageNumber& page) const {
#ifdef DEBUG_PSGS #ifdef DEBUG_PSGS
kDebug(kvs::dvi) << "ghostscript_interface::getBackgroundColor( " << page << " )" << endl; kDebug(kvs::dvi) << "ghostscript_interface::getBackgroundColor( " << page << " )";
#endif #endif
if (pageList.find(page) == 0) if (pageList.find(page) == 0)
@ -146,7 +146,7 @@ void ghostscript_interface::clear() {
void ghostscript_interface::gs_generate_graphics_file(const PageNumber& page, const QString& filename, long magnification) { void ghostscript_interface::gs_generate_graphics_file(const PageNumber& page, const QString& filename, long magnification) {
#ifdef DEBUG_PSGS #ifdef DEBUG_PSGS
kDebug(kvs::dvi) << "ghostscript_interface::gs_generate_graphics_file( " << page << ", " << filename << " )" << endl; kDebug(kvs::dvi) << "ghostscript_interface::gs_generate_graphics_file( " << page << ", " << filename << " )";
#endif #endif
if (knownDevices.isEmpty()) { if (knownDevices.isEmpty()) {
@ -226,7 +226,7 @@ void ghostscript_interface::gs_generate_graphics_file(const PageNumber& page, co
argus << "-f" << PSfileName; argus << "-f" << PSfileName;
#ifdef DEBUG_PSGS #ifdef DEBUG_PSGS
kDebug(kvs::dvi) << argus.join(" ") << endl; kDebug(kvs::dvi) << argus.join(" ");
#endif #endif
proc << argus; proc << argus;
@ -279,7 +279,7 @@ void ghostscript_interface::gs_generate_graphics_file(const PageNumber& page, co
"drivers. Note that KDVI needs to be restarted to re-enable PostScript support." "drivers. Note that KDVI needs to be restarted to re-enable PostScript support."
"</p></qt>")); "</p></qt>"));
else { else {
kDebug(kvs::dvi) << QString("KDVI will now try to use the '%1' device driver.").arg(*gsDevice) << endl; kDebug(kvs::dvi) << QString("KDVI will now try to use the '%1' device driver.").arg(*gsDevice);
gs_generate_graphics_file(page, filename, magnification); gs_generate_graphics_file(page, filename, magnification);
} }
return; return;
@ -291,7 +291,7 @@ void ghostscript_interface::gs_generate_graphics_file(const PageNumber& page, co
void ghostscript_interface::graphics(const PageNumber& page, double dpi, long magnification, QPainter* paint) { void ghostscript_interface::graphics(const PageNumber& page, double dpi, long magnification, QPainter* paint) {
#ifdef DEBUG_PSGS #ifdef DEBUG_PSGS
kDebug(kvs::dvi) << "ghostscript_interface::graphics( " << page << ", " << dpi << ", ... ) called." << endl; kDebug(kvs::dvi) << "ghostscript_interface::graphics( " << page << ", " << dpi << ", ... ) called.";
#endif #endif
if (paint == 0) { if (paint == 0) {
@ -309,7 +309,7 @@ void ghostscript_interface::graphics(const PageNumber& page, double dpi, long ma
// No PostScript? Then return immediately. // No PostScript? Then return immediately.
if ((info == 0) || (info->PostScriptString->isEmpty())) { if ((info == 0) || (info->PostScriptString->isEmpty())) {
#ifdef DEBUG_PSGS #ifdef DEBUG_PSGS
kDebug(kvs::dvi) << "No PostScript found. Not drawing anything." << endl; kDebug(kvs::dvi) << "No PostScript found. Not drawing anything.";
#endif #endif
return; return;
} }

View file

@ -39,7 +39,7 @@ double SimplePageSize::zoomForWidth(quint32 width, const QPaintDevice& pd) const
double SimplePageSize::zoomToFitInto(const SimplePageSize &target) const double SimplePageSize::zoomToFitInto(const SimplePageSize &target) const
{ {
if (!isValid() || isSmall() || !target.isValid()) { if (!isValid() || isSmall() || !target.isValid()) {
kWarning(kvs::shell) << "SimplePageSize::zoomToFitInto(...) with unsuitable source of target" << endl; kWarning(kvs::shell) << "SimplePageSize::zoomToFitInto(...) with unsuitable source of target" ;
return 1.0; return 1.0;
} }

View file

@ -251,7 +251,7 @@ void dviRenderer::html_href_special(const QString& _cp)
cp.truncate(cp.indexOf('"')); cp.truncate(cp.indexOf('"'));
#ifdef DEBUG_SPECIAL #ifdef DEBUG_SPECIAL
kDebug(kvs::dvi) << "HTML-special, href " << cp.toLatin1() << endl; kDebug(kvs::dvi) << "HTML-special, href " << cp.toLatin1();
#endif #endif
HTML_href = new QString(cp); HTML_href = new QString(cp);
} }
@ -260,7 +260,7 @@ void dviRenderer::html_href_special(const QString& _cp)
void dviRenderer::html_anchor_end() void dviRenderer::html_anchor_end()
{ {
#ifdef DEBUG_SPECIAL #ifdef DEBUG_SPECIAL
kDebug(kvs::dvi) << "HTML-special, anchor-end" << endl; kDebug(kvs::dvi) << "HTML-special, anchor-end";
#endif #endif
if (HTML_href != NULL) { if (HTML_href != NULL) {
@ -310,7 +310,7 @@ void parse_special_argument(const QString& strg, const char* argument_name, int*
void dviRenderer::epsf_special(const QString& cp) void dviRenderer::epsf_special(const QString& cp)
{ {
#ifdef DEBUG_SPECIAL #ifdef DEBUG_SPECIAL
kDebug(kvs::dvi) << "epsf-special: psfile=" << cp <<endl; kDebug(kvs::dvi) << "epsf-special: psfile=" << cp;
#endif #endif
QString include_command = cp.simplified(); QString include_command = cp.simplified();
@ -437,7 +437,7 @@ void dviRenderer::epsf_special(const QString& cp)
void dviRenderer::TPIC_flushPath_special() void dviRenderer::TPIC_flushPath_special()
{ {
#ifdef DEBUG_SPECIAL #ifdef DEBUG_SPECIAL
kDebug(kvs::dvi) << "TPIC special flushPath" << endl; kDebug(kvs::dvi) << "TPIC special flushPath";
#endif #endif
if (number_of_elements_in_path == 0) { if (number_of_elements_in_path == 0) {
@ -455,7 +455,7 @@ void dviRenderer::TPIC_flushPath_special()
void dviRenderer::TPIC_addPath_special(const QString& cp) void dviRenderer::TPIC_addPath_special(const QString& cp)
{ {
#ifdef DEBUG_SPECIAL #ifdef DEBUG_SPECIAL
kDebug(kvs::dvi) << "TPIC special addPath: " << cp << endl; kDebug(kvs::dvi) << "TPIC special addPath: " << cp;
#endif #endif
// Adds a point to the path list // Adds a point to the path list
@ -489,7 +489,7 @@ void dviRenderer::TPIC_addPath_special(const QString& cp)
void dviRenderer::TPIC_setPen_special(const QString& cp) void dviRenderer::TPIC_setPen_special(const QString& cp)
{ {
#ifdef DEBUG_SPECIAL #ifdef DEBUG_SPECIAL
kDebug(kvs::dvi) << "TPIC special setPen: " << cp << endl; kDebug(kvs::dvi) << "TPIC special setPen: " << cp;
#endif #endif
// Sets the pen size in milli-inches // Sets the pen size in milli-inches

View file

@ -68,7 +68,7 @@ extern void oops(const QString& message);
void TeXFontDefinition::read_VF_index() void TeXFontDefinition::read_VF_index()
{ {
#ifdef DEBUG_FONTS #ifdef DEBUG_FONTS
kDebug(kvs::dvi) << "font::read_VF_index()" << endl; kDebug(kvs::dvi) << "font::read_VF_index()";
#endif #endif
FILE *VF_file = file; FILE *VF_file = file;
unsigned char cmnd; unsigned char cmnd;
@ -78,7 +78,7 @@ void TeXFontDefinition::read_VF_index()
flags |= FONT_VIRTUAL; flags |= FONT_VIRTUAL;
set_char_p = &dviRenderer::set_vf_char; set_char_p = &dviRenderer::set_vf_char;
#ifdef DEBUG_FONTS #ifdef DEBUG_FONTS
kDebug(kvs::dvi) << "TeXFontDefinition::read_VF_index: reading VF pixel file " << filename << endl; kDebug(kvs::dvi) << "TeXFontDefinition::read_VF_index: reading VF pixel file " << filename;
#endif #endif
// Read preamble. // Read preamble.
fseek(VF_file, (long) one(VF_file), 1); /* skip comment */ fseek(VF_file, (long) one(VF_file), 1); /* skip comment */
@ -103,7 +103,7 @@ void TeXFontDefinition::read_VF_index()
fontname[len] = '\0'; fontname[len] = '\0';
#ifdef DEBUG_FONTS #ifdef DEBUG_FONTS
kDebug(kvs::dvi) << "Virtual font defines subfont \"" << fontname << "\" scale=" << scale << " design=" << design << endl; kDebug(kvs::dvi) << "Virtual font defines subfont \"" << fontname << "\" scale=" << scale << " design=" << design;
#endif #endif
// According to Knuth's documentation found in the web source code // According to Knuth's documentation found in the web source code

View file

@ -232,7 +232,7 @@ void GSGenerator::pageSizeChanged( const Okular::PageSize &size, const Okular::P
if ( size == m_pageSizes.at(i) ) if ( size == m_pageSizes.at(i) )
{ {
internalDoc->setMedia( size.name() ); internalDoc->setMedia( size.name() );
kDebug() << "New Page size:" << size.name() << ":" << internalDoc->computePageSize( internalDoc->pageMedia() ) << endl; kDebug() << "New Page size:" << size.name() << ":" << internalDoc->computePageSize( internalDoc->pageMedia() );
break; break;
} }
} }
@ -280,7 +280,7 @@ bool GSGenerator::loadPages( QVector< Okular::Page * > & pagesVector )
tmpPage=(internalDoc->dsc() -> page() + i); tmpPage=(internalDoc->dsc() -> page() + i);
if (!tmpPage) if (!tmpPage)
{ {
kDebug() << "no tmpPage for page nr " << i << endl; kDebug() << "no tmpPage for page nr " << i;
continue; continue;
} }
pSize = internalDoc -> computePageSize( internalDoc -> pageMedia( i ) ); pSize = internalDoc -> computePageSize( internalDoc -> pageMedia( i ) );
@ -327,14 +327,14 @@ bool GSGenerator::loadDocumentWithDSC( const QString & name, QVector< Okular::Pa
{ {
internalDoc = new GSInternalDocument (name, ps ? GSInternalDocument::PS : GSInternalDocument::PDF); internalDoc = new GSInternalDocument (name, ps ? GSInternalDocument::PS : GSInternalDocument::PDF);
pagesVector.resize( internalDoc->dsc()->page_count() ); pagesVector.resize( internalDoc->dsc()->page_count() );
kDebug() << "Page count: " << internalDoc->dsc()->page_count() << endl; kDebug() << "Page count: " << internalDoc->dsc()->page_count();
kDebug() << "Page size: " << internalDoc->computePageSize( internalDoc->pageMedia() ) << endl; kDebug() << "Page size: " << internalDoc->computePageSize( internalDoc->pageMedia() );
return loadPages (pagesVector); return loadPages (pagesVector);
} }
void GSGenerator::generatePixmap( Okular::PixmapRequest * req ) void GSGenerator::generatePixmap( Okular::PixmapRequest * req )
{ {
kWarning() << "receiving req id=" << req->id() << " " <<req->width() << "x" << req->height() << "@" << req->pageNumber() << " async == " << req->asynchronous() << endl; kWarning() << "receiving req id=" << req->id() << " " <<req->width() << "x" << req->height() << "@" << req->pageNumber() << " async == " << req->asynchronous() ;
int pgNo=req->pageNumber(); int pgNo=req->pageNumber();
double width = req->page()->width(); double width = req->page()->width();
double height = req->page()->height(); double height = req->page()->height();

View file

@ -29,11 +29,11 @@ static bool handleErrorCode(int code)
switch (code) switch (code)
{ {
case e_Fatal: case e_Fatal:
kDebug() << "fatal internal error " << code << endl; kDebug() << "fatal internal error " << code;
break; break;
case e_ExecStackUnderflow: case e_ExecStackUnderflow:
kDebug() << "stack overflow " << code << endl; kDebug() << "stack overflow " << code;
break; break;
// no error or not important // no error or not important
@ -46,7 +46,7 @@ static bool handleErrorCode(int code)
const char* errors[]= { "", ERROR_NAMES }; const char* errors[]= { "", ERROR_NAMES };
int x=(-1)*code; int x=(-1)*code;
if (x < sizeof(errors)/sizeof(const char*)) { if (x < sizeof(errors)/sizeof(const char*)) {
kDebug() << errors[x] << " " << code << endl; kDebug() << errors[x] << " " << code;
} }
return false; return false;
} }

View file

@ -26,7 +26,7 @@
// GSLogWindow::GSLogWindow( QWidget* parent ) // GSLogWindow::GSLogWindow( QWidget* parent )
// : KVBox( parent ) // : KVBox( parent )
// { // {
// kDebug() << "Starting logwindow" <<endl; // kDebug() << "Starting logwindow";
// //
// layout()->setSpacing( 2 ); // layout()->setSpacing( 2 );
// QWidget *searchWidget = new QWidget( this ); // QWidget *searchWidget = new QWidget( this );
@ -67,7 +67,7 @@
// if ( event->type() == QEvent::Reparent && ( m_msgList->childCount() ) ) // if ( event->type() == QEvent::Reparent && ( m_msgList->childCount() ) )
// { // {
// int w=( m_msgList->firstChild() ) -> width( m_msgList->fontMetrics() , m_msgList, m_tCol); // int w=( m_msgList->firstChild() ) -> width( m_msgList->fontMetrics() , m_msgList, m_tCol);
// kDebug() << "new width = " << w << endl; // kDebug() << "new width = " << w;
// m_msgList->setColumnWidth(m_tCol, w); // m_msgList->setColumnWidth(m_tCol, w);
// } // }
// return true; // return true;
@ -77,8 +77,8 @@
// //
// void GSLogWindow::append( GSInterpreterLib::MessageType t, const QString &text) // void GSLogWindow::append( GSInterpreterLib::MessageType t, const QString &text)
// { // {
// //kDebug() << "Appending: " << text <<endl; // //kDebug() << "Appending: " << text;
// kDebug() << "last int: " << m_lastInt << endl; // kDebug() << "last int: " << m_lastInt;
// QStringList l=text.trimmed().split("\n",QString::SkipEmptyParts); // QStringList l=text.trimmed().split("\n",QString::SkipEmptyParts);
// QStringList::Iterator it=l.begin(), end=l.end(); // QStringList::Iterator it=l.begin(), end=l.end();
// while (it!=end) // while (it!=end)
@ -112,15 +112,15 @@
// // ghostscript splits messages longer then 128 to chunks, handle this properly // // ghostscript splits messages longer then 128 to chunks, handle this properly
// if (m_lastInt == 128) // if (m_lastInt == 128)
// { // {
// kDebug() << "last was full line" << endl; // kDebug() << "last was full line";
// if (t==m_buffer.first) // if (t==m_buffer.first)
// { // {
// kDebug() << "appending to buffer" << endl; // kDebug() << "appending to buffer";
// m_buffer.second +=QString::fromLocal8Bit( buf, num ); // m_buffer.second +=QString::fromLocal8Bit( buf, num );
// } // }
// else // else
// { // {
// kDebug() << "appending from buffer" << endl; // kDebug() << "appending from buffer";
// // sets m_lastInt to 0 // // sets m_lastInt to 0
// appendBuffered(); // appendBuffered();
// } // }
@ -128,10 +128,10 @@
// //
// if (num==128) // if (num==128)
// { // {
// kDebug() << "this is full line" << endl; // kDebug() << "this is full line";
// if (m_lastInt != 128) // if (m_lastInt != 128)
// { // {
// kDebug() << "appending to buffer" << endl; // kDebug() << "appending to buffer";
// m_buffer.first=t; // m_buffer.first=t;
// m_buffer.second=QString::fromLocal8Bit( buf, num ); // m_buffer.second=QString::fromLocal8Bit( buf, num );
// } // }
@ -140,22 +140,22 @@
// } // }
// else // else
// { // {
// kDebug() << "this is normal line" << endl; // kDebug() << "this is normal line";
// if (m_lastInt == 128) // if (m_lastInt == 128)
// { // {
// kDebug() << "appending from buffer" << endl; // kDebug() << "appending from buffer";
// appendBuffered(); // appendBuffered();
// } // }
// else // else
// { // {
// kDebug() << "appending directly" << endl; // kDebug() << "appending directly";
// append(t,QString::fromLocal8Bit( buf, num )); // append(t,QString::fromLocal8Bit( buf, num ));
// m_clearTimer.stop(); // m_clearTimer.stop();
// } // }
// } // }
// m_lastInt=num; // m_lastInt=num;
// //
// // kDebug()<< "LogWindow before split: " << msgString << " length: " << num << endl; // // kDebug()<< "LogWindow before split: " << msgString << " length: " << num;
// //
// } // }
// //

View file

@ -106,7 +106,7 @@ GSInternalDocument::GSInternalDocument(const QString &fname, Format form) : m_er
} }
if (m_error) if (m_error)
kDebug(4656) << m_errorString << endl; kDebug(4656) << m_errorString;
} }
GSInternalDocument::~GSInternalDocument() GSInternalDocument::~GSInternalDocument()
@ -248,7 +248,7 @@ QString GSInternalDocument::getPaperSize( const QString& mediaName ) const
m++; m++;
} }
// should never happen as we have fallback // should never happen as we have fallback
kDebug(4656) << "UNABLE TO FIND PAPER SIZE FOR MEDIA NAME: " << mediaName << endl; kDebug(4656) << "UNABLE TO FIND PAPER SIZE FOR MEDIA NAME: " << mediaName;
return QString("a4"); return QString("a4");
} }
return QString(r->name); return QString(r->name);

View file

@ -86,7 +86,7 @@ void GSInterpreterCMD::fordwardImage(QImage *image)
{ {
if (image->width() != m_request->width() || image->height() != m_request->height()) if (image->width() != m_request->width() || image->height() != m_request->height())
{ {
kWarning(4656) << "Generated image does not match wanted size " << image->width() << " " << m_request->width() << " " << image->height() << " " << m_request->height() << endl; kWarning(4656) << "Generated image does not match wanted size " << image->width() << " " << m_request->width() << " " << image->height() << " " << m_request->height() ;
QImage aux = image->scaled(m_request->width(), m_request->height()); QImage aux = image->scaled(m_request->width(), m_request->height());
delete image; delete image;
image = new QImage(aux); image = new QImage(aux);

View file

@ -213,7 +213,7 @@ static QPainterPath parseAbbreviatedPathData( const QString &data)
{ {
if (token.type != abtEOF) if (token.type != abtEOF)
{ {
kDebug(XpsDebug) << "Error in parsing abbreviated path data" << endl; kDebug(XpsDebug) << "Error in parsing abbreviated path data";
} }
return path; return path;
} }
@ -355,7 +355,7 @@ static QBrush parseRscRefColorForBrush( const QString &data )
{ {
if (data[0] == '{') { if (data[0] == '{') {
//TODO //TODO
kDebug(XpsDebug) << "Reference" << data << endl; kDebug(XpsDebug) << "Reference" << data;
return QBrush(); return QBrush();
} else { } else {
return QBrush( hexToRgba( data.toLatin1() ) ); return QBrush( hexToRgba( data.toLatin1() ) );
@ -369,7 +369,7 @@ static QPen parseRscRefColorForPen( const QString &data )
{ {
if (data[0] == '{') { if (data[0] == '{') {
//TODO //TODO
kDebug(XpsDebug) << "Reference" << data << endl; kDebug(XpsDebug) << "Reference" << data;
return QPen(); return QPen();
} else { } else {
return QPen( hexToRgba( data.toLatin1() ) ); return QPen( hexToRgba( data.toLatin1() ) );
@ -383,7 +383,7 @@ static QMatrix parseRscRefMatrix( const QString &data )
{ {
if (data[0] == '{') { if (data[0] == '{') {
//TODO //TODO
kDebug(XpsDebug) << "Reference" << data << endl; kDebug(XpsDebug) << "Reference" << data;
return QMatrix(); return QMatrix();
} else { } else {
return attsToMatrix( data ); return attsToMatrix( data );
@ -402,7 +402,7 @@ XpsHandler::~XpsHandler()
bool XpsHandler::startDocument() bool XpsHandler::startDocument()
{ {
kDebug(XpsDebug) << "start document" << m_page->m_fileName << endl; kDebug(XpsDebug) << "start document" << m_page->m_fileName ;
m_page->m_pageImage->fill( QColor("White").rgba() ); m_page->m_pageImage->fill( QColor("White").rgba() );
XpsRenderNode node; XpsRenderNode node;
@ -441,7 +441,7 @@ bool XpsHandler::endElement( const QString &nameSpace,
XpsRenderNode node = m_nodes.pop(); XpsRenderNode node = m_nodes.pop();
if (node.name != localName) { if (node.name != localName) {
kDebug(XpsDebug) << "Name doesn't match" << endl; kDebug(XpsDebug) << "Name doesn't match";
} }
processEndElement( node ); processEndElement( node );
node.children.clear(); node.children.clear();
@ -462,7 +462,7 @@ void XpsHandler::processGlyph( XpsRenderNode &node )
// Get font (doesn't work well because qt doesn't allow to load font from file) // Get font (doesn't work well because qt doesn't allow to load font from file)
// This works despite the fact that font size isn't specified in points as required by qt. It's because I set point size to be equal to drawing unit. // This works despite the fact that font size isn't specified in points as required by qt. It's because I set point size to be equal to drawing unit.
// kDebug(XpsDebug) << "Font Rendering EmSize: " << node.attributes.value("FontRenderingEmSize").toFloat() << endl; // kDebug(XpsDebug) << "Font Rendering EmSize: " << node.attributes.value("FontRenderingEmSize").toFloat();
QFont font = m_page->m_file->getFontByName( node.attributes.value("FontUri"), node.attributes.value("FontRenderingEmSize").toFloat()); QFont font = m_page->m_file->getFontByName( node.attributes.value("FontUri"), node.attributes.value("FontRenderingEmSize").toFloat());
m_painter->setFont(font); m_painter->setFont(font);
@ -499,9 +499,9 @@ void XpsHandler::processGlyph( XpsRenderNode &node )
} }
m_painter->drawText( origin, node.attributes.value("UnicodeString") ); m_painter->drawText( origin, node.attributes.value("UnicodeString") );
// kDebug(XpsDebug) << "Glyphs: " << atts.value("Fill") << ", " << atts.value("FontUri") << endl; // kDebug(XpsDebug) << "Glyphs: " << atts.value("Fill") << ", " << atts.value("FontUri");
// kDebug(XpsDebug) << " Origin: " << atts.value("OriginX") << "," << atts.value("OriginY") << endl; // kDebug(XpsDebug) << " Origin: " << atts.value("OriginX") << "," << atts.value("OriginY");
// kDebug(XpsDebug) << " Unicode: " << atts.value("UnicodeString") << endl; // kDebug(XpsDebug) << " Unicode: " << atts.value("UnicodeString");
m_painter->restore(); m_painter->restore();
} }
@ -511,7 +511,7 @@ void XpsHandler::processFill( XpsRenderNode &node )
//TODO Ignored child elements: LinearGradientBrush, RadialGradientBrush, VirtualBrush //TODO Ignored child elements: LinearGradientBrush, RadialGradientBrush, VirtualBrush
if (node.children.size() != 1) { if (node.children.size() != 1) {
kDebug(XpsDebug) << "Fill element should have exactly one child" << endl; kDebug(XpsDebug) << "Fill element should have exactly one child";
} else { } else {
node.data = node.children[0].data; node.data = node.children[0].data;
} }
@ -658,7 +658,7 @@ void XpsHandler::processEndElement( XpsRenderNode &node )
} else if (node.name == "ImageBrush.Transform") { } else if (node.name == "ImageBrush.Transform") {
node.data = node.getRequiredChildData( "MatrixTransform" ); node.data = node.getRequiredChildData( "MatrixTransform" );
} else { } else {
//kDebug(XpsDebug) << "Unknown element: " << node->name << endl; //kDebug(XpsDebug) << "Unknown element: " << node->name;
} }
} }
@ -667,7 +667,7 @@ XpsPage::XpsPage(XpsFile *file, const QString &fileName): m_file( file ),
{ {
m_pageImage = NULL; m_pageImage = NULL;
// kDebug(XpsDebug) << "page file name: " << fileName << endl; // kDebug(XpsDebug) << "page file name: " << fileName;
const KZipFileEntry* pageFile = static_cast<const KZipFileEntry *>(m_file->xpsArchive()->directory()->entry( fileName )); const KZipFileEntry* pageFile = static_cast<const KZipFileEntry *>(m_file->xpsArchive()->directory()->entry( fileName ));
@ -686,7 +686,7 @@ XpsPage::XpsPage(XpsFile *file, const QString &fileName): m_file( file ),
} }
if ( xml.error() ) if ( xml.error() )
{ {
kDebug(XpsDebug) << "Could not parse XPS page:" << xml.errorString() << endl; kDebug(XpsDebug) << "Could not parse XPS page:" << xml.errorString();
} }
} }
@ -719,7 +719,7 @@ bool XpsPage::renderToImage( QImage *p )
QBuffer * buffer = new QBuffer(&data); QBuffer * buffer = new QBuffer(&data);
QXmlInputSource *source = new QXmlInputSource(buffer); QXmlInputSource *source = new QXmlInputSource(buffer);
bool ok = parser->parse( source ); bool ok = parser->parse( source );
kDebug(XpsDebug) << "Parse result: " << ok << endl; kDebug(XpsDebug) << "Parse result: " << ok;
delete source; delete source;
delete parser; delete parser;
delete handler; delete handler;
@ -739,7 +739,7 @@ QSize XpsPage::size() const
QFont XpsFile::getFontByName( const QString &fileName, float size ) QFont XpsFile::getFontByName( const QString &fileName, float size )
{ {
// kDebug(XpsDebug) << "trying to get font: " << fileName << ", size: " << size << endl; // kDebug(XpsDebug) << "trying to get font: " << fileName << ", size: " << size;
int index = m_fontCache.value(fileName, -1); int index = m_fontCache.value(fileName, -1);
if (index == -1) if (index == -1)
@ -757,7 +757,7 @@ QFont XpsFile::getFontByName( const QString &fileName, float size )
int XpsFile::loadFontByName( const QString &fileName ) int XpsFile::loadFontByName( const QString &fileName )
{ {
// kDebug(XpsDebug) << "font file name: " << fileName << endl; // kDebug(XpsDebug) << "font file name: " << fileName;
const KZipFileEntry* fontFile = static_cast<const KZipFileEntry *>(m_xpsArchive->directory()->entry( fileName )); const KZipFileEntry* fontFile = static_cast<const KZipFileEntry *>(m_xpsArchive->directory()->entry( fileName ));
@ -775,13 +775,13 @@ int XpsFile::loadFontByName( const QString &fileName )
unsigned short guid[16]; unsigned short guid[16];
if (!parseGUID(baseName, guid)) if (!parseGUID(baseName, guid))
{ {
kDebug(XpsDebug) << "File to load font - file name isn't a GUID" << endl; kDebug(XpsDebug) << "File to load font - file name isn't a GUID";
} }
else else
{ {
if (fontData.length() < 32) if (fontData.length() < 32)
{ {
kDebug(XpsDebug) << "Font file is too small" << endl; kDebug(XpsDebug) << "Font file is too small";
} else { } else {
// Obfuscation - xor bytes in font binary with bytes from guid (font's filename) // Obfuscation - xor bytes in font binary with bytes from guid (font's filename)
const static int mapping[] = {15, 14, 13, 12, 11, 10, 9, 8, 6, 7, 4, 5, 0, 1, 2, 3}; const static int mapping[] = {15, 14, 13, 12, 11, 10, 9, 8, 6, 7, 4, 5, 0, 1, 2, 3};
@ -795,7 +795,7 @@ int XpsFile::loadFontByName( const QString &fileName )
} }
// kDebug(XpsDebug) << "Loaded font: " << m_fontDatabase.applicationFontFamilies( result ) << endl; // kDebug(XpsDebug) << "Loaded font: " << m_fontDatabase.applicationFontFamilies( result );
return result; // a font ID return result; // a font ID
} }
@ -806,7 +806,7 @@ KZip * XpsFile::xpsArchive() {
QImage XpsPage::loadImageFromFile( const QString &fileName ) QImage XpsPage::loadImageFromFile( const QString &fileName )
{ {
// kDebug(XpsDebug) << "image file name: " << fileName << endl; // kDebug(XpsDebug) << "image file name: " << fileName;
const KZipFileEntry* imageFile = static_cast<const KZipFileEntry *>(m_file->xpsArchive()->directory()->entry( fileName )); const KZipFileEntry* imageFile = static_cast<const KZipFileEntry *>(m_file->xpsArchive()->directory()->entry( fileName ));
@ -842,7 +842,7 @@ QImage XpsPage::loadImageFromFile( const QString &fileName )
Okular::TextPage* XpsPage::textPage() Okular::TextPage* XpsPage::textPage()
{ {
// kDebug(XpsDebug) << "Parsing XpsPage, text extraction" << endl; // kDebug(XpsDebug) << "Parsing XpsPage, text extraction";
Okular::TextPage* textPage = new Okular::TextPage(); Okular::TextPage* textPage = new Okular::TextPage();
@ -882,7 +882,7 @@ Okular::TextPage* XpsPage::textPage()
} else if (xml.name() == "FixedPage") { } else if (xml.name() == "FixedPage") {
// not useful for text extraction // not useful for text extraction
} else { } else {
kDebug(XpsDebug) << "Unhandled element in Text Extraction start: " << xml.name().toString() << endl; kDebug(XpsDebug) << "Unhandled element in Text Extraction start: " << xml.name().toString();
} }
} else if (xml.isEndElement() ) { } else if (xml.isEndElement() ) {
if (xml.name() == "Canvas") { if (xml.name() == "Canvas") {
@ -929,19 +929,19 @@ Okular::TextPage* XpsPage::textPage()
} else if (xml.name() == "FixedPage") { } else if (xml.name() == "FixedPage") {
// not useful for text extraction // not useful for text extraction
} else { } else {
kDebug(XpsDebug) << "Unhandled element in Text Extraction end: " << xml.name().toString() << endl; kDebug(XpsDebug) << "Unhandled element in Text Extraction end: " << xml.name().toString();
} }
} }
} }
if ( xml.error() ) { if ( xml.error() ) {
kDebug(XpsDebug) << "Error parsing XpsPage text: " << xml.errorString() << endl; kDebug(XpsDebug) << "Error parsing XpsPage text: " << xml.errorString();
} }
return textPage; return textPage;
} }
void XpsDocument::parseDocumentStructure( const QString &documentStructureFileName ) void XpsDocument::parseDocumentStructure( const QString &documentStructureFileName )
{ {
kDebug(XpsDebug) << "document structure file name: " << documentStructureFileName << endl; kDebug(XpsDebug) << "document structure file name: " << documentStructureFileName;
m_haveDocumentStructure = false; m_haveDocumentStructure = false;
const KZipFileEntry* documentStructureFile = static_cast<const KZipFileEntry *>(m_file->xpsArchive()->directory()->entry( documentStructureFileName )); const KZipFileEntry* documentStructureFile = static_cast<const KZipFileEntry *>(m_file->xpsArchive()->directory()->entry( documentStructureFileName ));
@ -957,9 +957,9 @@ void XpsDocument::parseDocumentStructure( const QString &documentStructureFileNa
if ( xml.name() == "DocumentStructure" ) { if ( xml.name() == "DocumentStructure" ) {
// just a container for optional outline and story elements - nothing to do here // just a container for optional outline and story elements - nothing to do here
} else if ( xml.name() == "DocumentStructure.Outline" ) { } else if ( xml.name() == "DocumentStructure.Outline" ) {
kDebug(XpsDebug) << "found DocumentStructure.Outline" << endl; kDebug(XpsDebug) << "found DocumentStructure.Outline";
} else if ( xml.name() == "DocumentOutline" ) { } else if ( xml.name() == "DocumentOutline" ) {
kDebug(XpsDebug) << "found DocumentOutline" << endl; kDebug(XpsDebug) << "found DocumentOutline";
m_docStructure = new Okular::DocumentSynopsis; m_docStructure = new Okular::DocumentSynopsis;
} else if ( xml.name() == "OutlineEntry" ) { } else if ( xml.name() == "OutlineEntry" ) {
m_haveDocumentStructure = true; m_haveDocumentStructure = true;
@ -971,7 +971,7 @@ void XpsDocument::parseDocumentStructure( const QString &documentStructureFileNa
QString target = attributes.value("OutlineTarget").toString(); QString target = attributes.value("OutlineTarget").toString();
int hashPosition = target.lastIndexOf( '#' ); int hashPosition = target.lastIndexOf( '#' );
target = target.mid( hashPosition + 1 ); target = target.mid( hashPosition + 1 );
// kDebug(XpsDebug) << "target: " << target << endl; // kDebug(XpsDebug) << "target: " << target;
Okular::DocumentViewport viewport; Okular::DocumentViewport viewport;
viewport.pageNumber = m_docStructurePageMap.value( target ); viewport.pageNumber = m_docStructurePageMap.value( target );
synopsisElement.setAttribute( "Viewport", viewport.toString() ); synopsisElement.setAttribute( "Viewport", viewport.toString() );
@ -1000,7 +1000,7 @@ void XpsDocument::parseDocumentStructure( const QString &documentStructureFileNa
} else if ( xml.name() == "StoryFragmentReference" ) { } else if ( xml.name() == "StoryFragmentReference" ) {
// we need to handle StoryFragmentReference here, but I have no idea what to do with it. // we need to handle StoryFragmentReference here, but I have no idea what to do with it.
} else { } else {
kDebug(XpsDebug) << "Unhandled entry in DocumentStructure: " << xml.name().toString() << endl; kDebug(XpsDebug) << "Unhandled entry in DocumentStructure: " << xml.name().toString();
} }
} }
} }
@ -1018,7 +1018,7 @@ bool XpsDocument::hasDocumentStructure()
XpsDocument::XpsDocument(XpsFile *file, const QString &fileName): m_file(file), m_haveDocumentStructure( false ) XpsDocument::XpsDocument(XpsFile *file, const QString &fileName): m_file(file), m_haveDocumentStructure( false )
{ {
kDebug(XpsDebug) << "document file name: " << fileName << endl; kDebug(XpsDebug) << "document file name: " << fileName;
const KZipFileEntry* documentFile = static_cast<const KZipFileEntry *>(file->xpsArchive()->directory()->entry( fileName )); const KZipFileEntry* documentFile = static_cast<const KZipFileEntry *>(file->xpsArchive()->directory()->entry( fileName ));
@ -1029,7 +1029,7 @@ XpsDocument::XpsDocument(XpsFile *file, const QString &fileName): m_file(file),
if ( docXml.isStartElement() ) { if ( docXml.isStartElement() ) {
if ( docXml.name() == "PageContent" ) { if ( docXml.name() == "PageContent" ) {
QString pagePath = docXml.attributes().value("Source").toString(); QString pagePath = docXml.attributes().value("Source").toString();
kDebug(XpsDebug) << "Page Path: " << pagePath << endl; kDebug(XpsDebug) << "Page Path: " << pagePath;
if (pagePath.startsWith('/') == false ) { if (pagePath.startsWith('/') == false ) {
int offset = fileName.lastIndexOf('/'); int offset = fileName.lastIndexOf('/');
QString thisDir = fileName.mid(0, offset) + '/'; QString thisDir = fileName.mid(0, offset) + '/';
@ -1047,12 +1047,12 @@ XpsDocument::XpsDocument(XpsFile *file, const QString &fileName): m_file(file),
} else if ( docXml.name() == "FixedDocument" ) { } else if ( docXml.name() == "FixedDocument" ) {
// we just ignore this - it is just a container // we just ignore this - it is just a container
} else { } else {
kDebug(XpsDebug) << "Unhandled entry in FixedDocument: " << docXml.name().toString() << endl; kDebug(XpsDebug) << "Unhandled entry in FixedDocument: " << docXml.name().toString();
} }
} }
} }
if ( docXml.error() ) { if ( docXml.error() ) {
kDebug(XpsDebug) << "Could not parse main XPS document file: " << docXml.errorString() << endl; kDebug(XpsDebug) << "Could not parse main XPS document file: " << docXml.errorString();
} }
// There might be a relationships entry for this document - typically used to tell us where to find the // There might be a relationships entry for this document - typically used to tell us where to find the
@ -1093,12 +1093,12 @@ XpsDocument::XpsDocument(XpsFile *file, const QString &fileName): m_file(file),
} }
} else { // the page relationship file didn't exist in the zipfile } else { // the page relationship file didn't exist in the zipfile
// this isn't fatal // this isn't fatal
kDebug(XpsDebug) << "Could not open Document relationship file from " << maybeDocumentRelationshipPath << endl; kDebug(XpsDebug) << "Could not open Document relationship file from " << maybeDocumentRelationshipPath;
} }
if ( ! documentStructureFile.isEmpty() ) if ( ! documentStructureFile.isEmpty() )
{ {
// kDebug(XpsDebug) << "Document structure filename: " << documentStructureFile << endl; // kDebug(XpsDebug) << "Document structure filename: " << documentStructureFile;
// make the document path absolute // make the document path absolute
if ( documentStructureFile.startsWith( '/' ) ) if ( documentStructureFile.startsWith( '/' ) )
{ {
@ -1109,7 +1109,7 @@ XpsDocument::XpsDocument(XpsFile *file, const QString &fileName): m_file(file),
maybeDocumentRelationshipPath.truncate( slashPosition ); maybeDocumentRelationshipPath.truncate( slashPosition );
documentStructureFile.prepend( maybeDocumentRelationshipPath + '/' ); documentStructureFile.prepend( maybeDocumentRelationshipPath + '/' );
} }
// kDebug(XpsDebug) << "Document structure absolute path: " << documentStructureFile << endl; // kDebug(XpsDebug) << "Document structure absolute path: " << documentStructureFile;
parseDocumentStructure( documentStructureFile ); parseDocumentStructure( documentStructureFile );
} }
@ -1152,9 +1152,9 @@ bool XpsFile::loadDocument(const QString &filename)
{ {
m_xpsArchive = new KZip( filename ); m_xpsArchive = new KZip( filename );
if ( m_xpsArchive->open( QIODevice::ReadOnly ) == true ) { if ( m_xpsArchive->open( QIODevice::ReadOnly ) == true ) {
kDebug(XpsDebug) << "Successful open of " << m_xpsArchive->fileName() << endl; kDebug(XpsDebug) << "Successful open of " << m_xpsArchive->fileName();
} else { } else {
kDebug(XpsDebug) << "Could not open XPS archive: " << m_xpsArchive->fileName() << endl; kDebug(XpsDebug) << "Could not open XPS archive: " << m_xpsArchive->fileName();
delete m_xpsArchive; delete m_xpsArchive;
return false; return false;
} }
@ -1189,17 +1189,17 @@ bool XpsFile::loadDocument(const QString &filename)
} else if ("http://schemas.openxmlformats.org/package/2006/relationships/digital-signature/origin" == type) { } else if ("http://schemas.openxmlformats.org/package/2006/relationships/digital-signature/origin" == type) {
m_signatureOrigin = target; m_signatureOrigin = target;
} else { } else {
kDebug(XpsDebug) << "Unknown relationships element: " << type << " : " << target << endl; kDebug(XpsDebug) << "Unknown relationships element: " << type << " : " << target;
} }
} else if ( relXml.name() == "Relationships" ) { } else if ( relXml.name() == "Relationships" ) {
// nothing to do here - this is just the container level // nothing to do here - this is just the container level
} else { } else {
kDebug(XpsDebug) << "unexpected element in _rels/.rels: " << relXml.name().toString() << endl; kDebug(XpsDebug) << "unexpected element in _rels/.rels: " << relXml.name().toString();
} }
} }
} }
if ( relXml.error() ) { if ( relXml.error() ) {
kDebug(XpsDebug) << "Could not parse _rels/.rels: " << relXml.errorString() << endl; kDebug(XpsDebug) << "Could not parse _rels/.rels: " << relXml.errorString();
return false; return false;
} }
@ -1227,12 +1227,12 @@ bool XpsFile::loadDocument(const QString &filename)
} else if ( fixedRepXml.name() == "FixedDocumentSequence") { } else if ( fixedRepXml.name() == "FixedDocumentSequence") {
// we don't do anything here - this is just a container for one or more DocumentReference elements // we don't do anything here - this is just a container for one or more DocumentReference elements
} else { } else {
kDebug(XpsDebug) << "Unhandled entry in FixedDocumentSequence: " << fixedRepXml.name().toString() << endl; kDebug(XpsDebug) << "Unhandled entry in FixedDocumentSequence: " << fixedRepXml.name().toString();
} }
} }
} }
if ( fixedRepXml.error() ) { if ( fixedRepXml.error() ) {
kDebug(XpsDebug) << "Could not parse FixedRepresentation file:" << fixedRepXml.errorString() << endl; kDebug(XpsDebug) << "Could not parse FixedRepresentation file:" << fixedRepXml.errorString();
return false; return false;
} }
@ -1283,10 +1283,10 @@ const Okular::DocumentInfo * XpsFile::generateDocumentInfo()
} }
if ( xml.error() ) if ( xml.error() )
{ {
kDebug(XpsDebug) << "Could not parse XPS core properties:" << xml.errorString() << endl; kDebug(XpsDebug) << "Could not parse XPS core properties:" << xml.errorString();
} }
} else { } else {
kDebug(XpsDebug) << "No core properties filename" << endl; kDebug(XpsDebug) << "No core properties filename";
} }
m_docInfo->set( Okular::DocumentInfo::Pages, QString::number(numPages()) ); m_docInfo->set( Okular::DocumentInfo::Pages, QString::number(numPages()) );
@ -1402,14 +1402,14 @@ Okular::TextPage* XpsGenerator::textPage( Okular::Page * page )
const Okular::DocumentInfo * XpsGenerator::generateDocumentInfo() const Okular::DocumentInfo * XpsGenerator::generateDocumentInfo()
{ {
kDebug(XpsDebug) << "generating document metadata" << endl; kDebug(XpsDebug) << "generating document metadata";
return m_xpsFile->generateDocumentInfo(); return m_xpsFile->generateDocumentInfo();
} }
const Okular::DocumentSynopsis * XpsGenerator::generateDocumentSynopsis() const Okular::DocumentSynopsis * XpsGenerator::generateDocumentSynopsis()
{ {
kDebug(XpsDebug) << "generating document synopsis" << endl; kDebug(XpsDebug) << "generating document synopsis";
// we only generate the synopsis for the first file. // we only generate the synopsis for the first file.
if ( !m_xpsFile || !m_xpsFile->document( 0 ) ) if ( !m_xpsFile || !m_xpsFile->document( 0 ) )
@ -1470,7 +1470,7 @@ void * XpsRenderNode::getRequiredChildData( const QString &name )
{ {
XpsRenderNode * child = findChild( name ); XpsRenderNode * child = findChild( name );
if (child == NULL) { if (child == NULL) {
kDebug(XpsDebug) << "Required element " << name << " is missing in " << this->name << endl; kDebug(XpsDebug) << "Required element " << name << " is missing in " << this->name;
return NULL; return NULL;
} }