| 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 "fpdfsdk/include/fxedit/fxet_edit.h" | 7 #include "fpdfsdk/include/fxedit/fxet_edit.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 CFX_Edit_Refresh::CFX_Edit_Refresh() {} | 148 CFX_Edit_Refresh::CFX_Edit_Refresh() {} |
| 149 | 149 |
| 150 CFX_Edit_Refresh::~CFX_Edit_Refresh() {} | 150 CFX_Edit_Refresh::~CFX_Edit_Refresh() {} |
| 151 | 151 |
| 152 void CFX_Edit_Refresh::BeginRefresh() { | 152 void CFX_Edit_Refresh::BeginRefresh() { |
| 153 m_RefreshRects.Empty(); | 153 m_RefreshRects.Empty(); |
| 154 m_OldLineRects = m_NewLineRects; | 154 m_OldLineRects = m_NewLineRects; |
| 155 } | 155 } |
| 156 | 156 |
| 157 void CFX_Edit_Refresh::Push(const CPVT_WordRange& linerange, | 157 void CFX_Edit_Refresh::Push(const CPVT_WordRange& linerange, |
| 158 const CFX_FloatRect& rect) { | 158 const CPDF_Rect& rect) { |
| 159 m_NewLineRects.Add(linerange, rect); | 159 m_NewLineRects.Add(linerange, rect); |
| 160 } | 160 } |
| 161 | 161 |
| 162 void CFX_Edit_Refresh::NoAnalyse() { | 162 void CFX_Edit_Refresh::NoAnalyse() { |
| 163 { | 163 { |
| 164 for (int32_t i = 0, sz = m_OldLineRects.GetSize(); i < sz; i++) | 164 for (int32_t i = 0, sz = m_OldLineRects.GetSize(); i < sz; i++) |
| 165 if (CFX_Edit_LineRect* pOldRect = m_OldLineRects.GetAt(i)) | 165 if (CFX_Edit_LineRect* pOldRect = m_OldLineRects.GetAt(i)) |
| 166 m_RefreshRects.Add(pOldRect->m_rcLine); | 166 m_RefreshRects.Add(pOldRect->m_rcLine); |
| 167 } | 167 } |
| 168 | 168 |
| 169 { | 169 { |
| 170 for (int32_t i = 0, sz = m_NewLineRects.GetSize(); i < sz; i++) | 170 for (int32_t i = 0, sz = m_NewLineRects.GetSize(); i < sz; i++) |
| 171 if (CFX_Edit_LineRect* pNewRect = m_NewLineRects.GetAt(i)) | 171 if (CFX_Edit_LineRect* pNewRect = m_NewLineRects.GetAt(i)) |
| 172 m_RefreshRects.Add(pNewRect->m_rcLine); | 172 m_RefreshRects.Add(pNewRect->m_rcLine); |
| 173 } | 173 } |
| 174 } | 174 } |
| 175 | 175 |
| 176 void CFX_Edit_Refresh::Analyse(int32_t nAlignment) { | 176 void CFX_Edit_Refresh::Analyse(int32_t nAlignment) { |
| 177 FX_BOOL bLineTopChanged = FALSE; | 177 FX_BOOL bLineTopChanged = FALSE; |
| 178 CFX_FloatRect rcResult; | 178 CPDF_Rect rcResult; |
| 179 FX_FLOAT fWidthDiff; | 179 FX_FLOAT fWidthDiff; |
| 180 | 180 |
| 181 int32_t szMax = std::max(m_OldLineRects.GetSize(), m_NewLineRects.GetSize()); | 181 int32_t szMax = std::max(m_OldLineRects.GetSize(), m_NewLineRects.GetSize()); |
| 182 int32_t i = 0; | 182 int32_t i = 0; |
| 183 | 183 |
| 184 while (i < szMax) { | 184 while (i < szMax) { |
| 185 CFX_Edit_LineRect* pOldRect = m_OldLineRects.GetAt(i); | 185 CFX_Edit_LineRect* pOldRect = m_OldLineRects.GetAt(i); |
| 186 CFX_Edit_LineRect* pNewRect = m_NewLineRects.GetAt(i); | 186 CFX_Edit_LineRect* pNewRect = m_NewLineRects.GetAt(i); |
| 187 | 187 |
| 188 if (pOldRect) { | 188 if (pOldRect) { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 } | 233 } |
| 234 } else { | 234 } else { |
| 235 if (pNewRect) { | 235 if (pNewRect) { |
| 236 m_RefreshRects.Add(pNewRect->m_rcLine); | 236 m_RefreshRects.Add(pNewRect->m_rcLine); |
| 237 } | 237 } |
| 238 } | 238 } |
| 239 i++; | 239 i++; |
| 240 } | 240 } |
| 241 } | 241 } |
| 242 | 242 |
| 243 void CFX_Edit_Refresh::AddRefresh(const CFX_FloatRect& rect) { | 243 void CFX_Edit_Refresh::AddRefresh(const CPDF_Rect& rect) { |
| 244 m_RefreshRects.Add(rect); | 244 m_RefreshRects.Add(rect); |
| 245 } | 245 } |
| 246 | 246 |
| 247 const CFX_Edit_RectArray* CFX_Edit_Refresh::GetRefreshRects() const { | 247 const CFX_Edit_RectArray* CFX_Edit_Refresh::GetRefreshRects() const { |
| 248 return &m_RefreshRects; | 248 return &m_RefreshRects; |
| 249 } | 249 } |
| 250 | 250 |
| 251 void CFX_Edit_Refresh::EndRefresh() { | 251 void CFX_Edit_Refresh::EndRefresh() { |
| 252 m_RefreshRects.Empty(); | 252 m_RefreshRects.Empty(); |
| 253 } | 253 } |
| (...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 807 return m_pVT; | 807 return m_pVT; |
| 808 } | 808 } |
| 809 | 809 |
| 810 IFX_Edit_FontMap* CFX_Edit::GetFontMap() { | 810 IFX_Edit_FontMap* CFX_Edit::GetFontMap() { |
| 811 if (m_pVTProvide) | 811 if (m_pVTProvide) |
| 812 return m_pVTProvide->GetFontMap(); | 812 return m_pVTProvide->GetFontMap(); |
| 813 | 813 |
| 814 return NULL; | 814 return NULL; |
| 815 } | 815 } |
| 816 | 816 |
| 817 void CFX_Edit::SetPlateRect(const CFX_FloatRect& rect, FX_BOOL bPaint) { | 817 void CFX_Edit::SetPlateRect(const CPDF_Rect& rect, FX_BOOL bPaint) { |
| 818 m_pVT->SetPlateRect(rect); | 818 m_pVT->SetPlateRect(rect); |
| 819 m_ptScrollPos = CFX_FloatPoint(rect.left, rect.top); | 819 m_ptScrollPos = CPDF_Point(rect.left, rect.top); |
| 820 if (bPaint) | 820 if (bPaint) |
| 821 Paint(); | 821 Paint(); |
| 822 } | 822 } |
| 823 | 823 |
| 824 void CFX_Edit::SetAlignmentH(int32_t nFormat, FX_BOOL bPaint) { | 824 void CFX_Edit::SetAlignmentH(int32_t nFormat, FX_BOOL bPaint) { |
| 825 m_pVT->SetAlignment(nFormat); | 825 m_pVT->SetAlignment(nFormat); |
| 826 if (bPaint) | 826 if (bPaint) |
| 827 Paint(); | 827 Paint(); |
| 828 } | 828 } |
| 829 | 829 |
| (...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1624 } | 1624 } |
| 1625 | 1625 |
| 1626 FX_WORD CFX_Edit::GetPasswordChar() const { | 1626 FX_WORD CFX_Edit::GetPasswordChar() const { |
| 1627 return m_pVT->GetPasswordChar(); | 1627 return m_pVT->GetPasswordChar(); |
| 1628 } | 1628 } |
| 1629 | 1629 |
| 1630 int32_t CFX_Edit::GetCharArray() const { | 1630 int32_t CFX_Edit::GetCharArray() const { |
| 1631 return m_pVT->GetCharArray(); | 1631 return m_pVT->GetCharArray(); |
| 1632 } | 1632 } |
| 1633 | 1633 |
| 1634 CFX_FloatRect CFX_Edit::GetPlateRect() const { | 1634 CPDF_Rect CFX_Edit::GetPlateRect() const { |
| 1635 return m_pVT->GetPlateRect(); | 1635 return m_pVT->GetPlateRect(); |
| 1636 } | 1636 } |
| 1637 | 1637 |
| 1638 CFX_FloatRect CFX_Edit::GetContentRect() const { | 1638 CPDF_Rect CFX_Edit::GetContentRect() const { |
| 1639 return VTToEdit(m_pVT->GetContentRect()); | 1639 return VTToEdit(m_pVT->GetContentRect()); |
| 1640 } | 1640 } |
| 1641 | 1641 |
| 1642 int32_t CFX_Edit::GetHorzScale() const { | 1642 int32_t CFX_Edit::GetHorzScale() const { |
| 1643 return m_pVT->GetHorzScale(); | 1643 return m_pVT->GetHorzScale(); |
| 1644 } | 1644 } |
| 1645 | 1645 |
| 1646 FX_FLOAT CFX_Edit::GetCharSpace() const { | 1646 FX_FLOAT CFX_Edit::GetCharSpace() const { |
| 1647 return m_pVT->GetCharSpace(); | 1647 return m_pVT->GetCharSpace(); |
| 1648 } | 1648 } |
| 1649 | 1649 |
| 1650 CPVT_WordRange CFX_Edit::GetWholeWordRange() const { | 1650 CPVT_WordRange CFX_Edit::GetWholeWordRange() const { |
| 1651 if (m_pVT->IsValid()) | 1651 if (m_pVT->IsValid()) |
| 1652 return CPVT_WordRange(m_pVT->GetBeginWordPlace(), m_pVT->GetEndWordPlace()); | 1652 return CPVT_WordRange(m_pVT->GetBeginWordPlace(), m_pVT->GetEndWordPlace()); |
| 1653 | 1653 |
| 1654 return CPVT_WordRange(); | 1654 return CPVT_WordRange(); |
| 1655 } | 1655 } |
| 1656 | 1656 |
| 1657 CPVT_WordRange CFX_Edit::GetVisibleWordRange() const { | 1657 CPVT_WordRange CFX_Edit::GetVisibleWordRange() const { |
| 1658 if (m_bEnableOverflow) | 1658 if (m_bEnableOverflow) |
| 1659 return GetWholeWordRange(); | 1659 return GetWholeWordRange(); |
| 1660 | 1660 |
| 1661 if (m_pVT->IsValid()) { | 1661 if (m_pVT->IsValid()) { |
| 1662 CFX_FloatRect rcPlate = m_pVT->GetPlateRect(); | 1662 CPDF_Rect rcPlate = m_pVT->GetPlateRect(); |
| 1663 | 1663 |
| 1664 CPVT_WordPlace place1 = m_pVT->SearchWordPlace( | 1664 CPVT_WordPlace place1 = |
| 1665 EditToVT(CFX_FloatPoint(rcPlate.left, rcPlate.top))); | 1665 m_pVT->SearchWordPlace(EditToVT(CPDF_Point(rcPlate.left, rcPlate.top))); |
| 1666 CPVT_WordPlace place2 = m_pVT->SearchWordPlace( | 1666 CPVT_WordPlace place2 = m_pVT->SearchWordPlace( |
| 1667 EditToVT(CFX_FloatPoint(rcPlate.right, rcPlate.bottom))); | 1667 EditToVT(CPDF_Point(rcPlate.right, rcPlate.bottom))); |
| 1668 | 1668 |
| 1669 return CPVT_WordRange(place1, place2); | 1669 return CPVT_WordRange(place1, place2); |
| 1670 } | 1670 } |
| 1671 | 1671 |
| 1672 return CPVT_WordRange(); | 1672 return CPVT_WordRange(); |
| 1673 } | 1673 } |
| 1674 | 1674 |
| 1675 CPVT_WordPlace CFX_Edit::SearchWordPlace(const CFX_FloatPoint& point) const { | 1675 CPVT_WordPlace CFX_Edit::SearchWordPlace(const CPDF_Point& point) const { |
| 1676 if (m_pVT->IsValid()) { | 1676 if (m_pVT->IsValid()) { |
| 1677 return m_pVT->SearchWordPlace(EditToVT(point)); | 1677 return m_pVT->SearchWordPlace(EditToVT(point)); |
| 1678 } | 1678 } |
| 1679 | 1679 |
| 1680 return CPVT_WordPlace(); | 1680 return CPVT_WordPlace(); |
| 1681 } | 1681 } |
| 1682 | 1682 |
| 1683 void CFX_Edit::Paint() { | 1683 void CFX_Edit::Paint() { |
| 1684 if (m_pVT->IsValid()) { | 1684 if (m_pVT->IsValid()) { |
| 1685 RearrangeAll(); | 1685 RearrangeAll(); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 1705 m_pVT->UpdateWordPlace(m_wpCaret); | 1705 m_pVT->UpdateWordPlace(m_wpCaret); |
| 1706 m_pVT->RearrangePart(range); | 1706 m_pVT->RearrangePart(range); |
| 1707 m_pVT->UpdateWordPlace(m_wpCaret); | 1707 m_pVT->UpdateWordPlace(m_wpCaret); |
| 1708 SetScrollInfo(); | 1708 SetScrollInfo(); |
| 1709 SetContentChanged(); | 1709 SetContentChanged(); |
| 1710 } | 1710 } |
| 1711 } | 1711 } |
| 1712 | 1712 |
| 1713 void CFX_Edit::SetContentChanged() { | 1713 void CFX_Edit::SetContentChanged() { |
| 1714 if (m_bNotify && m_pNotify) { | 1714 if (m_bNotify && m_pNotify) { |
| 1715 CFX_FloatRect rcContent = m_pVT->GetContentRect(); | 1715 CPDF_Rect rcContent = m_pVT->GetContentRect(); |
| 1716 if (rcContent.Width() != m_rcOldContent.Width() || | 1716 if (rcContent.Width() != m_rcOldContent.Width() || |
| 1717 rcContent.Height() != m_rcOldContent.Height()) { | 1717 rcContent.Height() != m_rcOldContent.Height()) { |
| 1718 if (!m_bNotifyFlag) { | 1718 if (!m_bNotifyFlag) { |
| 1719 m_bNotifyFlag = TRUE; | 1719 m_bNotifyFlag = TRUE; |
| 1720 m_pNotify->IOnContentChange(rcContent); | 1720 m_pNotify->IOnContentChange(rcContent); |
| 1721 m_bNotifyFlag = FALSE; | 1721 m_bNotifyFlag = FALSE; |
| 1722 } | 1722 } |
| 1723 m_rcOldContent = rcContent; | 1723 m_rcOldContent = rcContent; |
| 1724 } | 1724 } |
| 1725 } | 1725 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 1744 m_SelState.Default(); | 1744 m_SelState.Default(); |
| 1745 Refresh(RP_OPTIONAL, &wrTemp); | 1745 Refresh(RP_OPTIONAL, &wrTemp); |
| 1746 } | 1746 } |
| 1747 } | 1747 } |
| 1748 } | 1748 } |
| 1749 | 1749 |
| 1750 FX_BOOL CFX_Edit::IsSelected() const { | 1750 FX_BOOL CFX_Edit::IsSelected() const { |
| 1751 return m_SelState.IsExist(); | 1751 return m_SelState.IsExist(); |
| 1752 } | 1752 } |
| 1753 | 1753 |
| 1754 CFX_FloatPoint CFX_Edit::VTToEdit(const CFX_FloatPoint& point) const { | 1754 CPDF_Point CFX_Edit::VTToEdit(const CPDF_Point& point) const { |
| 1755 CFX_FloatRect rcContent = m_pVT->GetContentRect(); | 1755 CPDF_Rect rcContent = m_pVT->GetContentRect(); |
| 1756 CFX_FloatRect rcPlate = m_pVT->GetPlateRect(); | 1756 CPDF_Rect rcPlate = m_pVT->GetPlateRect(); |
| 1757 | 1757 |
| 1758 FX_FLOAT fPadding = 0.0f; | 1758 FX_FLOAT fPadding = 0.0f; |
| 1759 | 1759 |
| 1760 switch (m_nAlignment) { | 1760 switch (m_nAlignment) { |
| 1761 case 0: | 1761 case 0: |
| 1762 fPadding = 0.0f; | 1762 fPadding = 0.0f; |
| 1763 break; | 1763 break; |
| 1764 case 1: | 1764 case 1: |
| 1765 fPadding = (rcPlate.Height() - rcContent.Height()) * 0.5f; | 1765 fPadding = (rcPlate.Height() - rcContent.Height()) * 0.5f; |
| 1766 break; | 1766 break; |
| 1767 case 2: | 1767 case 2: |
| 1768 fPadding = rcPlate.Height() - rcContent.Height(); | 1768 fPadding = rcPlate.Height() - rcContent.Height(); |
| 1769 break; | 1769 break; |
| 1770 } | 1770 } |
| 1771 | 1771 |
| 1772 return CFX_FloatPoint(point.x - (m_ptScrollPos.x - rcPlate.left), | 1772 return CPDF_Point(point.x - (m_ptScrollPos.x - rcPlate.left), |
| 1773 point.y - (m_ptScrollPos.y + fPadding - rcPlate.top)); | 1773 point.y - (m_ptScrollPos.y + fPadding - rcPlate.top)); |
| 1774 } | 1774 } |
| 1775 | 1775 |
| 1776 CFX_FloatPoint CFX_Edit::EditToVT(const CFX_FloatPoint& point) const { | 1776 CPDF_Point CFX_Edit::EditToVT(const CPDF_Point& point) const { |
| 1777 CFX_FloatRect rcContent = m_pVT->GetContentRect(); | 1777 CPDF_Rect rcContent = m_pVT->GetContentRect(); |
| 1778 CFX_FloatRect rcPlate = m_pVT->GetPlateRect(); | 1778 CPDF_Rect rcPlate = m_pVT->GetPlateRect(); |
| 1779 | 1779 |
| 1780 FX_FLOAT fPadding = 0.0f; | 1780 FX_FLOAT fPadding = 0.0f; |
| 1781 | 1781 |
| 1782 switch (m_nAlignment) { | 1782 switch (m_nAlignment) { |
| 1783 case 0: | 1783 case 0: |
| 1784 fPadding = 0.0f; | 1784 fPadding = 0.0f; |
| 1785 break; | 1785 break; |
| 1786 case 1: | 1786 case 1: |
| 1787 fPadding = (rcPlate.Height() - rcContent.Height()) * 0.5f; | 1787 fPadding = (rcPlate.Height() - rcContent.Height()) * 0.5f; |
| 1788 break; | 1788 break; |
| 1789 case 2: | 1789 case 2: |
| 1790 fPadding = rcPlate.Height() - rcContent.Height(); | 1790 fPadding = rcPlate.Height() - rcContent.Height(); |
| 1791 break; | 1791 break; |
| 1792 } | 1792 } |
| 1793 | 1793 |
| 1794 return CFX_FloatPoint(point.x + (m_ptScrollPos.x - rcPlate.left), | 1794 return CPDF_Point(point.x + (m_ptScrollPos.x - rcPlate.left), |
| 1795 point.y + (m_ptScrollPos.y + fPadding - rcPlate.top)); | 1795 point.y + (m_ptScrollPos.y + fPadding - rcPlate.top)); |
| 1796 } | 1796 } |
| 1797 | 1797 |
| 1798 CFX_FloatRect CFX_Edit::VTToEdit(const CFX_FloatRect& rect) const { | 1798 CPDF_Rect CFX_Edit::VTToEdit(const CPDF_Rect& rect) const { |
| 1799 CFX_FloatPoint ptLeftBottom = | 1799 CPDF_Point ptLeftBottom = VTToEdit(CPDF_Point(rect.left, rect.bottom)); |
| 1800 VTToEdit(CFX_FloatPoint(rect.left, rect.bottom)); | 1800 CPDF_Point ptRightTop = VTToEdit(CPDF_Point(rect.right, rect.top)); |
| 1801 CFX_FloatPoint ptRightTop = VTToEdit(CFX_FloatPoint(rect.right, rect.top)); | |
| 1802 | 1801 |
| 1803 return CFX_FloatRect(ptLeftBottom.x, ptLeftBottom.y, ptRightTop.x, | 1802 return CPDF_Rect(ptLeftBottom.x, ptLeftBottom.y, ptRightTop.x, ptRightTop.y); |
| 1804 ptRightTop.y); | |
| 1805 } | 1803 } |
| 1806 | 1804 |
| 1807 CFX_FloatRect CFX_Edit::EditToVT(const CFX_FloatRect& rect) const { | 1805 CPDF_Rect CFX_Edit::EditToVT(const CPDF_Rect& rect) const { |
| 1808 CFX_FloatPoint ptLeftBottom = | 1806 CPDF_Point ptLeftBottom = EditToVT(CPDF_Point(rect.left, rect.bottom)); |
| 1809 EditToVT(CFX_FloatPoint(rect.left, rect.bottom)); | 1807 CPDF_Point ptRightTop = EditToVT(CPDF_Point(rect.right, rect.top)); |
| 1810 CFX_FloatPoint ptRightTop = EditToVT(CFX_FloatPoint(rect.right, rect.top)); | |
| 1811 | 1808 |
| 1812 return CFX_FloatRect(ptLeftBottom.x, ptLeftBottom.y, ptRightTop.x, | 1809 return CPDF_Rect(ptLeftBottom.x, ptLeftBottom.y, ptRightTop.x, ptRightTop.y); |
| 1813 ptRightTop.y); | |
| 1814 } | 1810 } |
| 1815 | 1811 |
| 1816 void CFX_Edit::SetScrollInfo() { | 1812 void CFX_Edit::SetScrollInfo() { |
| 1817 if (m_bNotify && m_pNotify) { | 1813 if (m_bNotify && m_pNotify) { |
| 1818 CFX_FloatRect rcPlate = m_pVT->GetPlateRect(); | 1814 CPDF_Rect rcPlate = m_pVT->GetPlateRect(); |
| 1819 CFX_FloatRect rcContent = m_pVT->GetContentRect(); | 1815 CPDF_Rect rcContent = m_pVT->GetContentRect(); |
| 1820 | 1816 |
| 1821 if (!m_bNotifyFlag) { | 1817 if (!m_bNotifyFlag) { |
| 1822 m_bNotifyFlag = TRUE; | 1818 m_bNotifyFlag = TRUE; |
| 1823 m_pNotify->IOnSetScrollInfoX(rcPlate.left, rcPlate.right, rcContent.left, | 1819 m_pNotify->IOnSetScrollInfoX(rcPlate.left, rcPlate.right, rcContent.left, |
| 1824 rcContent.right, rcPlate.Width() / 3, | 1820 rcContent.right, rcPlate.Width() / 3, |
| 1825 rcPlate.Width()); | 1821 rcPlate.Width()); |
| 1826 | 1822 |
| 1827 m_pNotify->IOnSetScrollInfoY(rcPlate.bottom, rcPlate.top, | 1823 m_pNotify->IOnSetScrollInfoY(rcPlate.bottom, rcPlate.top, |
| 1828 rcContent.bottom, rcContent.top, | 1824 rcContent.bottom, rcContent.top, |
| 1829 rcPlate.Height() / 3, rcPlate.Height()); | 1825 rcPlate.Height() / 3, rcPlate.Height()); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1865 if (!m_bNotifyFlag) { | 1861 if (!m_bNotifyFlag) { |
| 1866 m_bNotifyFlag = TRUE; | 1862 m_bNotifyFlag = TRUE; |
| 1867 m_pNotify->IOnSetScrollPosY(fy); | 1863 m_pNotify->IOnSetScrollPosY(fy); |
| 1868 m_bNotifyFlag = FALSE; | 1864 m_bNotifyFlag = FALSE; |
| 1869 } | 1865 } |
| 1870 } | 1866 } |
| 1871 } | 1867 } |
| 1872 } | 1868 } |
| 1873 } | 1869 } |
| 1874 | 1870 |
| 1875 void CFX_Edit::SetScrollPos(const CFX_FloatPoint& point) { | 1871 void CFX_Edit::SetScrollPos(const CPDF_Point& point) { |
| 1876 SetScrollPosX(point.x); | 1872 SetScrollPosX(point.x); |
| 1877 SetScrollPosY(point.y); | 1873 SetScrollPosY(point.y); |
| 1878 SetScrollLimit(); | 1874 SetScrollLimit(); |
| 1879 SetCaretInfo(); | 1875 SetCaretInfo(); |
| 1880 } | 1876 } |
| 1881 | 1877 |
| 1882 CFX_FloatPoint CFX_Edit::GetScrollPos() const { | 1878 CPDF_Point CFX_Edit::GetScrollPos() const { |
| 1883 return m_ptScrollPos; | 1879 return m_ptScrollPos; |
| 1884 } | 1880 } |
| 1885 | 1881 |
| 1886 void CFX_Edit::SetScrollLimit() { | 1882 void CFX_Edit::SetScrollLimit() { |
| 1887 if (m_pVT->IsValid()) { | 1883 if (m_pVT->IsValid()) { |
| 1888 CFX_FloatRect rcContent = m_pVT->GetContentRect(); | 1884 CPDF_Rect rcContent = m_pVT->GetContentRect(); |
| 1889 CFX_FloatRect rcPlate = m_pVT->GetPlateRect(); | 1885 CPDF_Rect rcPlate = m_pVT->GetPlateRect(); |
| 1890 | 1886 |
| 1891 if (rcPlate.Width() > rcContent.Width()) { | 1887 if (rcPlate.Width() > rcContent.Width()) { |
| 1892 SetScrollPosX(rcPlate.left); | 1888 SetScrollPosX(rcPlate.left); |
| 1893 } else { | 1889 } else { |
| 1894 if (FX_EDIT_IsFloatSmaller(m_ptScrollPos.x, rcContent.left)) { | 1890 if (FX_EDIT_IsFloatSmaller(m_ptScrollPos.x, rcContent.left)) { |
| 1895 SetScrollPosX(rcContent.left); | 1891 SetScrollPosX(rcContent.left); |
| 1896 } else if (FX_EDIT_IsFloatBigger(m_ptScrollPos.x, | 1892 } else if (FX_EDIT_IsFloatBigger(m_ptScrollPos.x, |
| 1897 rcContent.right - rcPlate.Width())) { | 1893 rcContent.right - rcPlate.Width())) { |
| 1898 SetScrollPosX(rcContent.right - rcPlate.Width()); | 1894 SetScrollPosX(rcContent.right - rcPlate.Width()); |
| 1899 } | 1895 } |
| 1900 } | 1896 } |
| 1901 | 1897 |
| 1902 if (rcPlate.Height() > rcContent.Height()) { | 1898 if (rcPlate.Height() > rcContent.Height()) { |
| 1903 SetScrollPosY(rcPlate.top); | 1899 SetScrollPosY(rcPlate.top); |
| 1904 } else { | 1900 } else { |
| 1905 if (FX_EDIT_IsFloatSmaller(m_ptScrollPos.y, | 1901 if (FX_EDIT_IsFloatSmaller(m_ptScrollPos.y, |
| 1906 rcContent.bottom + rcPlate.Height())) { | 1902 rcContent.bottom + rcPlate.Height())) { |
| 1907 SetScrollPosY(rcContent.bottom + rcPlate.Height()); | 1903 SetScrollPosY(rcContent.bottom + rcPlate.Height()); |
| 1908 } else if (FX_EDIT_IsFloatBigger(m_ptScrollPos.y, rcContent.top)) { | 1904 } else if (FX_EDIT_IsFloatBigger(m_ptScrollPos.y, rcContent.top)) { |
| 1909 SetScrollPosY(rcContent.top); | 1905 SetScrollPosY(rcContent.top); |
| 1910 } | 1906 } |
| 1911 } | 1907 } |
| 1912 } | 1908 } |
| 1913 } | 1909 } |
| 1914 | 1910 |
| 1915 void CFX_Edit::ScrollToCaret() { | 1911 void CFX_Edit::ScrollToCaret() { |
| 1916 SetScrollLimit(); | 1912 SetScrollLimit(); |
| 1917 | 1913 |
| 1918 if (m_pVT->IsValid()) { | 1914 if (m_pVT->IsValid()) { |
| 1919 CFX_FloatPoint ptHead(0, 0); | 1915 CPDF_Point ptHead(0, 0); |
| 1920 CFX_FloatPoint ptFoot(0, 0); | 1916 CPDF_Point ptFoot(0, 0); |
| 1921 | 1917 |
| 1922 if (IPDF_VariableText_Iterator* pIterator = m_pVT->GetIterator()) { | 1918 if (IPDF_VariableText_Iterator* pIterator = m_pVT->GetIterator()) { |
| 1923 pIterator->SetAt(m_wpCaret); | 1919 pIterator->SetAt(m_wpCaret); |
| 1924 | 1920 |
| 1925 CPVT_Word word; | 1921 CPVT_Word word; |
| 1926 CPVT_Line line; | 1922 CPVT_Line line; |
| 1927 if (pIterator->GetWord(word)) { | 1923 if (pIterator->GetWord(word)) { |
| 1928 ptHead.x = word.ptWord.x + word.fWidth; | 1924 ptHead.x = word.ptWord.x + word.fWidth; |
| 1929 ptHead.y = word.ptWord.y + word.fAscent; | 1925 ptHead.y = word.ptWord.y + word.fAscent; |
| 1930 ptFoot.x = word.ptWord.x + word.fWidth; | 1926 ptFoot.x = word.ptWord.x + word.fWidth; |
| 1931 ptFoot.y = word.ptWord.y + word.fDescent; | 1927 ptFoot.y = word.ptWord.y + word.fDescent; |
| 1932 } else if (pIterator->GetLine(line)) { | 1928 } else if (pIterator->GetLine(line)) { |
| 1933 ptHead.x = line.ptLine.x; | 1929 ptHead.x = line.ptLine.x; |
| 1934 ptHead.y = line.ptLine.y + line.fLineAscent; | 1930 ptHead.y = line.ptLine.y + line.fLineAscent; |
| 1935 ptFoot.x = line.ptLine.x; | 1931 ptFoot.x = line.ptLine.x; |
| 1936 ptFoot.y = line.ptLine.y + line.fLineDescent; | 1932 ptFoot.y = line.ptLine.y + line.fLineDescent; |
| 1937 } | 1933 } |
| 1938 } | 1934 } |
| 1939 | 1935 |
| 1940 CFX_FloatPoint ptHeadEdit = VTToEdit(ptHead); | 1936 CPDF_Point ptHeadEdit = VTToEdit(ptHead); |
| 1941 CFX_FloatPoint ptFootEdit = VTToEdit(ptFoot); | 1937 CPDF_Point ptFootEdit = VTToEdit(ptFoot); |
| 1942 | 1938 |
| 1943 CFX_FloatRect rcPlate = m_pVT->GetPlateRect(); | 1939 CPDF_Rect rcPlate = m_pVT->GetPlateRect(); |
| 1944 | 1940 |
| 1945 if (!FX_EDIT_IsFloatEqual(rcPlate.left, rcPlate.right)) { | 1941 if (!FX_EDIT_IsFloatEqual(rcPlate.left, rcPlate.right)) { |
| 1946 if (FX_EDIT_IsFloatSmaller(ptHeadEdit.x, rcPlate.left) || | 1942 if (FX_EDIT_IsFloatSmaller(ptHeadEdit.x, rcPlate.left) || |
| 1947 FX_EDIT_IsFloatEqual(ptHeadEdit.x, rcPlate.left)) { | 1943 FX_EDIT_IsFloatEqual(ptHeadEdit.x, rcPlate.left)) { |
| 1948 SetScrollPosX(ptHead.x); | 1944 SetScrollPosX(ptHead.x); |
| 1949 } else if (FX_EDIT_IsFloatBigger(ptHeadEdit.x, rcPlate.right)) { | 1945 } else if (FX_EDIT_IsFloatBigger(ptHeadEdit.x, rcPlate.right)) { |
| 1950 SetScrollPosX(ptHead.x - rcPlate.Width()); | 1946 SetScrollPosX(ptHead.x - rcPlate.Width()); |
| 1951 } | 1947 } |
| 1952 } | 1948 } |
| 1953 | 1949 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2000 m_pVT->UpdateWordPlace(wpEnd); | 1996 m_pVT->UpdateWordPlace(wpEnd); |
| 2001 pIterator->SetAt(wpBegin); | 1997 pIterator->SetAt(wpBegin); |
| 2002 | 1998 |
| 2003 CPVT_Line lineinfo; | 1999 CPVT_Line lineinfo; |
| 2004 do { | 2000 do { |
| 2005 if (!pIterator->GetLine(lineinfo)) | 2001 if (!pIterator->GetLine(lineinfo)) |
| 2006 break; | 2002 break; |
| 2007 if (lineinfo.lineplace.LineCmp(wpEnd) > 0) | 2003 if (lineinfo.lineplace.LineCmp(wpEnd) > 0) |
| 2008 break; | 2004 break; |
| 2009 | 2005 |
| 2010 CFX_FloatRect rcLine(lineinfo.ptLine.x, | 2006 CPDF_Rect rcLine(lineinfo.ptLine.x, |
| 2011 lineinfo.ptLine.y + lineinfo.fLineDescent, | 2007 lineinfo.ptLine.y + lineinfo.fLineDescent, |
| 2012 lineinfo.ptLine.x + lineinfo.fLineWidth, | 2008 lineinfo.ptLine.x + lineinfo.fLineWidth, |
| 2013 lineinfo.ptLine.y + lineinfo.fLineAscent); | 2009 lineinfo.ptLine.y + lineinfo.fLineAscent); |
| 2014 | 2010 |
| 2015 m_Refresh.Push(CPVT_WordRange(lineinfo.lineplace, lineinfo.lineEnd), | 2011 m_Refresh.Push(CPVT_WordRange(lineinfo.lineplace, lineinfo.lineEnd), |
| 2016 VTToEdit(rcLine)); | 2012 VTToEdit(rcLine)); |
| 2017 } while (pIterator->NextLine()); | 2013 } while (pIterator->NextLine()); |
| 2018 } | 2014 } |
| 2019 } | 2015 } |
| 2020 } | 2016 } |
| 2021 | 2017 |
| 2022 void CFX_Edit::RefreshPushRandomRects(const CPVT_WordRange& wr) { | 2018 void CFX_Edit::RefreshPushRandomRects(const CPVT_WordRange& wr) { |
| 2023 if (m_pVT->IsValid()) { | 2019 if (m_pVT->IsValid()) { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 2035 while (pIterator->NextWord()) { | 2031 while (pIterator->NextWord()) { |
| 2036 place = pIterator->GetAt(); | 2032 place = pIterator->GetAt(); |
| 2037 if (place.WordCmp(wrTemp.EndPos) > 0) | 2033 if (place.WordCmp(wrTemp.EndPos) > 0) |
| 2038 break; | 2034 break; |
| 2039 | 2035 |
| 2040 pIterator->GetWord(wordinfo); | 2036 pIterator->GetWord(wordinfo); |
| 2041 pIterator->GetLine(lineinfo); | 2037 pIterator->GetLine(lineinfo); |
| 2042 | 2038 |
| 2043 if (place.LineCmp(wrTemp.BeginPos) == 0 || | 2039 if (place.LineCmp(wrTemp.BeginPos) == 0 || |
| 2044 place.LineCmp(wrTemp.EndPos) == 0) { | 2040 place.LineCmp(wrTemp.EndPos) == 0) { |
| 2045 CFX_FloatRect rcWord(wordinfo.ptWord.x, | 2041 CPDF_Rect rcWord(wordinfo.ptWord.x, |
| 2046 lineinfo.ptLine.y + lineinfo.fLineDescent, | 2042 lineinfo.ptLine.y + lineinfo.fLineDescent, |
| 2047 wordinfo.ptWord.x + wordinfo.fWidth, | 2043 wordinfo.ptWord.x + wordinfo.fWidth, |
| 2048 lineinfo.ptLine.y + lineinfo.fLineAscent); | 2044 lineinfo.ptLine.y + lineinfo.fLineAscent); |
| 2049 | 2045 |
| 2050 m_Refresh.AddRefresh(VTToEdit(rcWord)); | 2046 m_Refresh.AddRefresh(VTToEdit(rcWord)); |
| 2051 } else { | 2047 } else { |
| 2052 CFX_FloatRect rcLine(lineinfo.ptLine.x, | 2048 CPDF_Rect rcLine(lineinfo.ptLine.x, |
| 2053 lineinfo.ptLine.y + lineinfo.fLineDescent, | 2049 lineinfo.ptLine.y + lineinfo.fLineDescent, |
| 2054 lineinfo.ptLine.x + lineinfo.fLineWidth, | 2050 lineinfo.ptLine.x + lineinfo.fLineWidth, |
| 2055 lineinfo.ptLine.y + lineinfo.fLineAscent); | 2051 lineinfo.ptLine.y + lineinfo.fLineAscent); |
| 2056 | 2052 |
| 2057 m_Refresh.AddRefresh(VTToEdit(rcLine)); | 2053 m_Refresh.AddRefresh(VTToEdit(rcLine)); |
| 2058 | 2054 |
| 2059 pIterator->NextLine(); | 2055 pIterator->NextLine(); |
| 2060 } | 2056 } |
| 2061 } | 2057 } |
| 2062 } | 2058 } |
| 2063 } | 2059 } |
| 2064 } | 2060 } |
| 2065 | 2061 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 2078 while (pIterator->NextWord()) { | 2074 while (pIterator->NextWord()) { |
| 2079 place = pIterator->GetAt(); | 2075 place = pIterator->GetAt(); |
| 2080 if (place.WordCmp(wrTemp.EndPos) > 0) | 2076 if (place.WordCmp(wrTemp.EndPos) > 0) |
| 2081 break; | 2077 break; |
| 2082 | 2078 |
| 2083 pIterator->GetWord(wordinfo); | 2079 pIterator->GetWord(wordinfo); |
| 2084 pIterator->GetLine(lineinfo); | 2080 pIterator->GetLine(lineinfo); |
| 2085 | 2081 |
| 2086 if (place.LineCmp(wrTemp.BeginPos) == 0 || | 2082 if (place.LineCmp(wrTemp.BeginPos) == 0 || |
| 2087 place.LineCmp(wrTemp.EndPos) == 0) { | 2083 place.LineCmp(wrTemp.EndPos) == 0) { |
| 2088 CFX_FloatRect rcWord(wordinfo.ptWord.x, | 2084 CPDF_Rect rcWord(wordinfo.ptWord.x, |
| 2089 lineinfo.ptLine.y + lineinfo.fLineDescent, | 2085 lineinfo.ptLine.y + lineinfo.fLineDescent, |
| 2090 wordinfo.ptWord.x + wordinfo.fWidth, | 2086 wordinfo.ptWord.x + wordinfo.fWidth, |
| 2091 lineinfo.ptLine.y + lineinfo.fLineAscent); | 2087 lineinfo.ptLine.y + lineinfo.fLineAscent); |
| 2092 | 2088 |
| 2093 if (m_bNotify && m_pNotify) { | 2089 if (m_bNotify && m_pNotify) { |
| 2094 if (!m_bNotifyFlag) { | 2090 if (!m_bNotifyFlag) { |
| 2095 m_bNotifyFlag = TRUE; | 2091 m_bNotifyFlag = TRUE; |
| 2096 CFX_FloatRect rcRefresh = VTToEdit(rcWord); | 2092 CPDF_Rect rcRefresh = VTToEdit(rcWord); |
| 2097 m_pNotify->IOnInvalidateRect(&rcRefresh); | 2093 m_pNotify->IOnInvalidateRect(&rcRefresh); |
| 2098 m_bNotifyFlag = FALSE; | 2094 m_bNotifyFlag = FALSE; |
| 2099 } | 2095 } |
| 2100 } | 2096 } |
| 2101 } else { | 2097 } else { |
| 2102 CFX_FloatRect rcLine(lineinfo.ptLine.x, | 2098 CPDF_Rect rcLine(lineinfo.ptLine.x, |
| 2103 lineinfo.ptLine.y + lineinfo.fLineDescent, | 2099 lineinfo.ptLine.y + lineinfo.fLineDescent, |
| 2104 lineinfo.ptLine.x + lineinfo.fLineWidth, | 2100 lineinfo.ptLine.x + lineinfo.fLineWidth, |
| 2105 lineinfo.ptLine.y + lineinfo.fLineAscent); | 2101 lineinfo.ptLine.y + lineinfo.fLineAscent); |
| 2106 | 2102 |
| 2107 if (m_bNotify && m_pNotify) { | 2103 if (m_bNotify && m_pNotify) { |
| 2108 if (!m_bNotifyFlag) { | 2104 if (!m_bNotifyFlag) { |
| 2109 m_bNotifyFlag = TRUE; | 2105 m_bNotifyFlag = TRUE; |
| 2110 CFX_FloatRect rcRefresh = VTToEdit(rcLine); | 2106 CPDF_Rect rcRefresh = VTToEdit(rcLine); |
| 2111 m_pNotify->IOnInvalidateRect(&rcRefresh); | 2107 m_pNotify->IOnInvalidateRect(&rcRefresh); |
| 2112 m_bNotifyFlag = FALSE; | 2108 m_bNotifyFlag = FALSE; |
| 2113 } | 2109 } |
| 2114 } | 2110 } |
| 2115 | 2111 |
| 2116 pIterator->NextLine(); | 2112 pIterator->NextLine(); |
| 2117 } | 2113 } |
| 2118 } | 2114 } |
| 2119 } | 2115 } |
| 2120 } | 2116 } |
| 2121 | 2117 |
| 2122 void CFX_Edit::SetCaret(const CPVT_WordPlace& place) { | 2118 void CFX_Edit::SetCaret(const CPVT_WordPlace& place) { |
| 2123 m_wpOldCaret = m_wpCaret; | 2119 m_wpOldCaret = m_wpCaret; |
| 2124 m_wpCaret = place; | 2120 m_wpCaret = place; |
| 2125 } | 2121 } |
| 2126 | 2122 |
| 2127 void CFX_Edit::SetCaretInfo() { | 2123 void CFX_Edit::SetCaretInfo() { |
| 2128 if (m_bNotify && m_pNotify) { | 2124 if (m_bNotify && m_pNotify) { |
| 2129 if (!m_bNotifyFlag) { | 2125 if (!m_bNotifyFlag) { |
| 2130 CFX_FloatPoint ptHead(0.0f, 0.0f), ptFoot(0.0f, 0.0f); | 2126 CPDF_Point ptHead(0.0f, 0.0f), ptFoot(0.0f, 0.0f); |
| 2131 | 2127 |
| 2132 if (IPDF_VariableText_Iterator* pIterator = m_pVT->GetIterator()) { | 2128 if (IPDF_VariableText_Iterator* pIterator = m_pVT->GetIterator()) { |
| 2133 pIterator->SetAt(m_wpCaret); | 2129 pIterator->SetAt(m_wpCaret); |
| 2134 CPVT_Word word; | 2130 CPVT_Word word; |
| 2135 CPVT_Line line; | 2131 CPVT_Line line; |
| 2136 if (pIterator->GetWord(word)) { | 2132 if (pIterator->GetWord(word)) { |
| 2137 ptHead.x = word.ptWord.x + word.fWidth; | 2133 ptHead.x = word.ptWord.x + word.fWidth; |
| 2138 ptHead.y = word.ptWord.y + word.fAscent; | 2134 ptHead.y = word.ptWord.y + word.fAscent; |
| 2139 ptFoot.x = word.ptWord.x + word.fWidth; | 2135 ptFoot.x = word.ptWord.x + word.fWidth; |
| 2140 ptFoot.y = word.ptWord.y + word.fDescent; | 2136 ptFoot.y = word.ptWord.y + word.fDescent; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2192 SelectNone(); | 2188 SelectNone(); |
| 2193 SetCaret(m_pVT->WordIndexToWordPlace(nPos)); | 2189 SetCaret(m_pVT->WordIndexToWordPlace(nPos)); |
| 2194 m_SelState.Set(m_wpCaret, m_wpCaret); | 2190 m_SelState.Set(m_wpCaret, m_wpCaret); |
| 2195 | 2191 |
| 2196 ScrollToCaret(); | 2192 ScrollToCaret(); |
| 2197 SetCaretOrigin(); | 2193 SetCaretOrigin(); |
| 2198 SetCaretInfo(); | 2194 SetCaretInfo(); |
| 2199 } | 2195 } |
| 2200 } | 2196 } |
| 2201 | 2197 |
| 2202 void CFX_Edit::OnMouseDown(const CFX_FloatPoint& point, | 2198 void CFX_Edit::OnMouseDown(const CPDF_Point& point, |
| 2203 FX_BOOL bShift, | 2199 FX_BOOL bShift, |
| 2204 FX_BOOL bCtrl) { | 2200 FX_BOOL bCtrl) { |
| 2205 if (m_pVT->IsValid()) { | 2201 if (m_pVT->IsValid()) { |
| 2206 SelectNone(); | 2202 SelectNone(); |
| 2207 SetCaret(m_pVT->SearchWordPlace(EditToVT(point))); | 2203 SetCaret(m_pVT->SearchWordPlace(EditToVT(point))); |
| 2208 m_SelState.Set(m_wpCaret, m_wpCaret); | 2204 m_SelState.Set(m_wpCaret, m_wpCaret); |
| 2209 | 2205 |
| 2210 ScrollToCaret(); | 2206 ScrollToCaret(); |
| 2211 SetCaretOrigin(); | 2207 SetCaretOrigin(); |
| 2212 SetCaretInfo(); | 2208 SetCaretInfo(); |
| 2213 } | 2209 } |
| 2214 } | 2210 } |
| 2215 | 2211 |
| 2216 void CFX_Edit::OnMouseMove(const CFX_FloatPoint& point, | 2212 void CFX_Edit::OnMouseMove(const CPDF_Point& point, |
| 2217 FX_BOOL bShift, | 2213 FX_BOOL bShift, |
| 2218 FX_BOOL bCtrl) { | 2214 FX_BOOL bCtrl) { |
| 2219 if (m_pVT->IsValid()) { | 2215 if (m_pVT->IsValid()) { |
| 2220 SetCaret(m_pVT->SearchWordPlace(EditToVT(point))); | 2216 SetCaret(m_pVT->SearchWordPlace(EditToVT(point))); |
| 2221 | 2217 |
| 2222 if (m_wpCaret != m_wpOldCaret) { | 2218 if (m_wpCaret != m_wpOldCaret) { |
| 2223 m_SelState.SetEndPos(m_wpCaret); | 2219 m_SelState.SetEndPos(m_wpCaret); |
| 2224 | 2220 |
| 2225 ScrollToCaret(); | 2221 ScrollToCaret(); |
| 2226 CPVT_WordRange wr(m_wpOldCaret, m_wpCaret); | 2222 CPVT_WordRange wr(m_wpOldCaret, m_wpCaret); |
| (...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2850 int32_t nTotalWords = m_pVT->GetTotalWords(); | 2846 int32_t nTotalWords = m_pVT->GetTotalWords(); |
| 2851 int32_t nLimitChar = m_pVT->GetLimitChar(); | 2847 int32_t nLimitChar = m_pVT->GetLimitChar(); |
| 2852 int32_t nCharArray = m_pVT->GetCharArray(); | 2848 int32_t nCharArray = m_pVT->GetCharArray(); |
| 2853 | 2849 |
| 2854 return IsTextOverflow() || (nLimitChar > 0 && nTotalWords >= nLimitChar) || | 2850 return IsTextOverflow() || (nLimitChar > 0 && nTotalWords >= nLimitChar) || |
| 2855 (nCharArray > 0 && nTotalWords >= nCharArray); | 2851 (nCharArray > 0 && nTotalWords >= nCharArray); |
| 2856 } | 2852 } |
| 2857 | 2853 |
| 2858 FX_BOOL CFX_Edit::IsTextOverflow() const { | 2854 FX_BOOL CFX_Edit::IsTextOverflow() const { |
| 2859 if (!m_bEnableScroll && !m_bEnableOverflow) { | 2855 if (!m_bEnableScroll && !m_bEnableOverflow) { |
| 2860 CFX_FloatRect rcPlate = m_pVT->GetPlateRect(); | 2856 CPDF_Rect rcPlate = m_pVT->GetPlateRect(); |
| 2861 CFX_FloatRect rcContent = m_pVT->GetContentRect(); | 2857 CPDF_Rect rcContent = m_pVT->GetContentRect(); |
| 2862 | 2858 |
| 2863 if (m_pVT->IsMultiLine() && GetTotalLines() > 1) { | 2859 if (m_pVT->IsMultiLine() && GetTotalLines() > 1) { |
| 2864 if (FX_EDIT_IsFloatBigger(rcContent.Height(), rcPlate.Height())) | 2860 if (FX_EDIT_IsFloatBigger(rcContent.Height(), rcPlate.Height())) |
| 2865 return TRUE; | 2861 return TRUE; |
| 2866 } | 2862 } |
| 2867 | 2863 |
| 2868 if (FX_EDIT_IsFloatBigger(rcContent.Width(), rcPlate.Width())) | 2864 if (FX_EDIT_IsFloatBigger(rcContent.Width(), rcPlate.Width())) |
| 2869 return TRUE; | 2865 return TRUE; |
| 2870 } | 2866 } |
| 2871 | 2867 |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3025 if (m_bOprNotify && m_pOprNotify) | 3021 if (m_bOprNotify && m_pOprNotify) |
| 3026 m_pOprNotify->OnAddUndo(pEditUndoItem); | 3022 m_pOprNotify->OnAddUndo(pEditUndoItem); |
| 3027 } | 3023 } |
| 3028 } | 3024 } |
| 3029 | 3025 |
| 3030 void CFX_Edit::AddUndoItem(IFX_Edit_UndoItem* pUndoItem) { | 3026 void CFX_Edit::AddUndoItem(IFX_Edit_UndoItem* pUndoItem) { |
| 3031 m_Undo.AddItem(pUndoItem); | 3027 m_Undo.AddItem(pUndoItem); |
| 3032 if (m_bOprNotify && m_pOprNotify) | 3028 if (m_bOprNotify && m_pOprNotify) |
| 3033 m_pOprNotify->OnAddUndo(pUndoItem); | 3029 m_pOprNotify->OnAddUndo(pUndoItem); |
| 3034 } | 3030 } |
| OLD | NEW |