Diffstat (limited to 'noncore/apps/opie-reader/CFilter.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/CFilter.cpp | 127 |
1 files changed, 125 insertions, 2 deletions
diff --git a/noncore/apps/opie-reader/CFilter.cpp b/noncore/apps/opie-reader/CFilter.cpp index c17cf61..d5e3116 100644 --- a/noncore/apps/opie-reader/CFilter.cpp +++ b/noncore/apps/opie-reader/CFilter.cpp | |||
@@ -511,51 +511,174 @@ void PeanutFormatter::getch(tchar& ch, CStyle& sty) | |||
511 | case 'i': | 511 | case 'i': |
512 | if (currentstyle.isItalic()) | 512 | if (currentstyle.isItalic()) |
513 | { | 513 | { |
514 | currentstyle.unsetItalic(); | 514 | currentstyle.unsetItalic(); |
515 | } | 515 | } |
516 | else | 516 | else |
517 | { | 517 | { |
518 | currentstyle.setItalic(); | 518 | currentstyle.setItalic(); |
519 | } | 519 | } |
520 | parent->getch(ch, dummy); | 520 | parent->getch(ch, dummy); |
521 | break; | 521 | break; |
522 | case 'b': | 522 | case 'b': |
523 | case 'B': | 523 | case 'B': |
524 | if (currentstyle.isBold()) | 524 | if (currentstyle.isBold()) |
525 | { | 525 | { |
526 | currentstyle.unsetBold(); | 526 | currentstyle.unsetBold(); |
527 | } | 527 | } |
528 | else | 528 | else |
529 | { | 529 | { |
530 | currentstyle.setBold(); | 530 | currentstyle.setBold(); |
531 | } | 531 | } |
532 | parent->getch(ch, dummy); | 532 | parent->getch(ch, dummy); |
533 | break; | 533 | break; |
534 | case 'c': | 534 | case 'c': |
535 | if (currentstyle.getJustify() == CStyle::m_AlignCentre) | 535 | if (currentstyle.getJustify() == m_AlignCentre) |
536 | { | 536 | { |
537 | currentstyle.setLeftJustify(); | 537 | currentstyle.setLeftJustify(); |
538 | } | 538 | } |
539 | else | 539 | else |
540 | { | 540 | { |
541 | currentstyle.setCentreJustify(); | 541 | currentstyle.setCentreJustify(); |
542 | } | 542 | } |
543 | parent->getch(ch, dummy); | 543 | parent->getch(ch, dummy); |
544 | break; | 544 | break; |
545 | case 'r': | 545 | case 'r': |
546 | if (currentstyle.getJustify() == CStyle::m_AlignRight) | 546 | if (currentstyle.getJustify() == m_AlignRight) |
547 | { | 547 | { |
548 | currentstyle.setLeftJustify(); | 548 | currentstyle.setLeftJustify(); |
549 | } | 549 | } |
550 | else | 550 | else |
551 | { | 551 | { |
552 | currentstyle.setRightJustify(); | 552 | currentstyle.setRightJustify(); |
553 | } | 553 | } |
554 | parent->getch(ch, dummy); | 554 | parent->getch(ch, dummy); |
555 | break; | 555 | break; |
556 | default: | 556 | default: |
557 | currentstyle.setColour(255,0,0); | 557 | currentstyle.setColour(255,0,0); |
558 | } | 558 | } |
559 | } | 559 | } |
560 | sty = currentstyle; | 560 | sty = currentstyle; |
561 | } | 561 | } |
562 | |||
563 | void OnePara::getch(tchar& ch, CStyle& sty) | ||
564 | { | ||
565 | parent->getch(ch, sty); | ||
566 | if (m_lastchar == 10) | ||
567 | { | ||
568 | while (ch == 10) parent->getch(ch, sty); | ||
569 | } | ||
570 | m_lastchar = ch; | ||
571 | } | ||
572 | |||
573 | #ifdef REPALM | ||
574 | void repalm::getch(tchar& ch, CStyle& sty) | ||
575 | { | ||
576 | parent->getch(ch, sty); | ||
577 | switch (ch) | ||
578 | { | ||
579 | case 0x80: | ||
580 | ch = 0x20ac; | ||
581 | break; | ||
582 | case 0x82: | ||
583 | ch = 0x201a; | ||
584 | break; | ||
585 | case 0x83: | ||
586 | ch = 0x0192; | ||
587 | break; | ||
588 | case 0x84: | ||
589 | ch = 0x201e; | ||
590 | break; | ||
591 | case 0x85: | ||
592 | ch = 0x2026; | ||
593 | break; | ||
594 | case 0x86: | ||
595 | ch = 0x2020; | ||
596 | break; | ||
597 | case 0x87: | ||
598 | ch = 0x2021; | ||
599 | break; | ||
600 | case 0x88: | ||
601 | ch = 0x02c6; | ||
602 | break; | ||
603 | case 0x89: | ||
604 | ch = 0x2030; | ||
605 | break; | ||
606 | case 0x8a: | ||
607 | ch = 0x0160; | ||
608 | break; | ||
609 | case 0x8b: | ||
610 | ch = 0x2039; | ||
611 | break; | ||
612 | case 0x8c: | ||
613 | ch = 0x0152; | ||
614 | break; | ||
615 | /* | ||
616 | case 0x8e: | ||
617 | ch = 0x017d; | ||
618 | break; | ||
619 | */ | ||
620 | case 0x91: | ||
621 | ch = 0x2018; | ||
622 | break; | ||
623 | case 0x92: | ||
624 | ch = 0x2019; | ||
625 | break; | ||
626 | case 0x93: | ||
627 | ch = 0x201c; | ||
628 | break; | ||
629 | case 0x94: | ||
630 | ch = 0x201d; | ||
631 | break; | ||
632 | case 0x95: | ||
633 | ch = 0x2022; | ||
634 | break; | ||
635 | case 0x96: | ||
636 | ch = 0x2013; | ||
637 | break; | ||
638 | case 0x97: | ||
639 | ch = 0x2014; | ||
640 | break; | ||
641 | case 0x98: | ||
642 | ch = 0x02dc; | ||
643 | break; | ||
644 | case 0x99: | ||
645 | ch = 0x2122; | ||
646 | break; | ||
647 | case 0x9a: | ||
648 | ch = 0x0161; | ||
649 | break; | ||
650 | case 0x9b: | ||
651 | ch = 0x203a; | ||
652 | break; | ||
653 | case 0x9c: | ||
654 | ch = 0x0153; | ||
655 | break; | ||
656 | case 0x9e: | ||
657 | ch = 0x017e; | ||
658 | break; | ||
659 | case 0x9f: | ||
660 | ch = 0x0178; | ||
661 | break; | ||
662 | case 0x18: | ||
663 | ch = 0x2026; | ||
664 | break; | ||
665 | case 0x19: | ||
666 | ch = 0x2007; | ||
667 | break; | ||
668 | case 0x8d: | ||
669 | ch = 0x2662; | ||
670 | break; | ||
671 | case 0x8e: | ||
672 | ch = 0x2663; | ||
673 | break; | ||
674 | case 0x8f: | ||
675 | ch = 0x2661; | ||
676 | break; | ||
677 | case 0x90: | ||
678 | ch = 0x2660; | ||
679 | break; | ||
680 | default: | ||
681 | break; | ||
682 | } | ||
683 | } | ||
684 | #endif | ||