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/fxfa/app/xfa_textlayout.h" | 7 #include "xfa/fxfa/app/xfa_textlayout.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
645 FX_FLOAT fPos = ms.ToUnit(XFA_UNIT_Pt); | 645 FX_FLOAT fPos = ms.ToUnit(XFA_UNIT_Pt); |
646 pTabstopContext->Append(dwHashCode, fPos); | 646 pTabstopContext->Append(dwHashCode, fPos); |
647 } | 647 } |
648 return TRUE; | 648 return TRUE; |
649 } | 649 } |
650 CXFA_TextLayout::CXFA_TextLayout(CXFA_TextProvider* pTextProvider) | 650 CXFA_TextLayout::CXFA_TextLayout(CXFA_TextProvider* pTextProvider) |
651 : m_bHasBlock(FALSE), | 651 : m_bHasBlock(FALSE), |
652 m_pTextProvider(pTextProvider), | 652 m_pTextProvider(pTextProvider), |
653 m_pTextDataNode(nullptr), | 653 m_pTextDataNode(nullptr), |
654 m_bRichText(FALSE), | 654 m_bRichText(FALSE), |
655 m_pAllocator(nullptr), | |
656 m_pBreak(nullptr), | |
657 m_pLoader(nullptr), | |
658 m_iLines(0), | 655 m_iLines(0), |
659 m_fMaxWidth(0), | 656 m_fMaxWidth(0), |
660 m_pTabstopContext(nullptr), | |
661 m_bBlockContinue(TRUE) { | 657 m_bBlockContinue(TRUE) { |
662 ASSERT(m_pTextProvider); | 658 ASSERT(m_pTextProvider); |
663 } | 659 } |
664 CXFA_TextLayout::~CXFA_TextLayout() { | 660 CXFA_TextLayout::~CXFA_TextLayout() { |
665 m_textParser.Reset(); | 661 m_textParser.Reset(); |
666 Unload(); | 662 Unload(); |
667 } | 663 } |
668 void CXFA_TextLayout::Unload() { | 664 void CXFA_TextLayout::Unload() { |
669 int32_t iCount = m_pieceLines.GetSize(); | 665 int32_t iCount = m_pieceLines.GetSize(); |
670 for (int32_t i = 0; i < iCount; i++) { | 666 for (int32_t i = 0; i < iCount; i++) { |
(...skipping 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1942 tr.iLength = iLength; | 1938 tr.iLength = iLength; |
1943 tr.fFontSize = pPiece->fFontSize; | 1939 tr.fFontSize = pPiece->fFontSize; |
1944 tr.iBidiLevel = pPiece->iBidiLevel; | 1940 tr.iBidiLevel = pPiece->iBidiLevel; |
1945 tr.iCharRotation = 0; | 1941 tr.iCharRotation = 0; |
1946 tr.wLineBreakChar = L'\n'; | 1942 tr.wLineBreakChar = L'\n'; |
1947 tr.iVerticalScale = pPiece->iVerScale; | 1943 tr.iVerticalScale = pPiece->iVerScale; |
1948 tr.dwLayoutStyles = FX_RTFLAYOUTSTYLE_ExpandTab; | 1944 tr.dwLayoutStyles = FX_RTFLAYOUTSTYLE_ExpandTab; |
1949 tr.iHorizontalScale = pPiece->iHorScale; | 1945 tr.iHorizontalScale = pPiece->iHorScale; |
1950 return TRUE; | 1946 return TRUE; |
1951 } | 1947 } |
OLD | NEW |