OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "xfa/fde/css/fde_cssdatatable.h" | 7 #include "xfa/fde/css/fde_cssdatatable.h" |
8 | 8 |
9 #include "core/fxcrt/include/fx_ext.h" | 9 #include "core/fxcrt/include/fx_ext.h" |
10 #include "xfa/fgas/crt/fgas_codepage.h" | 10 #include "xfa/fgas/crt/fgas_codepage.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 return TRUE; | 30 return TRUE; |
31 default: | 31 default: |
32 return FALSE; | 32 return FALSE; |
33 } | 33 } |
34 } | 34 } |
35 CFX_FloatRect FDE_CSSBoundaryToRect(IFDE_CSSBoundaryStyle* pBoundStyle, | 35 CFX_FloatRect FDE_CSSBoundaryToRect(IFDE_CSSBoundaryStyle* pBoundStyle, |
36 FX_FLOAT fContainerWidth, | 36 FX_FLOAT fContainerWidth, |
37 FX_BOOL bPadding, | 37 FX_BOOL bPadding, |
38 FX_BOOL bBorder, | 38 FX_BOOL bBorder, |
39 FX_BOOL bMargin) { | 39 FX_BOOL bMargin) { |
40 ASSERT(pBoundStyle != NULL); | |
41 FX_FLOAT fResult; | 40 FX_FLOAT fResult; |
42 const FDE_CSSRECT* pRect; | 41 const FDE_CSSRECT* pRect; |
43 CFX_FloatRect rect(0, 0, 0, 0); | 42 CFX_FloatRect rect(0, 0, 0, 0); |
44 if (bPadding) { | 43 if (bPadding) { |
45 pRect = pBoundStyle->GetPaddingWidth(); | 44 pRect = pBoundStyle->GetPaddingWidth(); |
46 if (pRect != NULL) { | 45 if (pRect) { |
47 if (FDE_CSSLengthToFloat(pRect->left, fContainerWidth, fResult)) { | 46 if (FDE_CSSLengthToFloat(pRect->left, fContainerWidth, fResult)) { |
48 rect.left += fResult; | 47 rect.left += fResult; |
49 } | 48 } |
50 if (FDE_CSSLengthToFloat(pRect->top, fContainerWidth, fResult)) { | 49 if (FDE_CSSLengthToFloat(pRect->top, fContainerWidth, fResult)) { |
51 rect.top += fResult; | 50 rect.top += fResult; |
52 } | 51 } |
53 if (FDE_CSSLengthToFloat(pRect->right, fContainerWidth, fResult)) { | 52 if (FDE_CSSLengthToFloat(pRect->right, fContainerWidth, fResult)) { |
54 rect.right += fResult; | 53 rect.right += fResult; |
55 } | 54 } |
56 if (FDE_CSSLengthToFloat(pRect->bottom, fContainerWidth, fResult)) { | 55 if (FDE_CSSLengthToFloat(pRect->bottom, fContainerWidth, fResult)) { |
57 rect.bottom += fResult; | 56 rect.bottom += fResult; |
58 } | 57 } |
59 } | 58 } |
60 } | 59 } |
61 if (bBorder) { | 60 if (bBorder) { |
62 pRect = pBoundStyle->GetBorderWidth(); | 61 pRect = pBoundStyle->GetBorderWidth(); |
63 if (pRect != NULL) { | 62 if (pRect) { |
64 if (FDE_CSSLengthToFloat(pRect->left, fContainerWidth, fResult)) { | 63 if (FDE_CSSLengthToFloat(pRect->left, fContainerWidth, fResult)) { |
65 rect.left += fResult; | 64 rect.left += fResult; |
66 } | 65 } |
67 if (FDE_CSSLengthToFloat(pRect->top, fContainerWidth, fResult)) { | 66 if (FDE_CSSLengthToFloat(pRect->top, fContainerWidth, fResult)) { |
68 rect.top += fResult; | 67 rect.top += fResult; |
69 } | 68 } |
70 if (FDE_CSSLengthToFloat(pRect->right, fContainerWidth, fResult)) { | 69 if (FDE_CSSLengthToFloat(pRect->right, fContainerWidth, fResult)) { |
71 rect.right += fResult; | 70 rect.right += fResult; |
72 } | 71 } |
73 if (FDE_CSSLengthToFloat(pRect->bottom, fContainerWidth, fResult)) { | 72 if (FDE_CSSLengthToFloat(pRect->bottom, fContainerWidth, fResult)) { |
74 rect.bottom += fResult; | 73 rect.bottom += fResult; |
75 } | 74 } |
76 } | 75 } |
77 } | 76 } |
78 if (bMargin) { | 77 if (bMargin) { |
79 pRect = pBoundStyle->GetMarginWidth(); | 78 pRect = pBoundStyle->GetMarginWidth(); |
80 if (pRect != NULL) { | 79 if (pRect) { |
81 if (FDE_CSSLengthToFloat(pRect->left, fContainerWidth, fResult)) { | 80 if (FDE_CSSLengthToFloat(pRect->left, fContainerWidth, fResult)) { |
82 rect.left += fResult; | 81 rect.left += fResult; |
83 } | 82 } |
84 if (FDE_CSSLengthToFloat(pRect->top, fContainerWidth, fResult)) { | 83 if (FDE_CSSLengthToFloat(pRect->top, fContainerWidth, fResult)) { |
85 rect.top += fResult; | 84 rect.top += fResult; |
86 } | 85 } |
87 if (FDE_CSSLengthToFloat(pRect->right, fContainerWidth, fResult)) { | 86 if (FDE_CSSLengthToFloat(pRect->right, fContainerWidth, fResult)) { |
88 rect.right += fResult; | 87 rect.right += fResult; |
89 } | 88 } |
90 if (FDE_CSSLengthToFloat(pRect->bottom, fContainerWidth, fResult)) { | 89 if (FDE_CSSLengthToFloat(pRect->bottom, fContainerWidth, fResult)) { |
91 rect.bottom += fResult; | 90 rect.bottom += fResult; |
92 } | 91 } |
93 } | 92 } |
94 } | 93 } |
95 return rect; | 94 return rect; |
96 } | 95 } |
97 uint32_t FDE_CSSFontStyleToFDE(IFDE_CSSFontStyle* pFontStyle) { | 96 uint32_t FDE_CSSFontStyleToFDE(IFDE_CSSFontStyle* pFontStyle) { |
98 ASSERT(pFontStyle != NULL); | |
99 uint32_t dwFontStyle = FX_FONTSTYLE_Normal; | 97 uint32_t dwFontStyle = FX_FONTSTYLE_Normal; |
100 if (pFontStyle->GetFontStyle() == FDE_CSSFONTSTYLE_Italic) { | 98 if (pFontStyle->GetFontStyle() == FDE_CSSFONTSTYLE_Italic) { |
101 dwFontStyle |= FX_FONTSTYLE_Italic; | 99 dwFontStyle |= FX_FONTSTYLE_Italic; |
102 } | 100 } |
103 if (pFontStyle->GetFontWeight() >= 700) { | 101 if (pFontStyle->GetFontWeight() >= 700) { |
104 dwFontStyle |= FX_FONTSTYLE_Bold; | 102 dwFontStyle |= FX_FONTSTYLE_Bold; |
105 } | 103 } |
106 return dwFontStyle; | 104 return dwFontStyle; |
107 } | 105 } |
108 static const FDE_CSSPROPERTYTABLE g_FDE_CSSProperties[] = { | 106 static const FDE_CSSPROPERTYTABLE g_FDE_CSSProperties[] = { |
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 {0xB6D2CF1F, 0xff808000}, {0xD19B5E1C, 0xffffff00}, | 553 {0xB6D2CF1F, 0xff808000}, {0xD19B5E1C, 0xffffff00}, |
556 {0xDB64391D, 0xff000000}, {0xF616D507, 0xff00ff00}, | 554 {0xDB64391D, 0xff000000}, {0xF616D507, 0xff00ff00}, |
557 {0xF6EFFF31, 0xff008000}, | 555 {0xF6EFFF31, 0xff008000}, |
558 }; | 556 }; |
559 static const FDE_CSSPERSUDOTABLE g_FDE_CSSPersudoType[] = { | 557 static const FDE_CSSPERSUDOTABLE g_FDE_CSSPersudoType[] = { |
560 {FDE_CSSPERSUDO_After, L":after", 0x16EE1FEC}, | 558 {FDE_CSSPERSUDO_After, L":after", 0x16EE1FEC}, |
561 {FDE_CSSPERSUDO_Before, L":before", 0x7DCDDE2D}, | 559 {FDE_CSSPERSUDO_Before, L":before", 0x7DCDDE2D}, |
562 }; | 560 }; |
563 FDE_LPCCSSPERSUDOTABLE FDE_GetCSSPersudoByEnum(FDE_CSSPERSUDO ePersudo) { | 561 FDE_LPCCSSPERSUDOTABLE FDE_GetCSSPersudoByEnum(FDE_CSSPERSUDO ePersudo) { |
564 return (ePersudo < FDE_CSSPERSUDO_NONE) ? (g_FDE_CSSPersudoType + ePersudo) | 562 return (ePersudo < FDE_CSSPERSUDO_NONE) ? (g_FDE_CSSPersudoType + ePersudo) |
565 : NULL; | 563 : nullptr; |
566 } | 564 } |
567 const FDE_CSSPROPERTYTABLE* FDE_GetCSSPropertyByName( | 565 const FDE_CSSPROPERTYTABLE* FDE_GetCSSPropertyByName( |
568 const CFX_WideStringC& wsName) { | 566 const CFX_WideStringC& wsName) { |
569 ASSERT(!wsName.IsEmpty()); | 567 ASSERT(!wsName.IsEmpty()); |
570 uint32_t dwHash = FX_HashCode_GetW(wsName, true); | 568 uint32_t dwHash = FX_HashCode_GetW(wsName, true); |
571 int32_t iEnd = FDE_CSSPROPERTY_MAX - 1; | 569 int32_t iEnd = FDE_CSSPROPERTY_MAX - 1; |
572 int32_t iMid, iStart = 0; | 570 int32_t iMid, iStart = 0; |
573 uint32_t dwMid; | 571 uint32_t dwMid; |
574 do { | 572 do { |
575 iMid = (iStart + iEnd) / 2; | 573 iMid = (iStart + iEnd) / 2; |
576 dwMid = g_FDE_CSSProperties[iMid].dwHash; | 574 dwMid = g_FDE_CSSProperties[iMid].dwHash; |
577 if (dwHash == dwMid) { | 575 if (dwHash == dwMid) { |
578 return g_FDE_CSSProperties + iMid; | 576 return g_FDE_CSSProperties + iMid; |
579 } else if (dwHash > dwMid) { | 577 } else if (dwHash > dwMid) { |
580 iStart = iMid + 1; | 578 iStart = iMid + 1; |
581 } else { | 579 } else { |
582 iEnd = iMid - 1; | 580 iEnd = iMid - 1; |
583 } | 581 } |
584 } while (iStart <= iEnd); | 582 } while (iStart <= iEnd); |
585 return NULL; | 583 return nullptr; |
586 } | 584 } |
587 const FDE_CSSPROPERTYTABLE* FDE_GetCSSPropertyByEnum(FDE_CSSPROPERTY eName) { | 585 const FDE_CSSPROPERTYTABLE* FDE_GetCSSPropertyByEnum(FDE_CSSPROPERTY eName) { |
588 return (eName < FDE_CSSPROPERTY_MAX) ? (g_FDE_CSSProperties + eName) : NULL; | 586 return (eName < FDE_CSSPROPERTY_MAX) ? (g_FDE_CSSProperties + eName) |
| 587 : nullptr; |
589 } | 588 } |
590 const FDE_CSSPROPERTYVALUETABLE* FDE_GetCSSPropertyValueByName( | 589 const FDE_CSSPROPERTYVALUETABLE* FDE_GetCSSPropertyValueByName( |
591 const CFX_WideStringC& wsName) { | 590 const CFX_WideStringC& wsName) { |
592 ASSERT(!wsName.IsEmpty()); | 591 ASSERT(!wsName.IsEmpty()); |
593 uint32_t dwHash = FX_HashCode_GetW(wsName, true); | 592 uint32_t dwHash = FX_HashCode_GetW(wsName, true); |
594 int32_t iEnd = FDE_CSSPROPERTYVALUE_MAX - 1; | 593 int32_t iEnd = FDE_CSSPROPERTYVALUE_MAX - 1; |
595 int32_t iMid, iStart = 0; | 594 int32_t iMid, iStart = 0; |
596 uint32_t dwMid; | 595 uint32_t dwMid; |
597 do { | 596 do { |
598 iMid = (iStart + iEnd) / 2; | 597 iMid = (iStart + iEnd) / 2; |
599 dwMid = g_FDE_CSSPropertyValues[iMid].dwHash; | 598 dwMid = g_FDE_CSSPropertyValues[iMid].dwHash; |
600 if (dwHash == dwMid) { | 599 if (dwHash == dwMid) { |
601 return g_FDE_CSSPropertyValues + iMid; | 600 return g_FDE_CSSPropertyValues + iMid; |
602 } else if (dwHash > dwMid) { | 601 } else if (dwHash > dwMid) { |
603 iStart = iMid + 1; | 602 iStart = iMid + 1; |
604 } else { | 603 } else { |
605 iEnd = iMid - 1; | 604 iEnd = iMid - 1; |
606 } | 605 } |
607 } while (iStart <= iEnd); | 606 } while (iStart <= iEnd); |
608 return NULL; | 607 return nullptr; |
609 } | 608 } |
610 const FDE_CSSPROPERTYVALUETABLE* FDE_GetCSSPropertyValueByEnum( | 609 const FDE_CSSPROPERTYVALUETABLE* FDE_GetCSSPropertyValueByEnum( |
611 FDE_CSSPROPERTYVALUE eName) { | 610 FDE_CSSPROPERTYVALUE eName) { |
612 return (eName < FDE_CSSPROPERTYVALUE_MAX) ? (g_FDE_CSSPropertyValues + eName) | 611 return (eName < FDE_CSSPROPERTYVALUE_MAX) ? (g_FDE_CSSPropertyValues + eName) |
613 : NULL; | 612 : nullptr; |
614 } | 613 } |
615 FDE_LPCCSSMEDIATYPETABLE FDE_GetCSSMediaTypeByName( | 614 FDE_LPCCSSMEDIATYPETABLE FDE_GetCSSMediaTypeByName( |
616 const CFX_WideStringC& wsName) { | 615 const CFX_WideStringC& wsName) { |
617 ASSERT(!wsName.IsEmpty()); | 616 ASSERT(!wsName.IsEmpty()); |
618 uint16_t wHash = FX_HashCode_GetW(wsName, true); | 617 uint16_t wHash = FX_HashCode_GetW(wsName, true); |
619 int32_t iEnd = | 618 int32_t iEnd = |
620 sizeof(g_FDE_CSSMediaTypes) / sizeof(FDE_CSSMEDIATYPETABLE) - 1; | 619 sizeof(g_FDE_CSSMediaTypes) / sizeof(FDE_CSSMEDIATYPETABLE) - 1; |
621 int32_t iMid, iStart = 0; | 620 int32_t iMid, iStart = 0; |
622 uint16_t uMid; | 621 uint16_t uMid; |
623 do { | 622 do { |
624 iMid = (iStart + iEnd) / 2; | 623 iMid = (iStart + iEnd) / 2; |
625 uMid = g_FDE_CSSMediaTypes[iMid].wHash; | 624 uMid = g_FDE_CSSMediaTypes[iMid].wHash; |
626 if (wHash == uMid) { | 625 if (wHash == uMid) { |
627 return g_FDE_CSSMediaTypes + iMid; | 626 return g_FDE_CSSMediaTypes + iMid; |
628 } else if (wHash > uMid) { | 627 } else if (wHash > uMid) { |
629 iStart = iMid + 1; | 628 iStart = iMid + 1; |
630 } else { | 629 } else { |
631 iEnd = iMid - 1; | 630 iEnd = iMid - 1; |
632 } | 631 } |
633 } while (iStart <= iEnd); | 632 } while (iStart <= iEnd); |
634 return NULL; | 633 return nullptr; |
635 } | 634 } |
636 FDE_LPCCSSLENGTHUNITTABLE FDE_GetCSSLengthUnitByName( | 635 FDE_LPCCSSLENGTHUNITTABLE FDE_GetCSSLengthUnitByName( |
637 const CFX_WideStringC& wsName) { | 636 const CFX_WideStringC& wsName) { |
638 ASSERT(!wsName.IsEmpty()); | 637 ASSERT(!wsName.IsEmpty()); |
639 uint16_t wHash = FX_HashCode_GetW(wsName, true); | 638 uint16_t wHash = FX_HashCode_GetW(wsName, true); |
640 int32_t iEnd = | 639 int32_t iEnd = |
641 sizeof(g_FDE_CSSLengthUnits) / sizeof(FDE_CSSLENGTHUNITTABLE) - 1; | 640 sizeof(g_FDE_CSSLengthUnits) / sizeof(FDE_CSSLENGTHUNITTABLE) - 1; |
642 int32_t iMid, iStart = 0; | 641 int32_t iMid, iStart = 0; |
643 uint16_t wMid; | 642 uint16_t wMid; |
644 do { | 643 do { |
645 iMid = (iStart + iEnd) / 2; | 644 iMid = (iStart + iEnd) / 2; |
646 wMid = g_FDE_CSSLengthUnits[iMid].wHash; | 645 wMid = g_FDE_CSSLengthUnits[iMid].wHash; |
647 if (wHash == wMid) { | 646 if (wHash == wMid) { |
648 return g_FDE_CSSLengthUnits + iMid; | 647 return g_FDE_CSSLengthUnits + iMid; |
649 } else if (wHash > wMid) { | 648 } else if (wHash > wMid) { |
650 iStart = iMid + 1; | 649 iStart = iMid + 1; |
651 } else { | 650 } else { |
652 iEnd = iMid - 1; | 651 iEnd = iMid - 1; |
653 } | 652 } |
654 } while (iStart <= iEnd); | 653 } while (iStart <= iEnd); |
655 return NULL; | 654 return nullptr; |
656 } | 655 } |
657 FDE_LPCCSSCOLORTABLE FDE_GetCSSColorByName(const CFX_WideStringC& wsName) { | 656 FDE_LPCCSSCOLORTABLE FDE_GetCSSColorByName(const CFX_WideStringC& wsName) { |
658 ASSERT(!wsName.IsEmpty()); | 657 ASSERT(!wsName.IsEmpty()); |
659 uint32_t dwHash = FX_HashCode_GetW(wsName, true); | 658 uint32_t dwHash = FX_HashCode_GetW(wsName, true); |
660 int32_t iEnd = sizeof(g_FDE_CSSColors) / sizeof(FDE_CSSCOLORTABLE) - 1; | 659 int32_t iEnd = sizeof(g_FDE_CSSColors) / sizeof(FDE_CSSCOLORTABLE) - 1; |
661 int32_t iMid, iStart = 0; | 660 int32_t iMid, iStart = 0; |
662 uint32_t dwMid; | 661 uint32_t dwMid; |
663 do { | 662 do { |
664 iMid = (iStart + iEnd) / 2; | 663 iMid = (iStart + iEnd) / 2; |
665 dwMid = g_FDE_CSSColors[iMid].dwHash; | 664 dwMid = g_FDE_CSSColors[iMid].dwHash; |
666 if (dwHash == dwMid) { | 665 if (dwHash == dwMid) { |
667 return g_FDE_CSSColors + iMid; | 666 return g_FDE_CSSColors + iMid; |
668 } else if (dwHash > dwMid) { | 667 } else if (dwHash > dwMid) { |
669 iStart = iMid + 1; | 668 iStart = iMid + 1; |
670 } else { | 669 } else { |
671 iEnd = iMid - 1; | 670 iEnd = iMid - 1; |
672 } | 671 } |
673 } while (iStart <= iEnd); | 672 } while (iStart <= iEnd); |
674 return NULL; | 673 return nullptr; |
675 } | 674 } |
676 | 675 |
677 FX_BOOL FDE_ParseCSSNumber(const FX_WCHAR* pszValue, | 676 FX_BOOL FDE_ParseCSSNumber(const FX_WCHAR* pszValue, |
678 int32_t iValueLen, | 677 int32_t iValueLen, |
679 FX_FLOAT& fValue, | 678 FX_FLOAT& fValue, |
680 FDE_CSSPRIMITIVETYPE& eUnit) { | 679 FDE_CSSPRIMITIVETYPE& eUnit) { |
681 ASSERT(pszValue && iValueLen > 0); | 680 ASSERT(pszValue && iValueLen > 0); |
682 int32_t iUsedLen = 0; | 681 int32_t iUsedLen = 0; |
683 fValue = FX_wcstof(pszValue, iValueLen, &iUsedLen); | 682 fValue = FX_wcstof(pszValue, iValueLen, &iUsedLen); |
684 if (iUsedLen <= 0) | 683 if (iUsedLen <= 0) |
(...skipping 10 matching lines...) Expand all Loading... |
695 if (pUnit) | 694 if (pUnit) |
696 eUnit = (FDE_CSSPRIMITIVETYPE)pUnit->wValue; | 695 eUnit = (FDE_CSSPRIMITIVETYPE)pUnit->wValue; |
697 } | 696 } |
698 return TRUE; | 697 return TRUE; |
699 } | 698 } |
700 | 699 |
701 FX_BOOL FDE_ParseCSSString(const FX_WCHAR* pszValue, | 700 FX_BOOL FDE_ParseCSSString(const FX_WCHAR* pszValue, |
702 int32_t iValueLen, | 701 int32_t iValueLen, |
703 int32_t& iOffset, | 702 int32_t& iOffset, |
704 int32_t& iLength) { | 703 int32_t& iLength) { |
705 ASSERT(pszValue != NULL && iValueLen > 0); | 704 ASSERT(pszValue && iValueLen > 0); |
706 iOffset = 0; | 705 iOffset = 0; |
707 iLength = iValueLen; | 706 iLength = iValueLen; |
708 if (iValueLen >= 2) { | 707 if (iValueLen >= 2) { |
709 FX_WCHAR first = pszValue[0], last = pszValue[iValueLen - 1]; | 708 FX_WCHAR first = pszValue[0], last = pszValue[iValueLen - 1]; |
710 if ((first == '\"' && last == '\"') || (first == '\'' && last == '\'')) { | 709 if ((first == '\"' && last == '\"') || (first == '\'' && last == '\'')) { |
711 iOffset = 1, iLength -= 2; | 710 iOffset = 1, iLength -= 2; |
712 } | 711 } |
713 } | 712 } |
714 return iValueLen > 0; | 713 return iValueLen > 0; |
715 } | 714 } |
716 | 715 |
717 FX_BOOL FDE_ParseCSSURI(const FX_WCHAR* pszValue, | 716 FX_BOOL FDE_ParseCSSURI(const FX_WCHAR* pszValue, |
718 int32_t iValueLen, | 717 int32_t iValueLen, |
719 int32_t& iOffset, | 718 int32_t& iOffset, |
720 int32_t& iLength) { | 719 int32_t& iLength) { |
721 ASSERT(pszValue != NULL && iValueLen > 0); | 720 ASSERT(pszValue && iValueLen > 0); |
722 if (iValueLen < 6 || pszValue[iValueLen - 1] != ')' || | 721 if (iValueLen < 6 || pszValue[iValueLen - 1] != ')' || |
723 FX_wcsnicmp(L"url(", pszValue, 4)) { | 722 FX_wcsnicmp(L"url(", pszValue, 4)) { |
724 return FALSE; | 723 return FALSE; |
725 } | 724 } |
726 if (FDE_ParseCSSString(pszValue + 4, iValueLen - 5, iOffset, iLength)) { | 725 if (FDE_ParseCSSString(pszValue + 4, iValueLen - 5, iOffset, iLength)) { |
727 iOffset += 4; | 726 iOffset += 4; |
728 return TRUE; | 727 return TRUE; |
729 } | 728 } |
730 return FALSE; | 729 return FALSE; |
731 } | 730 } |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
890 } | 889 } |
891 while (iBracketCount > 0 && m_pCur < m_pEnd) { | 890 while (iBracketCount > 0 && m_pCur < m_pEnd) { |
892 if (*m_pCur == ')') { | 891 if (*m_pCur == ')') { |
893 iBracketCount--; | 892 iBracketCount--; |
894 } | 893 } |
895 m_pCur++; | 894 m_pCur++; |
896 } | 895 } |
897 } | 896 } |
898 return m_pCur - pStart; | 897 return m_pCur - pStart; |
899 } | 898 } |
OLD | NEW |