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

Side by Side Diff: xfa/fde/cfde_txtedtengine.cpp

Issue 2631703003: Avoid endless loop deleting CFGAS_GEFont. (Closed)
Patch Set: rebase Created 3 years, 11 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 | « core/fxcrt/cfx_retain_ptr.h ('k') | xfa/fgas/font/cfgas_gefont.h » ('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/fde/cfde_txtedtengine.h" 7 #include "xfa/fde/cfde_txtedtengine.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 RemoveAllParags(); 77 RemoveAllParags();
78 RemoveAllPages(); 78 RemoveAllPages();
79 m_Param.pEventSink = nullptr; 79 m_Param.pEventSink = nullptr;
80 ClearSelection(); 80 ClearSelection();
81 } 81 }
82 82
83 void CFDE_TxtEdtEngine::SetEditParams(const FDE_TXTEDTPARAMS& params) { 83 void CFDE_TxtEdtEngine::SetEditParams(const FDE_TXTEDTPARAMS& params) {
84 if (!m_pTextBreak) 84 if (!m_pTextBreak)
85 m_pTextBreak = pdfium::MakeUnique<CFX_TxtBreak>(FX_TXTBREAKPOLICY_None); 85 m_pTextBreak = pdfium::MakeUnique<CFX_TxtBreak>(FX_TXTBREAKPOLICY_None);
86 86
87 FXSYS_memcpy(&m_Param, &params, sizeof(FDE_TXTEDTPARAMS)); 87 m_Param = params;
88 m_wLineEnd = params.wLineBreakChar; 88 m_wLineEnd = params.wLineBreakChar;
89 m_bAutoLineEnd = (m_Param.nLineEnd == FDE_TXTEDIT_LINEEND_Auto); 89 m_bAutoLineEnd = (m_Param.nLineEnd == FDE_TXTEDIT_LINEEND_Auto);
90 UpdateTxtBreak(); 90 UpdateTxtBreak();
91 } 91 }
92 92
93 FDE_TXTEDTPARAMS* CFDE_TxtEdtEngine::GetEditParams() { 93 FDE_TXTEDTPARAMS* CFDE_TxtEdtEngine::GetEditParams() {
94 return &m_Param; 94 return &m_Param;
95 } 95 }
96 96
97 int32_t CFDE_TxtEdtEngine::CountPages() const { 97 int32_t CFDE_TxtEdtEngine::CountPages() const {
(...skipping 1375 matching lines...) Expand 10 before | Expand all | Expand 10 after
1473 m_SelRangePtrArr.RemoveAt(nCountRange); 1473 m_SelRangePtrArr.RemoveAt(nCountRange);
1474 DeleteRange_DoRecord(nSelStart, nSelCount, true); 1474 DeleteRange_DoRecord(nSelStart, nSelCount, true);
1475 } 1475 }
1476 ClearSelection(); 1476 ClearSelection();
1477 m_Param.pEventSink->OnTextChanged(m_ChangeInfo); 1477 m_Param.pEventSink->OnTextChanged(m_ChangeInfo);
1478 m_Param.pEventSink->OnSelChanged(); 1478 m_Param.pEventSink->OnSelChanged();
1479 SetCaretPos(nSelStart, true); 1479 SetCaretPos(nSelStart, true);
1480 return; 1480 return;
1481 } 1481 }
1482 } 1482 }
OLDNEW
« no previous file with comments | « core/fxcrt/cfx_retain_ptr.h ('k') | xfa/fgas/font/cfgas_gefont.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698