summaryrefslogtreecommitdiff
path: root/xfa/fgas/layout
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fgas/layout')
-rw-r--r--xfa/fgas/layout/cfx_break.cpp22
-rw-r--r--xfa/fgas/layout/cfx_break.h41
-rw-r--r--xfa/fgas/layout/cfx_rtfbreak.cpp2
-rw-r--r--xfa/fgas/layout/cfx_txtbreak.cpp2
4 files changed, 26 insertions, 41 deletions
diff --git a/xfa/fgas/layout/cfx_break.cpp b/xfa/fgas/layout/cfx_break.cpp
index 889c043ec2..43ef9a3833 100644
--- a/xfa/fgas/layout/cfx_break.cpp
+++ b/xfa/fgas/layout/cfx_break.cpp
@@ -19,29 +19,11 @@ const int kMinimumTabWidth = 160000;
} // namespace
CFX_Break::CFX_Break(uint32_t dwLayoutStyles)
- : m_eCharType(FX_CHARTYPE_Unknown),
- m_bSingleLine(false),
- m_bCombText(false),
- m_dwIdentity(0),
- m_dwLayoutStyles(dwLayoutStyles),
- m_iLineStart(0),
- m_iLineWidth(2000000),
- m_wParagraphBreakChar(L'\n'),
- m_iFontSize(240),
- m_iTabWidth(720000),
- m_iHorizontalScale(100),
- m_iVerticalScale(100),
- m_iTolerance(0),
- m_iCharSpace(0),
- m_iDefChar(0),
- m_wDefChar(0xFEFF),
- m_pFont(nullptr),
- m_pCurLine(nullptr),
- m_iReadyLineIndex(-1) {
+ : m_dwLayoutStyles(dwLayoutStyles) {
m_pCurLine = &m_Line[0];
}
-CFX_Break::~CFX_Break() {}
+CFX_Break::~CFX_Break() = default;
void CFX_Break::Reset() {
m_eCharType = FX_CHARTYPE_Unknown;
diff --git a/xfa/fgas/layout/cfx_break.h b/xfa/fgas/layout/cfx_break.h
index cc985b7c59..88cef53df1 100644
--- a/xfa/fgas/layout/cfx_break.h
+++ b/xfa/fgas/layout/cfx_break.h
@@ -10,6 +10,7 @@
#include <stdint.h>
#include "core/fxcrt/retain_ptr.h"
+#include "core/fxcrt/unowned_ptr.h"
#include "xfa/fgas/layout/cfx_breakline.h"
class CFGAS_GEFont;
@@ -57,7 +58,9 @@ class CFX_Break {
void ClearBreakPieces();
CFX_Char* GetLastChar(int32_t index, bool bOmitChar, bool bRichText) const;
- const CFX_BreakLine* GetCurrentLineForTesting() const { return m_pCurLine; }
+ const CFX_BreakLine* GetCurrentLineForTesting() const {
+ return m_pCurLine.Get();
+ }
protected:
explicit CFX_Break(uint32_t dwLayoutStyles);
@@ -66,25 +69,25 @@ class CFX_Break {
bool HasLine() const { return m_iReadyLineIndex >= 0; }
FX_CHARTYPE GetUnifiedCharType(FX_CHARTYPE dwType) const;
- FX_CHARTYPE m_eCharType;
- bool m_bSingleLine;
- bool m_bCombText;
- uint32_t m_dwIdentity;
- uint32_t m_dwLayoutStyles;
- int32_t m_iLineStart;
- int32_t m_iLineWidth;
- wchar_t m_wParagraphBreakChar;
- int32_t m_iFontSize;
- int32_t m_iTabWidth;
- int32_t m_iHorizontalScale;
- int32_t m_iVerticalScale;
- int32_t m_iTolerance;
- int32_t m_iCharSpace;
- int32_t m_iDefChar;
- wchar_t m_wDefChar;
+ FX_CHARTYPE m_eCharType = FX_CHARTYPE_Unknown;
+ bool m_bSingleLine = false;
+ bool m_bCombText = false;
+ uint32_t m_dwIdentity = 0;
+ uint32_t m_dwLayoutStyles = 0;
+ int32_t m_iLineStart = 0;
+ int32_t m_iLineWidth = 2000000;
+ wchar_t m_wParagraphBreakChar = L'\n';
+ int32_t m_iFontSize = 240;
+ int32_t m_iTabWidth = 720000;
+ int32_t m_iHorizontalScale = 100;
+ int32_t m_iVerticalScale = 100;
+ int32_t m_iTolerance = 0;
+ int32_t m_iCharSpace = 0;
+ int32_t m_iDefChar = 0;
+ wchar_t m_wDefChar = 0xFEFF;
RetainPtr<CFGAS_GEFont> m_pFont;
- CFX_BreakLine* m_pCurLine;
- int8_t m_iReadyLineIndex;
+ UnownedPtr<CFX_BreakLine> m_pCurLine;
+ int8_t m_iReadyLineIndex = -1;
CFX_BreakLine m_Line[2];
private:
diff --git a/xfa/fgas/layout/cfx_rtfbreak.cpp b/xfa/fgas/layout/cfx_rtfbreak.cpp
index de8703fb2d..4dfe8989d1 100644
--- a/xfa/fgas/layout/cfx_rtfbreak.cpp
+++ b/xfa/fgas/layout/cfx_rtfbreak.cpp
@@ -355,7 +355,7 @@ bool CFX_RTFBreak::EndBreak_SplitLine(CFX_BreakLine* pNextLine,
case FX_CHARTYPE_Space:
break;
default:
- SplitTextLine(m_pCurLine, pNextLine, !m_bPagination && bAllChars);
+ SplitTextLine(m_pCurLine.Get(), pNextLine, !m_bPagination && bAllChars);
bDone = true;
break;
}
diff --git a/xfa/fgas/layout/cfx_txtbreak.cpp b/xfa/fgas/layout/cfx_txtbreak.cpp
index 7633c4c91e..490426a221 100644
--- a/xfa/fgas/layout/cfx_txtbreak.cpp
+++ b/xfa/fgas/layout/cfx_txtbreak.cpp
@@ -293,7 +293,7 @@ bool CFX_TxtBreak::EndBreak_SplitLine(CFX_BreakLine* pNextLine,
case FX_CHARTYPE_Space:
break;
default:
- SplitTextLine(m_pCurLine, pNextLine, bAllChars);
+ SplitTextLine(m_pCurLine.Get(), pNextLine, bAllChars);
bDone = true;
break;
}