| 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/fwl/cfwl_edit.h" | 7 #include "xfa/fwl/cfwl_edit.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 681 CFWL_ThemePart part; | 681 CFWL_ThemePart part; |
| 682 part.m_pWidget = this; | 682 part.m_pWidget = this; |
| 683 m_fFontSize = theme ? theme->GetFontSize(&part) : FWLTHEME_CAPACITY_FontSize; | 683 m_fFontSize = theme ? theme->GetFontSize(&part) : FWLTHEME_CAPACITY_FontSize; |
| 684 | 684 |
| 685 if (!theme) | 685 if (!theme) |
| 686 return; | 686 return; |
| 687 | 687 |
| 688 params.dwFontColor = theme->GetTextColor(&part); | 688 params.dwFontColor = theme->GetTextColor(&part); |
| 689 params.fLineSpace = theme->GetLineHeight(&part); | 689 params.fLineSpace = theme->GetLineHeight(&part); |
| 690 | 690 |
| 691 CFGAS_GEFont* pFont = theme->GetFont(&part); | 691 CFX_RetainPtr<CFGAS_GEFont> pFont = theme->GetFont(&part); |
| 692 if (!pFont) | 692 if (!pFont) |
| 693 return; | 693 return; |
| 694 | 694 |
| 695 params.pFont = pFont; | 695 params.pFont = pFont; |
| 696 params.fFontSize = m_fFontSize; | 696 params.fFontSize = m_fFontSize; |
| 697 params.nLineCount = (int32_t)(params.fPlateHeight / params.fLineSpace); | 697 params.nLineCount = (int32_t)(params.fPlateHeight / params.fLineSpace); |
| 698 if (params.nLineCount <= 0) | 698 if (params.nLineCount <= 0) |
| 699 params.nLineCount = 1; | 699 params.nLineCount = 1; |
| 700 params.fTabWidth = params.fFontSize * 1; | 700 params.fTabWidth = params.fFontSize * 1; |
| 701 params.bTabEquidistant = true; | 701 params.bTabEquidistant = true; |
| (...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1563 pScrollBar->SetTrackPos(fPos); | 1563 pScrollBar->SetTrackPos(fPos); |
| 1564 UpdateOffset(pScrollBar, fPos - iCurPos); | 1564 UpdateOffset(pScrollBar, fPos - iCurPos); |
| 1565 UpdateCaret(); | 1565 UpdateCaret(); |
| 1566 | 1566 |
| 1567 CFX_RectF rect = GetWidgetRect(); | 1567 CFX_RectF rect = GetWidgetRect(); |
| 1568 CFX_RectF rtInvalidate; | 1568 CFX_RectF rtInvalidate; |
| 1569 rtInvalidate.Set(0, 0, rect.width + 2, rect.height + 2); | 1569 rtInvalidate.Set(0, 0, rect.width + 2, rect.height + 2); |
| 1570 RepaintRect(rtInvalidate); | 1570 RepaintRect(rtInvalidate); |
| 1571 return true; | 1571 return true; |
| 1572 } | 1572 } |
| OLD | NEW |