Diffstat (limited to 'noncore/apps/opie-reader/striphtml.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/striphtml.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/apps/opie-reader/striphtml.cpp b/noncore/apps/opie-reader/striphtml.cpp index c434dbb..a2ad56b 100644 --- a/noncore/apps/opie-reader/striphtml.cpp +++ b/noncore/apps/opie-reader/striphtml.cpp | |||
@@ -428,97 +428,97 @@ QString striphtml::getattr(tchar& ch) | |||
428 | unsigned long pos; | 428 | unsigned long pos; |
429 | if (ch == ' ') ch = skip_ws(); | 429 | if (ch == ' ') ch = skip_ws(); |
430 | if (ch == '=') | 430 | if (ch == '=') |
431 | { | 431 | { |
432 | ch = skip_ws(); | 432 | ch = skip_ws(); |
433 | if (ch == '"') | 433 | if (ch == '"') |
434 | { | 434 | { |
435 | mygetch(ch, sty, pos); | 435 | mygetch(ch, sty, pos); |
436 | ref = getname(ch, "\""); | 436 | ref = getname(ch, "\""); |
437 | ch = skip_ws(); | 437 | ch = skip_ws(); |
438 | } | 438 | } |
439 | else if (ch == '\'') | 439 | else if (ch == '\'') |
440 | { | 440 | { |
441 | mygetch(ch, sty, pos); | 441 | mygetch(ch, sty, pos); |
442 | ref = getname(ch, "\'"); | 442 | ref = getname(ch, "\'"); |
443 | ch = skip_ws(); | 443 | ch = skip_ws(); |
444 | } | 444 | } |
445 | else | 445 | else |
446 | { | 446 | { |
447 | ref = getname(ch, " >"); | 447 | ref = getname(ch, " >"); |
448 | if (ch == ' ') ch = skip_ws(); | 448 | if (ch == ' ') ch = skip_ws(); |
449 | } | 449 | } |
450 | } | 450 | } |
451 | return ref; | 451 | return ref; |
452 | } | 452 | } |
453 | 453 | ||
454 | linkType striphtml::hyperlink(unsigned int n, unsigned int, QString& w, QString& nm) | 454 | linkType striphtml::hyperlink(unsigned int n, unsigned int, QString& w, QString& nm) |
455 | { | 455 | { |
456 | #if defined(USEQPE) || defined(_WINDOWS) | 456 | #if defined(USEQPE) || defined(_WINDOWS) |
457 | QMap<unsigned long, QString>::Iterator hrefit = id2href->find(n); | 457 | QMap<unsigned long, QString>::Iterator hrefit = id2href->find(n); |
458 | #else | 458 | #else |
459 | QMap<unsigned long, QString>::iterator hrefit = id2href->find(n); | 459 | QMap<unsigned long, QString>::iterator hrefit = id2href->find(n); |
460 | #endif | 460 | #endif |
461 | if (hrefit == id2href->end()) | 461 | if (hrefit == id2href->end()) |
462 | { | 462 | { |
463 | return eNone; | 463 | return eNone; |
464 | } | 464 | } |
465 | QString href = *hrefit; | 465 | QString href = *hrefit; |
466 | #if defined(USEQPE) || defined(_WINDOWS) | 466 | #if defined(USEQPE) || defined(_WINDOWS) |
467 | QMap<QString, unsigned long>::Iterator fpit = href2filepos->find(href); | 467 | QMap<QString, unsigned long>::Iterator fpit = href2filepos->find(href); |
468 | #else | 468 | #else |
469 | QMap<QString, unsigned long>::iterator fpit = href2filepos->find(href); | 469 | QMap<QString, unsigned long>::iterator fpit = href2filepos->find(href); |
470 | #endif | 470 | #endif |
471 | if (fpit == href2filepos->end()) | 471 | if (fpit == href2filepos->end()) |
472 | { | 472 | { |
473 | if (href == "history.back()") | 473 | if (href == "history.back()") |
474 | { | 474 | { |
475 | QString fc = currentfile; | 475 | QString fc = currentfile; |
476 | unsigned long loc; | 476 | unsigned long loc = 0; |
477 | htmlmark m(fc, loc); | 477 | htmlmark m(fc, loc); |
478 | linkType ret = (m_nav.back(m)) ? eFile : eNone; | 478 | linkType ret = (m_nav.back(m)) ? eFile : eNone; |
479 | if (fc == m.filename()) | 479 | if (fc == m.filename()) |
480 | { | 480 | { |
481 | if ((ret & eFile) != 0) | 481 | if ((ret & eFile) != 0) |
482 | { | 482 | { |
483 | locate(m.posn()); | 483 | locate(m.posn()); |
484 | return eLink; | 484 | return eLink; |
485 | } | 485 | } |
486 | } | 486 | } |
487 | return eNone; | 487 | return eNone; |
488 | } | 488 | } |
489 | qDebug("Searching for %s", (const char*)href); | 489 | qDebug("Searching for %s", (const char*)href); |
490 | 490 | ||
491 | 491 | ||
492 | QString file, name; | 492 | QString file, name; |
493 | 493 | ||
494 | int colon = href.find('#'); | 494 | int colon = href.find('#'); |
495 | if (colon >= 0) | 495 | if (colon >= 0) |
496 | { | 496 | { |
497 | file = dehtml(href.left(colon)); | 497 | file = dehtml(href.left(colon)); |
498 | name = dehtml(href.right(href.length()-colon-1)); | 498 | name = dehtml(href.right(href.length()-colon-1)); |
499 | } | 499 | } |
500 | else | 500 | else |
501 | { | 501 | { |
502 | file = dehtml(href); | 502 | file = dehtml(href); |
503 | } | 503 | } |
504 | 504 | ||
505 | qDebug("File:%s", (const char*)file); | 505 | qDebug("File:%s", (const char*)file); |
506 | qDebug("Name:%s", (const char*)name); | 506 | qDebug("Name:%s", (const char*)name); |
507 | 507 | ||
508 | 508 | ||
509 | if (file.isEmpty()) | 509 | if (file.isEmpty()) |
510 | { | 510 | { |
511 | if (parent->findanchor(name)) | 511 | if (parent->findanchor(name)) |
512 | { | 512 | { |
513 | reset(); | 513 | reset(); |
514 | return eLink; | 514 | return eLink; |
515 | } | 515 | } |
516 | fpit = href2filepos->find(name); | 516 | fpit = href2filepos->find(name); |
517 | if (fpit != href2filepos->end()) | 517 | if (fpit != href2filepos->end()) |
518 | { | 518 | { |
519 | locate(*fpit); | 519 | locate(*fpit); |
520 | return eLink; | 520 | return eLink; |
521 | } | 521 | } |
522 | else | 522 | else |
523 | { | 523 | { |
524 | // nm = QString("<a[^>]*name[ \t]*=[ \t]*\"") + name + "\""; | 524 | // nm = QString("<a[^>]*name[ \t]*=[ \t]*\"") + name + "\""; |