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 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 FX_FLOAT fOffSetX = m_rtEngine.left - m_fScrollOffsetX; | 531 FX_FLOAT fOffSetX = m_rtEngine.left - m_fScrollOffsetX; |
532 FX_FLOAT fOffSetY = m_rtEngine.top - m_fScrollOffsetY + m_fVAlignOffset; | 532 FX_FLOAT fOffSetY = m_rtEngine.top - m_fScrollOffsetY + m_fVAlignOffset; |
533 CFX_Matrix mt; | 533 CFX_Matrix mt; |
534 mt.Set(1, 0, 0, 1, fOffSetX, fOffSetY); | 534 mt.Set(1, 0, 0, 1, fOffSetX, fOffSetY); |
535 if (pMatrix) { | 535 if (pMatrix) { |
536 pMatrix->TransformRect(rtClip); | 536 pMatrix->TransformRect(rtClip); |
537 mt.Concat(*pMatrix); | 537 mt.Concat(*pMatrix); |
538 } | 538 } |
539 | 539 |
540 bool bShowSel = !!(m_pProperties->m_dwStates & FWL_WGTSTATE_Focused); | 540 bool bShowSel = !!(m_pProperties->m_dwStates & FWL_WGTSTATE_Focused); |
541 if (bShowSel) { | |
542 CFWL_Widget* pForm = m_pWidgetMgr->GetSystemFormWidget(this); | |
543 if (pForm) { | |
544 bShowSel = (pForm->GetStates() & FWL_WGTSTATE_Deactivated) != | |
545 FWL_WGTSTATE_Deactivated; | |
546 } | |
547 } | |
548 | |
549 int32_t nSelCount = m_EdtEngine.CountSelRanges(); | 541 int32_t nSelCount = m_EdtEngine.CountSelRanges(); |
550 if (bShowSel && nSelCount > 0) { | 542 if (bShowSel && nSelCount > 0) { |
551 int32_t nPageCharStart = pPage->GetCharStart(); | 543 int32_t nPageCharStart = pPage->GetCharStart(); |
552 int32_t nPageCharCount = pPage->GetCharCount(); | 544 int32_t nPageCharCount = pPage->GetCharCount(); |
553 int32_t nPageCharEnd = nPageCharStart + nPageCharCount - 1; | 545 int32_t nPageCharEnd = nPageCharStart + nPageCharCount - 1; |
554 int32_t nCharCount; | 546 int32_t nCharCount; |
555 int32_t nCharStart; | 547 int32_t nCharStart; |
556 CFX_RectFArray rectArr; | 548 CFX_RectFArray rectArr; |
557 int32_t i = 0; | 549 int32_t i = 0; |
558 for (i = 0; i < nSelCount; i++) { | 550 for (i = 0; i < nSelCount; i++) { |
(...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1596 pScrollBar->SetTrackPos(fPos); | 1588 pScrollBar->SetTrackPos(fPos); |
1597 UpdateOffset(pScrollBar, fPos - iCurPos); | 1589 UpdateOffset(pScrollBar, fPos - iCurPos); |
1598 UpdateCaret(); | 1590 UpdateCaret(); |
1599 | 1591 |
1600 CFX_RectF rect = GetWidgetRect(); | 1592 CFX_RectF rect = GetWidgetRect(); |
1601 CFX_RectF rtInvalidate; | 1593 CFX_RectF rtInvalidate; |
1602 rtInvalidate.Set(0, 0, rect.width + 2, rect.height + 2); | 1594 rtInvalidate.Set(0, 0, rect.width + 2, rect.height + 2); |
1603 RepaintRect(rtInvalidate); | 1595 RepaintRect(rtInvalidate); |
1604 return true; | 1596 return true; |
1605 } | 1597 } |
OLD | NEW |