| Index: xfa/fxfa/app/xfa_fftext.cpp
|
| diff --git a/xfa/fxfa/app/xfa_fftext.cpp b/xfa/fxfa/app/xfa_fftext.cpp
|
| index 1000b91c089244c1bbfb1e5bcb4c6654002088d1..2cefa09364537cebd5ca1208699d3a760ac15c40 100644
|
| --- a/xfa/fxfa/app/xfa_fftext.cpp
|
| +++ b/xfa/fxfa/app/xfa_fftext.cpp
|
| @@ -39,15 +39,15 @@ void CXFA_FFText::RenderWidget(CFX_Graphics* pGS,
|
| GetRectWithoutRotate(rtText);
|
| if (CXFA_Margin mgWidget = m_pDataAcc->GetMargin()) {
|
| CXFA_LayoutItem* pItem = this;
|
| - if (pItem->GetPrev() == NULL && pItem->GetNext() == NULL) {
|
| + if (!pItem->GetPrev() && !pItem->GetNext()) {
|
| XFA_RectWidthoutMargin(rtText, mgWidget);
|
| } else {
|
| FX_FLOAT fLeftInset, fRightInset, fTopInset = 0, fBottomInset = 0;
|
| mgWidget.GetLeftInset(fLeftInset);
|
| mgWidget.GetRightInset(fRightInset);
|
| - if (pItem->GetPrev() == NULL) {
|
| + if (!pItem->GetPrev()) {
|
| mgWidget.GetTopInset(fTopInset);
|
| - } else if (pItem->GetNext() == NULL) {
|
| + } else if (!pItem->GetNext()) {
|
| mgWidget.GetBottomInset(fBottomInset);
|
| }
|
| rtText.Deflate(fLeftInset, fTopInset, fRightInset, fBottomInset);
|
| @@ -77,7 +77,7 @@ FX_BOOL CXFA_FFText::PerformLayout() {
|
| }
|
| pTextLayout->m_Blocks.RemoveAll();
|
| CXFA_LayoutItem* pItem = this;
|
| - if (pItem->GetPrev() == NULL && pItem->GetNext() == NULL) {
|
| + if (!pItem->GetPrev() && !pItem->GetNext()) {
|
| return TRUE;
|
| }
|
| pItem = pItem->GetFirst();
|
| @@ -85,11 +85,11 @@ FX_BOOL CXFA_FFText::PerformLayout() {
|
| CFX_RectF rtText;
|
| pItem->GetRect(rtText);
|
| if (CXFA_Margin mgWidget = m_pDataAcc->GetMargin()) {
|
| - if (pItem->GetPrev() == NULL) {
|
| + if (!pItem->GetPrev()) {
|
| FX_FLOAT fTopInset;
|
| mgWidget.GetTopInset(fTopInset);
|
| rtText.height -= fTopInset;
|
| - } else if (pItem->GetNext() == NULL) {
|
| + } else if (!pItem->GetNext()) {
|
| FX_FLOAT fBottomInset;
|
| mgWidget.GetBottomInset(fBottomInset);
|
| rtText.height -= fBottomInset;
|
| @@ -108,37 +108,35 @@ FX_BOOL CXFA_FFText::OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
|
| return FALSE;
|
| }
|
| const FX_WCHAR* wsURLContent = GetLinkURLAtPoint(fx, fy);
|
| - if (NULL == wsURLContent) {
|
| + if (!wsURLContent)
|
| return FALSE;
|
| - }
|
| +
|
| SetButtonDown(TRUE);
|
| return TRUE;
|
| }
|
| +
|
| FX_BOOL CXFA_FFText::OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
|
| CFX_RectF rtBox;
|
| GetRectWithoutRotate(rtBox);
|
| - if (!rtBox.Contains(fx, fy)) {
|
| - return FALSE;
|
| - }
|
| - const FX_WCHAR* wsURLContent = GetLinkURLAtPoint(fx, fy);
|
| - if (NULL == wsURLContent) {
|
| + if (!rtBox.Contains(fx, fy))
|
| return FALSE;
|
| - }
|
| - return TRUE;
|
| + return !!GetLinkURLAtPoint(fx, fy);
|
| }
|
| +
|
| FX_BOOL CXFA_FFText::OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
|
| if (!IsButtonDown()) {
|
| return FALSE;
|
| }
|
| SetButtonDown(FALSE);
|
| const FX_WCHAR* wsURLContent = GetLinkURLAtPoint(fx, fy);
|
| - if (NULL == wsURLContent) {
|
| + if (!wsURLContent)
|
| return FALSE;
|
| - }
|
| +
|
| CXFA_FFDoc* pDoc = GetDoc();
|
| pDoc->GetDocProvider()->GotoURL(pDoc, wsURLContent, FALSE);
|
| return TRUE;
|
| }
|
| +
|
| FWL_WidgetHit CXFA_FFText::OnHitTest(FX_FLOAT fx, FX_FLOAT fy) {
|
| CFX_RectF rtBox;
|
| GetRectWithoutRotate(rtBox);
|
| @@ -150,9 +148,9 @@ FWL_WidgetHit CXFA_FFText::OnHitTest(FX_FLOAT fx, FX_FLOAT fy) {
|
| }
|
| const FX_WCHAR* CXFA_FFText::GetLinkURLAtPoint(FX_FLOAT fx, FX_FLOAT fy) {
|
| CXFA_TextLayout* pTextLayout = m_pDataAcc->GetTextLayout();
|
| - if (NULL == pTextLayout) {
|
| - return NULL;
|
| - }
|
| + if (!pTextLayout)
|
| + return nullptr;
|
| +
|
| FX_FLOAT x(fx), y(fy);
|
| FWLToClient(x, y);
|
| const CXFA_PieceLineArray* pPieceLines = pTextLayout->GetPieceLines();
|
| @@ -167,7 +165,7 @@ const FX_WCHAR* CXFA_FFText::GetLinkURLAtPoint(FX_FLOAT fx, FX_FLOAT fy) {
|
| }
|
| }
|
| }
|
| - return NULL;
|
| + return nullptr;
|
| }
|
| void CXFA_FFText::FWLToClient(FX_FLOAT& fx, FX_FLOAT& fy) {
|
| CFX_RectF rtWidget;
|
|
|