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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "xfa/src/foxitlib.h" | 9 #include "xfa/src/foxitlib.h" |
10 #include "xfa/src/fee/include/ifde_txtedtbuf.h" | 10 #include "xfa/src/fee/include/ifde_txtedtbuf.h" |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 CFX_RectFArray rcArr; | 344 CFX_RectFArray rcArr; |
345 m_pTextSet->GetCharRects((FDE_HVISUALOBJ)piece, rcArr); | 345 m_pTextSet->GetCharRects((FDE_HVISUALOBJ)piece, rcArr); |
346 CFX_RectF rectPiece = rcArr[0]; | 346 CFX_RectF rectPiece = rcArr[0]; |
347 rectPiece.Union(rcArr[nEnd - piece->nStart]); | 347 rectPiece.Union(rcArr[nEnd - piece->nStart]); |
348 RectFArr.Add(rectPiece); | 348 RectFArr.Add(rectPiece); |
349 return; | 349 return; |
350 } | 350 } |
351 RectFArr.Add(piece->rtPiece); | 351 RectFArr.Add(piece->rtPiece); |
352 } | 352 } |
353 } | 353 } |
354 return; | |
355 } | 354 } |
| 355 |
356 int32_t CFDE_TxtEdtPage::SelectWord(const CFX_PointF& fPoint, int32_t& nCount) { | 356 int32_t CFDE_TxtEdtPage::SelectWord(const CFX_PointF& fPoint, int32_t& nCount) { |
357 if (m_nRefCount < 0) { | 357 if (m_nRefCount < 0) { |
358 return -1; | 358 return -1; |
359 } | 359 } |
360 IFDE_TxtEdtBuf* pBuf = m_pEditEngine->GetTextBuf(); | 360 IFDE_TxtEdtBuf* pBuf = m_pEditEngine->GetTextBuf(); |
361 FX_BOOL bBefore; | 361 FX_BOOL bBefore; |
362 int32_t nIndex = GetCharIndex(fPoint, bBefore); | 362 int32_t nIndex = GetCharIndex(fPoint, bBefore); |
363 if (nIndex == m_pEditEngine->GetTextBufLength()) { | 363 if (nIndex == m_pEditEngine->GetTextBufLength()) { |
364 nIndex = m_pEditEngine->GetTextBufLength() - 1; | 364 nIndex = m_pEditEngine->GetTextBufLength() - 1; |
365 } | 365 } |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 if (m_pEndParag) { | 575 if (m_pEndParag) { |
576 m_pEndParag->UnloadParag(); | 576 m_pEndParag->UnloadParag(); |
577 } | 577 } |
578 if (m_pIter) { | 578 if (m_pIter) { |
579 m_pIter->Release(); | 579 m_pIter->Release(); |
580 m_pIter = NULL; | 580 m_pIter = NULL; |
581 } | 581 } |
582 m_pBgnParag = NULL; | 582 m_pBgnParag = NULL; |
583 m_pEndParag = NULL; | 583 m_pEndParag = NULL; |
584 } | 584 } |
585 return; | |
586 } | 585 } |
| 586 |
587 const CFX_RectF& CFDE_TxtEdtPage::GetContentsBox() { | 587 const CFX_RectF& CFDE_TxtEdtPage::GetContentsBox() { |
588 return m_rtPageContents; | 588 return m_rtPageContents; |
589 } | 589 } |
590 FX_POSITION CFDE_TxtEdtPage::GetFirstPosition(FDE_HVISUALOBJ hCanvas) { | 590 FX_POSITION CFDE_TxtEdtPage::GetFirstPosition(FDE_HVISUALOBJ hCanvas) { |
591 if (m_PieceMassArr.GetSize() < 1) { | 591 if (m_PieceMassArr.GetSize() < 1) { |
592 return NULL; | 592 return NULL; |
593 } | 593 } |
594 return (FX_POSITION)1; | 594 return (FX_POSITION)1; |
595 } | 595 } |
596 FDE_HVISUALOBJ CFDE_TxtEdtPage::GetNext(FDE_HVISUALOBJ hCanvas, | 596 FDE_HVISUALOBJ CFDE_TxtEdtPage::GetNext(FDE_HVISUALOBJ hCanvas, |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
638 ptF.x = rtF.left; | 638 ptF.x = rtF.left; |
639 } else if (ptF.x >= rtF.right()) { | 639 } else if (ptF.x >= rtF.right()) { |
640 ptF.x = rtF.right() - fTolerance; | 640 ptF.x = rtF.right() - fTolerance; |
641 } | 641 } |
642 if (ptF.y < rtF.top) { | 642 if (ptF.y < rtF.top) { |
643 ptF.y = rtF.top; | 643 ptF.y = rtF.top; |
644 } else if (ptF.y >= rtF.bottom()) { | 644 } else if (ptF.y >= rtF.bottom()) { |
645 ptF.y = rtF.bottom() - fTolerance; | 645 ptF.y = rtF.bottom() - fTolerance; |
646 } | 646 } |
647 } | 647 } |
OLD | NEW |