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/cfde_txtedtengine.h" | 7 #include "xfa/fde/cfde_txtedtengine.h" |
8 | 8 |
9 #include "xfa/fde/cfde_txtedtbuf.h" | 9 #include "xfa/fde/cfde_txtedtbuf.h" |
10 #include "xfa/fde/cfde_txtedtbufiter.h" | 10 #include "xfa/fde/cfde_txtedtbufiter.h" |
11 #include "xfa/fde/ifx_chariter.h" | 11 #include "xfa/fde/ifx_chariter.h" |
12 #include "xfa/fgas/layout/fgas_textbreak.h" | 12 #include "xfa/fgas/layout/fgas_textbreak.h" |
13 #include "xfa/fwl/basewidget/fwl_editimp.h" | 13 #include "xfa/fwl/basewidget/fwl_editimp.h" |
14 #include "xfa/fde/cfde_txtedtdorecord_deleterange.h" | 14 #include "xfa/fde/cfde_txtedtdorecord_deleterange.h" |
15 #include "xfa/fde/cfde_txtedtdorecord_insert.h" | 15 #include "xfa/fde/cfde_txtedtdorecord_insert.h" |
16 #include "xfa/fde/cfde_txtedtparag.h" | 16 #include "xfa/fde/cfde_txtedtparag.h" |
17 #include "xfa/fde/cfde_txtedtpage.h" | 17 #include "xfa/fde/cfde_txtedtpage.h" |
18 #include "xfa/fde/tto/fde_textout.h" | 18 #include "xfa/fde/tto/fde_textout.h" |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 const uint32_t kPageWidthMax = 0xffff; | 22 const uint32_t kPageWidthMax = 0xffff; |
23 const uint32_t kUnicodeParagraphSeparator = 0x2029; | 23 const uint32_t kUnicodeParagraphSeparator = 0x2029; |
24 | 24 |
25 } // namespace | 25 } // namespace |
26 | 26 |
| 27 FDE_TXTEDTPARAMS::FDE_TXTEDTPARAMS() |
| 28 : fPlateWidth(0), |
| 29 fPlateHeight(0), |
| 30 nLineCount(0), |
| 31 dwLayoutStyles(0), |
| 32 dwAlignment(0), |
| 33 dwMode(0), |
| 34 pFont(nullptr), |
| 35 fFontSize(10.0f), |
| 36 dwFontColor(0xff000000), |
| 37 fLineSpace(10.0f), |
| 38 fTabWidth(36), |
| 39 bTabEquidistant(FALSE), |
| 40 wDefChar(0xFEFF), |
| 41 wLineBreakChar('\n'), |
| 42 nCharRotation(0), |
| 43 nLineEnd(0), |
| 44 nHorzScale(100), |
| 45 fCharSpace(0), |
| 46 pEventSink(nullptr) {} |
| 47 |
| 48 FDE_TXTEDT_TEXTCHANGE_INFO::FDE_TXTEDT_TEXTCHANGE_INFO() {} |
| 49 |
| 50 FDE_TXTEDT_TEXTCHANGE_INFO::~FDE_TXTEDT_TEXTCHANGE_INFO() {} |
| 51 |
27 CFDE_TxtEdtEngine::CFDE_TxtEdtEngine() | 52 CFDE_TxtEdtEngine::CFDE_TxtEdtEngine() |
28 : m_pTextBreak(nullptr), | 53 : m_pTextBreak(nullptr), |
29 m_nPageLineCount(20), | 54 m_nPageLineCount(20), |
30 m_nLineCount(0), | 55 m_nLineCount(0), |
31 m_nAnchorPos(-1), | 56 m_nAnchorPos(-1), |
32 m_nLayoutPos(0), | 57 m_nLayoutPos(0), |
33 m_fCaretPosReserve(0.0), | 58 m_fCaretPosReserve(0.0), |
34 m_nCaret(0), | 59 m_nCaret(0), |
35 m_bBefore(TRUE), | 60 m_bBefore(TRUE), |
36 m_nCaretPage(0), | 61 m_nCaretPage(0), |
(...skipping 1565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1602 m_SelRangePtrArr.RemoveAt(nCountRange); | 1627 m_SelRangePtrArr.RemoveAt(nCountRange); |
1603 DeleteRange_DoRecord(nSelStart, nSelCount, TRUE); | 1628 DeleteRange_DoRecord(nSelStart, nSelCount, TRUE); |
1604 } | 1629 } |
1605 ClearSelection(); | 1630 ClearSelection(); |
1606 m_Param.pEventSink->On_TextChanged(this, m_ChangeInfo); | 1631 m_Param.pEventSink->On_TextChanged(this, m_ChangeInfo); |
1607 m_Param.pEventSink->On_SelChanged(this); | 1632 m_Param.pEventSink->On_SelChanged(this); |
1608 SetCaretPos(nSelStart, TRUE); | 1633 SetCaretPos(nSelStart, TRUE); |
1609 return; | 1634 return; |
1610 } | 1635 } |
1611 } | 1636 } |
OLD | NEW |