OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2003, 2004, 2006, 2007, 2008 Apple Inc. All right reserved. | 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008 Apple Inc. All right reserved. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
799 // ### implement rule L1 | 799 // ### implement rule L1 |
800 break; | 800 break; |
801 case WhiteSpaceNeutral: | 801 case WhiteSpaceNeutral: |
802 break; | 802 break; |
803 case OtherNeutral: | 803 case OtherNeutral: |
804 break; | 804 break; |
805 default: | 805 default: |
806 break; | 806 break; |
807 } | 807 } |
808 | 808 |
809 if (pastEnd) { | 809 if (pastEnd && eor == current) { |
810 if (eor == current) { | 810 if (!reachedEndOfLine) { |
811 if (!reachedEndOfLine) { | 811 eor = endOfLine; |
812 eor = endOfLine; | 812 switch (m_status.eor) { |
813 switch (m_status.eor) { | 813 case LeftToRight: |
814 case LeftToRight: | 814 case RightToLeft: |
815 case RightToLeft: | 815 case ArabicNumber: |
816 case ArabicNumber: | 816 m_direction = m_status.eor; |
817 m_direction = m_status.eor; | 817 break; |
818 break; | 818 case EuropeanNumber: |
819 case EuropeanNumber: | 819 m_direction = m_status.lastStrong == LeftToRight ? LeftT
oRight : EuropeanNumber; |
820 m_direction = m_status.lastStrong == LeftToRight ? L
eftToRight : EuropeanNumber; | 820 break; |
821 break; | 821 default: |
822 default: | 822 ASSERT(false); |
823 ASSERT(false); | |
824 } | |
825 appendRun(); | |
826 } | 823 } |
827 current = end; | 824 appendRun(); |
828 m_status = stateAtEnd.m_status; | |
829 sor = stateAtEnd.sor; | |
830 eor = stateAtEnd.eor; | |
831 last = stateAtEnd.last; | |
832 reachedEndOfLine = stateAtEnd.reachedEndOfLine; | |
833 lastBeforeET = stateAtEnd.lastBeforeET; | |
834 emptyRun = stateAtEnd.emptyRun; | |
835 m_direction = OtherNeutral; | |
836 break; | |
837 } | 825 } |
| 826 current = end; |
| 827 m_status = stateAtEnd.m_status; |
| 828 sor = stateAtEnd.sor; |
| 829 eor = stateAtEnd.eor; |
| 830 last = stateAtEnd.last; |
| 831 reachedEndOfLine = stateAtEnd.reachedEndOfLine; |
| 832 lastBeforeET = stateAtEnd.lastBeforeET; |
| 833 emptyRun = stateAtEnd.emptyRun; |
| 834 m_direction = OtherNeutral; |
| 835 break; |
838 } | 836 } |
839 | 837 |
840 // set m_status.last as needed. | 838 // set m_status.last as needed. |
841 switch (dirCurrent) { | 839 switch (dirCurrent) { |
842 case EuropeanNumberTerminator: | 840 case EuropeanNumberTerminator: |
843 if (m_status.last != EuropeanNumber) | 841 if (m_status.last != EuropeanNumber) |
844 m_status.last = EuropeanNumberTerminator; | 842 m_status.last = EuropeanNumberTerminator; |
845 break; | 843 break; |
846 case EuropeanNumberSeparator: | 844 case EuropeanNumberSeparator: |
847 case CommonNumberSeparator: | 845 case CommonNumberSeparator: |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
880 if (emptyRun && !(dirCurrent == RightToLeftEmbedding | 878 if (emptyRun && !(dirCurrent == RightToLeftEmbedding |
881 || dirCurrent == LeftToRightEmbedding | 879 || dirCurrent == LeftToRightEmbedding |
882 || dirCurrent == RightToLeftOverride | 880 || dirCurrent == RightToLeftOverride |
883 || dirCurrent == LeftToRightOverride | 881 || dirCurrent == LeftToRightOverride |
884 || dirCurrent == PopDirectionalFormat)) { | 882 || dirCurrent == PopDirectionalFormat)) { |
885 sor = current; | 883 sor = current; |
886 emptyRun = false; | 884 emptyRun = false; |
887 } | 885 } |
888 | 886 |
889 increment(); | 887 increment(); |
890 if (!m_currentExplicitEmbeddingSequence.isEmpty()) | 888 if (!m_currentExplicitEmbeddingSequence.isEmpty()) { |
891 commitExplicitEmbedding(); | 889 commitExplicitEmbedding(); |
| 890 if (pastEnd) { |
| 891 current = end; |
| 892 m_status = stateAtEnd.m_status; |
| 893 sor = stateAtEnd.sor; |
| 894 eor = stateAtEnd.eor; |
| 895 last = stateAtEnd.last; |
| 896 reachedEndOfLine = stateAtEnd.reachedEndOfLine; |
| 897 lastBeforeET = stateAtEnd.lastBeforeET; |
| 898 emptyRun = stateAtEnd.emptyRun; |
| 899 m_direction = OtherNeutral; |
| 900 break; |
| 901 } |
| 902 } |
892 | 903 |
893 if (emptyRun && (dirCurrent == RightToLeftEmbedding | 904 if (emptyRun && (dirCurrent == RightToLeftEmbedding |
894 || dirCurrent == LeftToRightEmbedding | 905 || dirCurrent == LeftToRightEmbedding |
895 || dirCurrent == RightToLeftOverride | 906 || dirCurrent == RightToLeftOverride |
896 || dirCurrent == LeftToRightOverride | 907 || dirCurrent == LeftToRightOverride |
897 || dirCurrent == PopDirectionalFormat)) { | 908 || dirCurrent == PopDirectionalFormat)) { |
898 // exclude the embedding char itself from the new run so that ATSUI
will never see it | 909 // exclude the embedding char itself from the new run so that ATSUI
will never see it |
899 eor = Iterator(); | 910 eor = Iterator(); |
900 last = current; | 911 last = current; |
901 sor = current; | 912 sor = current; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
962 } | 973 } |
963 levelHigh--; | 974 levelHigh--; |
964 } | 975 } |
965 } | 976 } |
966 endOfLine = Iterator(); | 977 endOfLine = Iterator(); |
967 } | 978 } |
968 | 979 |
969 } // namespace WebCore | 980 } // namespace WebCore |
970 | 981 |
971 #endif // BidiResolver_h | 982 #endif // BidiResolver_h |
OLD | NEW |