Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: xfa/fee/fde_txtedtengine.cpp

Issue 1882213002: Cleanup various IFX_ text interfaces. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « xfa/fee/fde_txtedtengine.h ('k') | xfa/fee/fde_txtedtpage.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/fee/fde_txtedtengine.h" 7 #include "xfa/fee/fde_txtedtengine.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 } 56 }
57 RemoveAllParags(); 57 RemoveAllParags();
58 RemoveAllPages(); 58 RemoveAllPages();
59 m_Param.pEventSink = NULL; 59 m_Param.pEventSink = NULL;
60 ClearSelection(); 60 ClearSelection();
61 } 61 }
62 void CFDE_TxtEdtEngine::Release() { 62 void CFDE_TxtEdtEngine::Release() {
63 delete this; 63 delete this;
64 } 64 }
65 void CFDE_TxtEdtEngine::SetEditParams(const FDE_TXTEDTPARAMS& params) { 65 void CFDE_TxtEdtEngine::SetEditParams(const FDE_TXTEDTPARAMS& params) {
66 if (m_pTextBreak == NULL) { 66 if (!m_pTextBreak)
67 m_pTextBreak = IFX_TxtBreak::Create(FX_TXTBREAKPOLICY_None); 67 m_pTextBreak = new CFX_TxtBreak(FX_TXTBREAKPOLICY_None);
68 } 68
69 FXSYS_memcpy(&m_Param, &params, sizeof(FDE_TXTEDTPARAMS)); 69 FXSYS_memcpy(&m_Param, &params, sizeof(FDE_TXTEDTPARAMS));
70 m_wLineEnd = params.wLineBreakChar; 70 m_wLineEnd = params.wLineBreakChar;
71 m_bAutoLineEnd = (m_Param.nLineEnd == FDE_TXTEDIT_LINEEND_Auto); 71 m_bAutoLineEnd = (m_Param.nLineEnd == FDE_TXTEDIT_LINEEND_Auto);
72 UpdateTxtBreak(); 72 UpdateTxtBreak();
73 } 73 }
74 const FDE_TXTEDTPARAMS* CFDE_TxtEdtEngine::GetEditParams() const { 74 const FDE_TXTEDTPARAMS* CFDE_TxtEdtEngine::GetEditParams() const {
75 return &m_Param; 75 return &m_Param;
76 } 76 }
77 int32_t CFDE_TxtEdtEngine::CountPages() const { 77 int32_t CFDE_TxtEdtEngine::CountPages() const {
78 if (m_nLineCount == 0) { 78 if (m_nLineCount == 0) {
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 } 714 }
715 FX_BOOL CFDE_TxtEdtEngine::Optimize(IFX_Pause* pPause) { 715 FX_BOOL CFDE_TxtEdtEngine::Optimize(IFX_Pause* pPause) {
716 return m_pTxtBuf->Optimize(pPause); 716 return m_pTxtBuf->Optimize(pPause);
717 } 717 }
718 IFDE_TxtEdtBuf* CFDE_TxtEdtEngine::GetTextBuf() const { 718 IFDE_TxtEdtBuf* CFDE_TxtEdtEngine::GetTextBuf() const {
719 return (IFDE_TxtEdtBuf*)m_pTxtBuf; 719 return (IFDE_TxtEdtBuf*)m_pTxtBuf;
720 } 720 }
721 int32_t CFDE_TxtEdtEngine::GetTextBufLength() const { 721 int32_t CFDE_TxtEdtEngine::GetTextBufLength() const {
722 return m_pTxtBuf->GetTextLength() - 1; 722 return m_pTxtBuf->GetTextLength() - 1;
723 } 723 }
724 IFX_TxtBreak* CFDE_TxtEdtEngine::GetTextBreak() const { 724 CFX_TxtBreak* CFDE_TxtEdtEngine::GetTextBreak() const {
725 return m_pTextBreak; 725 return m_pTextBreak;
726 } 726 }
727 int32_t CFDE_TxtEdtEngine::GetLineCount() const { 727 int32_t CFDE_TxtEdtEngine::GetLineCount() const {
728 return m_nLineCount; 728 return m_nLineCount;
729 } 729 }
730 int32_t CFDE_TxtEdtEngine::GetPageLineCount() const { 730 int32_t CFDE_TxtEdtEngine::GetPageLineCount() const {
731 return m_nPageLineCount; 731 return m_nPageLineCount;
732 } 732 }
733 int32_t CFDE_TxtEdtEngine::CountParags() const { 733 int32_t CFDE_TxtEdtEngine::CountParags() const {
734 return m_ParagPtrArray.GetSize(); 734 return m_ParagPtrArray.GetSize();
(...skipping 1041 matching lines...) Expand 10 before | Expand all | Expand 10 after
1776 int32_t nEngine = 0; 1776 int32_t nEngine = 0;
1777 ArchiveLoader >> nEngine; 1777 ArchiveLoader >> nEngine;
1778 m_pEngine = (CFDE_TxtEdtEngine*)(uintptr_t)nEngine; 1778 m_pEngine = (CFDE_TxtEdtEngine*)(uintptr_t)nEngine;
1779 int32_t iSel = 0; 1779 int32_t iSel = 0;
1780 ArchiveLoader >> iSel; 1780 ArchiveLoader >> iSel;
1781 m_bSel = !!iSel; 1781 m_bSel = !!iSel;
1782 ArchiveLoader >> m_nIndex; 1782 ArchiveLoader >> m_nIndex;
1783 ArchiveLoader >> m_nCaret; 1783 ArchiveLoader >> m_nCaret;
1784 ArchiveLoader >> m_wsRange; 1784 ArchiveLoader >> m_wsRange;
1785 } 1785 }
OLDNEW
« no previous file with comments | « xfa/fee/fde_txtedtengine.h ('k') | xfa/fee/fde_txtedtpage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698