diff options
author | Lei Zhang <thestig@chromium.org> | 2015-10-02 10:22:14 -0700 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-10-02 10:22:14 -0700 |
commit | 421b4612439ee3a81d675b542038c6c3ff25e977 (patch) | |
tree | 5cc05d8c1cbf7825dfd60dc8219af390f8066e78 /xfa/src/fxfa/src/app/xfa_ffwidgetacc.cpp | |
parent | db5256fb4ad0678ab7f895c40391cb77a3ba40fa (diff) | |
download | pdfium-421b4612439ee3a81d675b542038c6c3ff25e977.tar.xz |
XFA: Remove test for new.
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1377853004 .
Diffstat (limited to 'xfa/src/fxfa/src/app/xfa_ffwidgetacc.cpp')
-rw-r--r-- | xfa/src/fxfa/src/app/xfa_ffwidgetacc.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/xfa/src/fxfa/src/app/xfa_ffwidgetacc.cpp b/xfa/src/fxfa/src/app/xfa_ffwidgetacc.cpp index 6185ade383..8a4c18823c 100644 --- a/xfa/src/fxfa/src/app/xfa_ffwidgetacc.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffwidgetacc.cpp @@ -45,13 +45,12 @@ class CXFA_TextLayoutData : public CXFA_WidgetLayoutData { }
m_pTextProvider = NULL;
}
- FX_BOOL LoadText(CXFA_WidgetAcc* pAcc) {
- if (m_pTextLayout) {
- return TRUE;
- }
+ void LoadText(CXFA_WidgetAcc* pAcc) {
+ if (m_pTextLayout)
+ return;
+
m_pTextProvider = new CXFA_TextProvider(pAcc, XFA_TEXTPROVIDERTYPE_Text);
m_pTextLayout = new CXFA_TextLayout(m_pTextProvider);
- return m_pTextLayout != NULL;
}
CXFA_TextLayout* m_pTextLayout;
CXFA_TextProvider* m_pTextProvider;
@@ -130,7 +129,7 @@ class CXFA_FieldLayoutData : public CXFA_WidgetLayoutData { m_pCapTextProvider =
new CXFA_TextProvider(pAcc, XFA_TEXTPROVIDERTYPE_Caption);
m_pCapTextLayout = new CXFA_TextLayout(m_pCapTextProvider);
- return m_pCapTextLayout != NULL;
+ return TRUE;
}
return FALSE;
}
@@ -1043,9 +1042,7 @@ void CXFA_WidgetAcc::GetImageEditDpi(int32_t& iImageXDpi, int32_t& iImageYDpi) { iImageYDpi = ((CXFA_ImageEditData*)m_pLayoutData)->m_iImageYDpi;
}
FX_BOOL CXFA_WidgetAcc::CalculateTextAutoSize(CFX_SizeF& size) {
- if (!LoadText()) {
- return FALSE;
- }
+ LoadText();
CXFA_TextLayout* pTextLayout =
((CXFA_TextLayoutData*)m_pLayoutData)->m_pTextLayout;
if (pTextLayout) {
@@ -1054,9 +1051,9 @@ FX_BOOL CXFA_WidgetAcc::CalculateTextAutoSize(CFX_SizeF& size) { }
return CalculateWidgetAutoSize(size);
}
-FX_BOOL CXFA_WidgetAcc::LoadText() {
+void CXFA_WidgetAcc::LoadText() {
InitLayoutData();
- return ((CXFA_TextLayoutData*)m_pLayoutData)->LoadText(this);
+ ((CXFA_TextLayoutData*)m_pLayoutData)->LoadText(this);
}
FX_FLOAT CXFA_WidgetAcc::CalculateWidgetAutoWidth(FX_FLOAT fWidthCalc) {
CXFA_Margin mgWidget = this->GetMargin();
|