diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2018-01-10 22:13:45 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-01-10 22:13:45 +0000 |
commit | 7f302e511fe86611a311748cd7b9dbb18ceea156 (patch) | |
tree | 1354c0dcf63615ba070039fc54c8f200d359db89 | |
parent | 962760426dcb1801683e6fd91c4f3650eea51155 (diff) | |
download | pdfium-7f302e511fe86611a311748cd7b9dbb18ceea156.tar.xz |
Rename GetPara to GetParaIfExistschromium/3318
This CL renames GetPara to make it explicit it can return nullptr.
Change-Id: I7c6529c15646b9947964e25a8d28938b38f091d6
Reviewed-on: https://pdfium-review.googlesource.com/22680
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
-rw-r--r-- | xfa/fxfa/cxfa_ffcheckbutton.cpp | 2 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_ffcombobox.cpp | 2 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_ffdatetimeedit.cpp | 2 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_ffimage.cpp | 2 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_ffimageedit.cpp | 2 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_fflistbox.cpp | 2 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_fftextedit.cpp | 2 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_fwltheme.cpp | 4 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_textlayout.cpp | 6 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_textparser.cpp | 6 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_textprovider.cpp | 4 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_textprovider.h | 2 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_widgetacc.cpp | 4 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_node.cpp | 4 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_node.h | 2 |
15 files changed, 23 insertions, 23 deletions
diff --git a/xfa/fxfa/cxfa_ffcheckbutton.cpp b/xfa/fxfa/cxfa_ffcheckbutton.cpp index 96d7431ad4..3fd1d88987 100644 --- a/xfa/fxfa/cxfa_ffcheckbutton.cpp +++ b/xfa/fxfa/cxfa_ffcheckbutton.cpp @@ -115,7 +115,7 @@ bool CXFA_FFCheckButton::PerformLayout() { XFA_AttributeEnum iHorzAlign = XFA_AttributeEnum::Left; XFA_AttributeEnum iVertAlign = XFA_AttributeEnum::Top; - CXFA_Para* para = m_pNode->GetPara(); + CXFA_Para* para = m_pNode->GetParaIfExists(); if (para) { iHorzAlign = para->GetHorizontalAlign(); iVertAlign = para->GetVerticalAlign(); diff --git a/xfa/fxfa/cxfa_ffcombobox.cpp b/xfa/fxfa/cxfa_ffcombobox.cpp index 9d65a64a29..5d0792b56d 100644 --- a/xfa/fxfa/cxfa_ffcombobox.cpp +++ b/xfa/fxfa/cxfa_ffcombobox.cpp @@ -143,7 +143,7 @@ void CXFA_FFComboBox::FWLEventSelChange(CXFA_EventParam* pParam) { } uint32_t CXFA_FFComboBox::GetAlignment() { - CXFA_Para* para = m_pNode->GetPara(); + CXFA_Para* para = m_pNode->GetParaIfExists(); if (!para) return 0; diff --git a/xfa/fxfa/cxfa_ffdatetimeedit.cpp b/xfa/fxfa/cxfa_ffdatetimeedit.cpp index aab73276ca..018830024b 100644 --- a/xfa/fxfa/cxfa_ffdatetimeedit.cpp +++ b/xfa/fxfa/cxfa_ffdatetimeedit.cpp @@ -99,7 +99,7 @@ void CXFA_FFDateTimeEdit::UpdateWidgetProperty() { } uint32_t CXFA_FFDateTimeEdit::GetAlignment() { - CXFA_Para* para = m_pNode->GetPara(); + CXFA_Para* para = m_pNode->GetParaIfExists(); if (!para) return 0; diff --git a/xfa/fxfa/cxfa_ffimage.cpp b/xfa/fxfa/cxfa_ffimage.cpp index a2c21a1a7b..4fb5f159ed 100644 --- a/xfa/fxfa/cxfa_ffimage.cpp +++ b/xfa/fxfa/cxfa_ffimage.cpp @@ -61,7 +61,7 @@ void CXFA_FFImage::RenderWidget(CXFA_Graphics* pGS, XFA_AttributeEnum iHorzAlign = XFA_AttributeEnum::Left; XFA_AttributeEnum iVertAlign = XFA_AttributeEnum::Top; - CXFA_Para* para = m_pNode->GetPara(); + CXFA_Para* para = m_pNode->GetParaIfExists(); if (para) { iHorzAlign = para->GetHorizontalAlign(); iVertAlign = para->GetVerticalAlign(); diff --git a/xfa/fxfa/cxfa_ffimageedit.cpp b/xfa/fxfa/cxfa_ffimageedit.cpp index 4784004237..15d798c30c 100644 --- a/xfa/fxfa/cxfa_ffimageedit.cpp +++ b/xfa/fxfa/cxfa_ffimageedit.cpp @@ -75,7 +75,7 @@ void CXFA_FFImageEdit::RenderWidget(CXFA_Graphics* pGS, CFX_RectF rtImage = m_pNormalWidget->GetWidgetRect(); XFA_AttributeEnum iHorzAlign = XFA_AttributeEnum::Left; XFA_AttributeEnum iVertAlign = XFA_AttributeEnum::Top; - CXFA_Para* para = m_pNode->GetPara(); + CXFA_Para* para = m_pNode->GetParaIfExists(); if (para) { iHorzAlign = para->GetHorizontalAlign(); iVertAlign = para->GetVerticalAlign(); diff --git a/xfa/fxfa/cxfa_fflistbox.cpp b/xfa/fxfa/cxfa_fflistbox.cpp index 892f0a64e6..1a7b11bf64 100644 --- a/xfa/fxfa/cxfa_fflistbox.cpp +++ b/xfa/fxfa/cxfa_fflistbox.cpp @@ -105,7 +105,7 @@ bool CXFA_FFListBox::IsDataChanged() { } uint32_t CXFA_FFListBox::GetAlignment() { - CXFA_Para* para = m_pNode->GetPara(); + CXFA_Para* para = m_pNode->GetParaIfExists(); if (!para) return 0; diff --git a/xfa/fxfa/cxfa_fftextedit.cpp b/xfa/fxfa/cxfa_fftextedit.cpp index 706a9a84cf..3429d97749 100644 --- a/xfa/fxfa/cxfa_fftextedit.cpp +++ b/xfa/fxfa/cxfa_fftextedit.cpp @@ -213,7 +213,7 @@ bool CXFA_FFTextEdit::IsDataChanged() { } uint32_t CXFA_FFTextEdit::GetAlignment() { - CXFA_Para* para = m_pNode->GetPara(); + CXFA_Para* para = m_pNode->GetParaIfExists(); if (!para) return 0; diff --git a/xfa/fxfa/cxfa_fwltheme.cpp b/xfa/fxfa/cxfa_fwltheme.cpp index cd55ca48d7..920968269f 100644 --- a/xfa/fxfa/cxfa_fwltheme.cpp +++ b/xfa/fxfa/cxfa_fwltheme.cpp @@ -155,7 +155,7 @@ CFX_RectF CXFA_FWLTheme::GetUIMargin(CFWL_ThemePart* pThemePart) const { CXFA_LayoutItem* pItem = pWidget; CXFA_WidgetAcc* pWidgetAcc = pWidget->GetNode()->GetWidgetAcc(); rect = pWidgetAcc->GetUIMargin(); - CXFA_Para* para = pWidgetAcc->GetNode()->GetPara(); + CXFA_Para* para = pWidgetAcc->GetNode()->GetParaIfExists(); if (para) { rect.left += para->GetMarginLeft(); if (pWidgetAcc->IsMultiLine()) @@ -213,7 +213,7 @@ FX_COLORREF CXFA_FWLTheme::GetTextColor(CFWL_ThemePart* pThemePart) const { CFX_SizeF CXFA_FWLTheme::GetSpaceAboveBelow(CFWL_ThemePart* pThemePart) const { CFX_SizeF sizeAboveBelow; if (CXFA_FFWidget* pWidget = XFA_ThemeGetOuterWidget(pThemePart->m_pWidget)) { - CXFA_Para* para = pWidget->GetNode()->GetPara(); + CXFA_Para* para = pWidget->GetNode()->GetParaIfExists(); if (para) { sizeAboveBelow.width = para->GetSpaceAbove(); sizeAboveBelow.height = para->GetSpaceBelow(); diff --git a/xfa/fxfa/cxfa_textlayout.cpp b/xfa/fxfa/cxfa_textlayout.cpp index 15ac909e2e..d252a36ade 100644 --- a/xfa/fxfa/cxfa_textlayout.cpp +++ b/xfa/fxfa/cxfa_textlayout.cpp @@ -104,7 +104,7 @@ std::unique_ptr<CFX_RTFBreak> CXFA_TextLayout::CreateBreak(bool bDefault) { } void CXFA_TextLayout::InitBreak(float fLineWidth) { - CXFA_Para* para = m_pTextProvider->GetPara(); + CXFA_Para* para = m_pTextProvider->GetParaIfExists(); float fStart = 0; float fStartPos = 0; if (para) { @@ -652,7 +652,7 @@ void CXFA_TextLayout::LoadText(CXFA_Node* pNode, bool bSavePieces) { InitBreak(textWidth); - CXFA_Para* para = m_pTextProvider->GetPara(); + CXFA_Para* para = m_pTextProvider->GetParaIfExists(); float fSpaceAbove = 0; if (para) { fSpaceAbove = para->GetSpaceAbove(); @@ -1100,7 +1100,7 @@ void CXFA_TextLayout::AppendTextLine(CFX_BreakType dwStatus, if (dwStatus == CFX_BreakType::Paragraph) { m_pBreak->Reset(); if (!pStyle && bEndBreak) { - CXFA_Para* para = m_pTextProvider->GetPara(); + CXFA_Para* para = m_pTextProvider->GetParaIfExists(); if (para) { float fStartPos = para->GetMarginLeft(); float fIndent = para->GetTextIndent(); diff --git a/xfa/fxfa/cxfa_textparser.cpp b/xfa/fxfa/cxfa_textparser.cpp index 0fd59a0852..07ba896843 100644 --- a/xfa/fxfa/cxfa_textparser.cpp +++ b/xfa/fxfa/cxfa_textparser.cpp @@ -92,7 +92,7 @@ std::unique_ptr<CFX_CSSStyleSheet> CXFA_TextParser::LoadDefaultSheetStyle() { RetainPtr<CFX_CSSComputedStyle> CXFA_TextParser::CreateRootStyle( CXFA_TextProvider* pTextProvider) { - CXFA_Para* para = pTextProvider->GetPara(); + CXFA_Para* para = pTextProvider->GetParaIfExists(); auto pStyle = m_pSelector->CreateComputedStyle(nullptr); float fLineHeight = 0; float fFontSize = 10; @@ -297,7 +297,7 @@ std::unique_ptr<CXFA_TextParser::TagProvider> CXFA_TextParser::ParseTagInfo( XFA_AttributeEnum CXFA_TextParser::GetVAlign( CXFA_TextProvider* pTextProvider) const { - CXFA_Para* para = pTextProvider->GetPara(); + CXFA_Para* para = pTextProvider->GetParaIfExists(); return para ? para->GetVerticalAlign() : XFA_AttributeEnum::Top; } @@ -476,7 +476,7 @@ float CXFA_TextParser::GetLineHeight(CXFA_TextProvider* pTextProvider, if (pStyle) { fLineHeight = pStyle->GetLineHeight(); } else { - CXFA_Para* para = pTextProvider->GetPara(); + CXFA_Para* para = pTextProvider->GetParaIfExists(); if (para) fLineHeight = para->GetLineHeight(); } diff --git a/xfa/fxfa/cxfa_textprovider.cpp b/xfa/fxfa/cxfa_textprovider.cpp index 6b4198ec1e..33e301ffbb 100644 --- a/xfa/fxfa/cxfa_textprovider.cpp +++ b/xfa/fxfa/cxfa_textprovider.cpp @@ -115,9 +115,9 @@ CXFA_Node* CXFA_TextProvider::GetTextNode(bool& bRichText) { return nullptr; } -CXFA_Para* CXFA_TextProvider::GetPara() { +CXFA_Para* CXFA_TextProvider::GetParaIfExists() { if (m_eType == XFA_TEXTPROVIDERTYPE_Text) - return m_pWidgetAcc->GetNode()->GetPara(); + return m_pWidgetAcc->GetNode()->GetParaIfExists(); CXFA_Caption* pNode = m_pWidgetAcc->GetNode()->GetChild<CXFA_Caption>( 0, XFA_Element::Caption, false); diff --git a/xfa/fxfa/cxfa_textprovider.h b/xfa/fxfa/cxfa_textprovider.h index 423e99cf33..3431c9a30c 100644 --- a/xfa/fxfa/cxfa_textprovider.h +++ b/xfa/fxfa/cxfa_textprovider.h @@ -31,7 +31,7 @@ class CXFA_TextProvider { ~CXFA_TextProvider() {} CXFA_Node* GetTextNode(bool& bRichText); - CXFA_Para* GetPara(); + CXFA_Para* GetParaIfExists(); CXFA_Font* GetFontIfExists(); bool IsCheckButtonAndAutoWidth(); bool GetEmbbedObj(bool bURI, diff --git a/xfa/fxfa/cxfa_widgetacc.cpp b/xfa/fxfa/cxfa_widgetacc.cpp index efcd320a03..2714711205 100644 --- a/xfa/fxfa/cxfa_widgetacc.cpp +++ b/xfa/fxfa/cxfa_widgetacc.cpp @@ -579,7 +579,7 @@ bool CXFA_WidgetAcc::CalculateWidgetAutoSize(CFX_SizeF& size) { size.height += margin->GetTopInset() + margin->GetBottomInset(); } - CXFA_Para* para = m_pNode->GetPara(); + CXFA_Para* para = m_pNode->GetParaIfExists(); if (para) size.width += para->GetMarginLeft() + para->GetTextIndent(); @@ -1040,7 +1040,7 @@ bool CXFA_WidgetAcc::FindSplitPos(CXFA_FFDocView* docView, if (fHeight > 0.1f && iBlockIndex == 0) { fStartOffset = fTopInset; fHeight -= (fTopInset + fBottomInset); - CXFA_Para* para = m_pNode->GetPara(); + CXFA_Para* para = m_pNode->GetParaIfExists(); if (para) { fSpaceAbove = para->GetSpaceAbove(); float fSpaceBelow = para->GetSpaceBelow(); diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp index 54b4661ce3..093d83a67d 100644 --- a/xfa/fxfa/parser/cxfa_node.cpp +++ b/xfa/fxfa/parser/cxfa_node.cpp @@ -1562,7 +1562,7 @@ float CXFA_Node::GetFontSize() const { float CXFA_Node::GetLineHeight() const { float fLineHeight = 0; - CXFA_Para* para = GetPara(); + CXFA_Para* para = GetParaIfExists(); if (para) fLineHeight = para->GetLineHeight(); @@ -1580,7 +1580,7 @@ CXFA_Margin* CXFA_Node::GetMarginIfExists() const { return JSObject()->GetProperty<CXFA_Margin>(0, XFA_Element::Margin); } -CXFA_Para* CXFA_Node::GetPara() const { +CXFA_Para* CXFA_Node::GetParaIfExists() const { return JSObject()->GetProperty<CXFA_Para>(0, XFA_Element::Para); } diff --git a/xfa/fxfa/parser/cxfa_node.h b/xfa/fxfa/parser/cxfa_node.h index 1dcaeec0e5..ed3b21d1e2 100644 --- a/xfa/fxfa/parser/cxfa_node.h +++ b/xfa/fxfa/parser/cxfa_node.h @@ -247,7 +247,7 @@ class CXFA_Node : public CXFA_Object { float GetLineHeight() const; CXFA_Margin* GetMarginIfExists() const; - CXFA_Para* GetPara() const; + CXFA_Para* GetParaIfExists() const; CXFA_Calculate* GetCalculate() const; CXFA_Validate* GetValidate() const; CXFA_Validate* GetOrCreateValidate(); |