Merge to XFA: Cleanup: Remove uses of "this->" in core/
authorLei Zhang <thestig@chromium.org>
Sat, 13 Jun 2015 07:31:30 +0000 (00:31 -0700)
committerLei Zhang <thestig@chromium.org>
Sat, 13 Jun 2015 07:31:30 +0000 (00:31 -0700)
R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1173223002.

(cherry picked from commit 2b5e0d5b20654d116045484868c9e015ed698124)

Review URL: https://codereview.chromium.org/1186673004.

12 files changed:
core/include/fpdfdoc/fpdf_vt.h
core/include/fxcrt/fx_coordinates.h
core/include/fxcrt/fx_string.h
core/src/fpdfdoc/doc_vt.cpp
core/src/fpdfdoc/pdf_vt.h
core/src/fpdftext/fpdf_text_int.cpp
core/src/fxcodec/codec/fx_codec_jpx_opj.cpp
core/src/fxcodec/jbig2/JBig2_Context.cpp
core/src/fxcrt/fx_basic_coords.cpp
core/src/fxge/skia/fx_skia_blitter_new.cpp
core/src/reflow/layoutprovider_taggedpdf.cpp
core/src/reflow/reflowedpage.cpp

index 1fec0e6..7dbd154 100644 (file)
@@ -26,11 +26,13 @@ struct CPVT_WordPlace {
     {
     }
 
-    CPVT_WordPlace(int32_t nSecIndex, int32_t nLineIndex, int32_t nWordIndex)
+    CPVT_WordPlace(int32_t other_nSecIndex,
+                   int32_t other_nLineIndex,
+                   int32_t other_nWordIndex)
     {
-        this->nSecIndex = nSecIndex;
-        this->nLineIndex = nLineIndex;
-        this->nWordIndex = nWordIndex;
+        nSecIndex = other_nSecIndex;
+        nLineIndex = other_nLineIndex;
+        nWordIndex = other_nWordIndex;
     }
 
     void Default()
@@ -40,32 +42,32 @@ struct CPVT_WordPlace {
 
     FX_BOOL operator == (const CPVT_WordPlace & wp) const
     {
-        return wp.nSecIndex == this->nSecIndex && wp.nLineIndex == this->nLineIndex && wp.nWordIndex == this->nWordIndex;
+        return wp.nSecIndex == nSecIndex && wp.nLineIndex == nLineIndex && wp.nWordIndex == nWordIndex;
     }
 
     FX_BOOL operator != (const CPVT_WordPlace & wp) const
     {
-        return wp.nSecIndex != this->nSecIndex || wp.nLineIndex != this->nLineIndex || wp.nWordIndex != this->nWordIndex;
+        return wp.nSecIndex != nSecIndex || wp.nLineIndex != nLineIndex || wp.nWordIndex != nWordIndex;
     }
 
     inline int32_t WordCmp(const CPVT_WordPlace & wp) const
     {
-        if (this->nSecIndex > wp.nSecIndex) {
+        if (nSecIndex > wp.nSecIndex) {
             return 1;
         }
-        if (this->nSecIndex < wp.nSecIndex) {
+        if (nSecIndex < wp.nSecIndex) {
             return -1;
         }
-        if (this->nLineIndex > wp.nLineIndex) {
+        if (nLineIndex > wp.nLineIndex) {
             return 1;
         }
-        if (this->nLineIndex < wp.nLineIndex) {
+        if (nLineIndex < wp.nLineIndex) {
             return -1;
         }
-        if (this->nWordIndex > wp.nWordIndex) {
+        if (nWordIndex > wp.nWordIndex) {
             return 1;
         }
-        if (this->nWordIndex < wp.nWordIndex) {
+        if (nWordIndex < wp.nWordIndex) {
             return -1;
         }
         return 0;
@@ -73,16 +75,16 @@ struct CPVT_WordPlace {
 
     inline int32_t LineCmp(const CPVT_WordPlace & wp) const
     {
-        if (this->nSecIndex > wp.nSecIndex) {
+        if (nSecIndex > wp.nSecIndex) {
             return 1;
         }
-        if (this->nSecIndex < wp.nSecIndex) {
+        if (nSecIndex < wp.nSecIndex) {
             return -1;
         }
-        if (this->nLineIndex > wp.nLineIndex) {
+        if (nLineIndex > wp.nLineIndex) {
             return 1;
         }
-        if (this->nLineIndex < wp.nLineIndex) {
+        if (nLineIndex < wp.nLineIndex) {
             return -1;
         }
         return 0;
@@ -90,10 +92,10 @@ struct CPVT_WordPlace {
 
     inline int32_t SecCmp(const CPVT_WordPlace & wp) const
     {
-        if (this->nSecIndex > wp.nSecIndex) {
+        if (nSecIndex > wp.nSecIndex) {
             return 1;
         }
-        if (this->nSecIndex < wp.nSecIndex) {
+        if (nSecIndex < wp.nSecIndex) {
             return -1;
         }
         return 0;
@@ -124,31 +126,31 @@ struct CPVT_WordRange {
 
     void Set(const CPVT_WordPlace & begin, const CPVT_WordPlace & end)
     {
-        this->BeginPos = begin;
-        this->EndPos = end;
+        BeginPos = begin;
+        EndPos = end;
         SwapWordPlace();
     }
 
     void SetBeginPos(const CPVT_WordPlace & begin)
     {
-        this->BeginPos = begin;
+        BeginPos = begin;
         SwapWordPlace();
     }
 
     void SetEndPos(const CPVT_WordPlace & end)
     {
-        this->EndPos = end;
+        EndPos = end;
         SwapWordPlace();
     }
 
     FX_BOOL IsExist() const
     {
-        return this->BeginPos != this->EndPos;
+        return BeginPos != EndPos;
     }
 
     FX_BOOL operator != (const CPVT_WordRange & wr) const
     {
-        return wr.BeginPos != this->BeginPos || wr.EndPos != this->EndPos;
+        return wr.BeginPos != BeginPos || wr.EndPos != EndPos;
     }
 
     void SwapWordPlace()
index c98ece9..779f172 100644 (file)
@@ -694,21 +694,24 @@ public:
         top += y;
     }
 
-    void                               Inflate(FX_FLOAT left, FX_FLOAT bottom, FX_FLOAT right, FX_FLOAT top)
+    void Inflate(FX_FLOAT other_left,
+                 FX_FLOAT other_bottom,
+                 FX_FLOAT other_right,
+                 FX_FLOAT other_top)
     {
         Normalize();
-        this->left -= left;
-        this->bottom -= bottom;
-        this->right += right;
-        this->top += top;
+        left -= other_left;
+        bottom -= other_bottom;
+        right += other_right;
+        top += other_top;
     }
 
-    void                               Inflate(const CFX_FloatRect &rt)
+    void Inflate(const CFX_FloatRect &rt)
     {
         Inflate(rt.left, rt.bottom, rt.right, rt.top);
     }
 
-    void                               Deflate(FX_FLOAT x, FX_FLOAT y)
+    void Deflate(FX_FLOAT x, FX_FLOAT y)
     {
         Normalize();
         left += x;
@@ -717,21 +720,24 @@ public:
         top -= y;
     }
 
-    void                               Deflate(FX_FLOAT left, FX_FLOAT bottom, FX_FLOAT right, FX_FLOAT top)
+    void Deflate(FX_FLOAT other_left,
+                 FX_FLOAT other_bottom,
+                 FX_FLOAT other_right,
+                 FX_FLOAT other_top)
     {
         Normalize();
-        this->left += left;
-        this->bottom += bottom;
-        this->right -= right;
-        this->top -= top;
+        left += other_left;
+        bottom += other_bottom;
+        right -= other_right;
+        top -= other_top;
     }
 
-    void                               Deflate(const CFX_FloatRect &rt)
+    void Deflate(const CFX_FloatRect &rt)
     {
         Deflate(rt.left, rt.bottom, rt.right, rt.top);
     }
 
-    void                               Translate(FX_FLOAT e, FX_FLOAT f)
+    void Translate(FX_FLOAT e, FX_FLOAT f)
     {
         left += e;
         right += e;
index 48e0e51..8d73555 100644 (file)
@@ -184,7 +184,7 @@ public:
 
     // Move constructor.
     inline CFX_ByteString(CFX_ByteString&& other) {
-        this->m_pData = other.m_pData;
+        m_pData = other.m_pData;
         other.m_pData = nullptr;
     }
 
@@ -630,7 +630,7 @@ public:
 
     // Move constructor.
     inline CFX_WideString(CFX_WideString&& other) {
-        this->m_pData = other.m_pData;
+        m_pData = other.m_pData;
         other.m_pData = nullptr;
     }
 
index 94dc112..f89090b 100644 (file)
@@ -78,7 +78,7 @@ void CSection::ResetLinePlace()
 CPVT_WordPlace CSection::AddWord(const CPVT_WordPlace & place, const CPVT_WordInfo & wordinfo)
 {
     if (CPVT_WordInfo * pWord = FX_NEW CPVT_WordInfo(wordinfo)) {
-        int32_t nWordIndex = FPDF_MAX(FPDF_MIN(place.nWordIndex, this->m_WordArray.GetSize()), 0);
+        int32_t nWordIndex = FPDF_MAX(FPDF_MIN(place.nWordIndex, m_WordArray.GetSize()), 0);
         if (nWordIndex == m_WordArray.GetSize()) {
             m_WordArray.Add(pWord);
         } else {
@@ -117,7 +117,7 @@ CPVT_WordPlace CSection::GetEndWordPlace() const
     if (CLine * pLine = m_LineArray.GetAt(m_LineArray.GetSize() - 1)) {
         return pLine->GetEndWordPlace();
     } else {
-        return this->SecPlace;
+        return SecPlace;
     }
 }
 CPVT_WordPlace CSection::GetPrevWordPlace(const CPVT_WordPlace & place) const
@@ -858,7 +858,7 @@ void CPDF_VariableText::ResetAll()
 CPVT_WordPlace CPDF_VariableText::InsertWord(const CPVT_WordPlace & place, FX_WORD word, int32_t charset,
         const CPVT_WordProps * pWordProps)
 {
-    int32_t nTotlaWords = this->GetTotalWords();
+    int32_t nTotlaWords = GetTotalWords();
     if (m_nLimitChar > 0 && nTotlaWords >= m_nLimitChar) {
         return place;
     }
@@ -882,7 +882,7 @@ CPVT_WordPlace CPDF_VariableText::InsertWord(const CPVT_WordPlace & place, FX_WO
 CPVT_WordPlace CPDF_VariableText::InsertSection(const CPVT_WordPlace & place, const CPVT_SecProps * pSecProps,
         const CPVT_WordProps * pWordProps)
 {
-    int32_t nTotlaWords = this->GetTotalWords();
+    int32_t nTotlaWords = GetTotalWords();
     if (m_nLimitChar > 0 && nTotlaWords >= m_nLimitChar) {
         return place;
     }
@@ -1418,7 +1418,7 @@ FX_FLOAT CPDF_VariableText::GetLineIndent(const CPVT_SectionInfo & SecInfo)
 }
 int32_t CPDF_VariableText::GetAlignment(const CPVT_SectionInfo& SecInfo)
 {
-    return m_bRichText && SecInfo.pSecProps ? SecInfo.pSecProps->nAlignment : this->m_nAlignment;
+    return m_bRichText && SecInfo.pSecProps ? SecInfo.pSecProps->nAlignment : m_nAlignment;
 }
 FX_FLOAT CPDF_VariableText::GetCharSpace(const CPVT_WordInfo & WordInfo)
 {
@@ -1501,13 +1501,13 @@ void CPDF_VariableText::ClearWords(const CPVT_WordRange & PlaceRange)
 CPVT_WordPlace CPDF_VariableText::ClearLeftWord(const CPVT_WordPlace & place)
 {
     if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) {
-        CPVT_WordPlace leftplace = this->GetPrevWordPlace(place);
+        CPVT_WordPlace leftplace = GetPrevWordPlace(place);
         if (leftplace != place) {
             if (leftplace.nSecIndex != place.nSecIndex) {
                 if (pSection->m_WordArray.GetSize() == 0) {
-                    this->ClearEmptySection(place);
+                    ClearEmptySection(place);
                 } else {
-                    this->LinkLatterSection(leftplace);
+                    LinkLatterSection(leftplace);
                 }
             } else {
                 pSection->ClearWord(place);
@@ -1520,7 +1520,7 @@ CPVT_WordPlace CPDF_VariableText::ClearLeftWord(const CPVT_WordPlace & place)
 CPVT_WordPlace CPDF_VariableText::ClearRightWord(const CPVT_WordPlace & place)
 {
     if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) {
-        CPVT_WordPlace rightplace = AjustLineHeader(this->GetNextWordPlace(place), FALSE);
+        CPVT_WordPlace rightplace = AjustLineHeader(GetNextWordPlace(place), FALSE);
         if (rightplace != place) {
             if(rightplace.nSecIndex != place.nSecIndex) {
                 LinkLatterSection(place);
index b66c2ed..d555daa 100644 (file)
@@ -36,10 +36,10 @@ public:
     CPVT_Size() : x(0.0f), y(0.0f)
     {
     }
-    CPVT_Size(FX_FLOAT x, FX_FLOAT y)
+    CPVT_Size(FX_FLOAT other_x, FX_FLOAT other_y)
     {
-        this->x = x;
-        this->y = y;
+        x = other_x;
+        y = other_y;
     }
     FX_FLOAT x, y;
 };
@@ -50,20 +50,22 @@ public:
     {
         left = top = right = bottom = 0.0f;
     }
-    CPVT_FloatRect(FX_FLOAT left, FX_FLOAT top,
-                   FX_FLOAT right, FX_FLOAT bottom)
+    CPVT_FloatRect(FX_FLOAT other_left,
+                   FX_FLOAT other_top,
+                   FX_FLOAT other_right,
+                   FX_FLOAT other_bottom)
     {
-        this->left = left;
-        this->top = top;
-        this->right = right;
-        this->bottom = bottom;
+        left = other_left;
+        top = other_top;
+        right = other_right;
+        bottom = other_bottom;
     }
     CPVT_FloatRect(const CPDF_Rect & rect)
     {
-        this->left = rect.left;
-        this->top = rect.top;
-        this->right = rect.right;
-        this->bottom = rect.bottom;
+        left = rect.left;
+        top = rect.top;
+        right = rect.right;
+        bottom = rect.bottom;
     }
     void Default()
     {
@@ -71,11 +73,9 @@ public:
     }
     FX_FLOAT Height() const
     {
-        if(this->top > this->bottom) {
-            return this->top - this->bottom;
-        } else {
-            return this->bottom - this->top;
-        }
+        if (top > bottom)
+            return top - bottom;
+        return bottom - top;
     }
 };
 struct CPVT_SectionInfo {
@@ -100,8 +100,8 @@ struct CPVT_SectionInfo {
         if (this == &other) {
             return;
         }
-        this->rcSection = other.rcSection;
-        this->nTotalLine = other.nTotalLine;
+        rcSection = other.rcSection;
+        nTotalLine = other.nTotalLine;
         if (other.pSecProps) {
             if (pSecProps) {
                 *pSecProps = *other.pSecProps;
@@ -162,9 +162,9 @@ struct CPVT_WordInfo  {
         if (this == &word) {
             return;
         }
-        this->Word = word.Word;
-        this->nCharset = word.nCharset;
-        this->nFontIndex = word.nFontIndex;
+        Word = word.Word;
+        nCharset = word.nCharset;
+        nFontIndex = word.nFontIndex;
         if (word.pWordProps) {
             if (pWordProps) {
                 *pWordProps = *word.pWordProps;
index a9e8169..d7e8263 100644 (file)
@@ -1279,7 +1279,7 @@ void CPDF_TextPage::CloseTempLine()
     if(nR2L > 0 && nR2L >= nL2R) {
         bR2L = TRUE;
     }
-    if(this->m_parserflag == FPDFTEXT_RLTB || bR2L) {
+    if (m_parserflag == FPDFTEXT_RLTB || bR2L) {
         int count = order.GetSize();
         for(int i = count - 1; i > 0; i -= 3) {
             int ret = order.GetAt(i);
index a397a45..7dd91b3 100644 (file)
@@ -649,13 +649,6 @@ FX_BOOL CJPX_Decoder::Init(const unsigned char* src_data, int src_size)
         image = NULL;
         return FALSE;
     }
-/*
-    if(this->m_useColorSpace) {
-        image->useColorSpace = 1;
-    } else {
-        image->useColorSpace = 0;
-    }
-*/
     if (!parameters.nb_tile_to_decode) {
         if (!opj_set_decode_area(l_codec, image, parameters.DA_x0,
                                     parameters.DA_y0, parameters.DA_x1, parameters.DA_y1)) {
@@ -685,7 +678,6 @@ FX_BOOL CJPX_Decoder::Init(const unsigned char* src_data, int src_size)
     if(image->color_space == OPJ_CLRSPC_SYCC) {
         color_sycc_to_rgb(image);
     }
-    //if(image->icc_profile_buf && !image->useColorSpace) {
     if(image->icc_profile_buf) {
         FX_Free(image->icc_profile_buf);
         image->icc_profile_buf = NULL;
index 1c75927..f58b7f3 100644 (file)
@@ -1621,7 +1621,7 @@ FX_BOOL CJBig2_Context::parseGenericRefinementRegion(CJBig2_Segment *pSegment)
     pSeg = NULL;
     if(pSegment->m_nReferred_to_segment_count > 0) {
         for(i = 0; i < pSegment->m_nReferred_to_segment_count; i++) {
-            pSeg = this->findSegmentByNumber(pSegment->m_pReferred_to_segment_numbers[0]);
+            pSeg = findSegmentByNumber(pSegment->m_pReferred_to_segment_numbers[0]);
             if(pSeg == NULL) {
                 m_pModule->JBig2_Error("generic refinement region segment : can't find refered to segments");
                 nRet = JBIG2_ERROR_FETAL;
index 496b144..652f62c 100644 (file)
@@ -249,23 +249,28 @@ CFX_FloatRect CFX_FloatRect::GetBBox(const CFX_FloatPoint* pPoints, int nPoints)
     }
     return CFX_FloatRect(min_x, min_y, max_x, max_y);
 }
-void CFX_Matrix::Set(FX_FLOAT a, FX_FLOAT b, FX_FLOAT c, FX_FLOAT d, FX_FLOAT e, FX_FLOAT f)
-{
-    this->a = a;
-    this->b = b;
-    this->c = c;
-    this->d = d;
-    this->e = e;
-    this->f = f;
+void CFX_Matrix::Set(FX_FLOAT other_a,
+                     FX_FLOAT other_b,
+                     FX_FLOAT other_c,
+                     FX_FLOAT other_d,
+                     FX_FLOAT other_e,
+                     FX_FLOAT other_f)
+{
+    a = other_a;
+    b = other_b;
+    c = other_c;
+    d = other_d;
+    e = other_e;
+    f = other_f;
 }
 void CFX_Matrix::Set(const FX_FLOAT n[6])
 {
-    this->a = n[0];
-    this->b = n[1];
-    this->c = n[2];
-    this->d = n[3];
-    this->e = n[4];
-    this->f = n[5];
+    a = n[0];
+    b = n[1];
+    c = n[2];
+    d = n[3];
+    e = n[4];
+    f = n[5];
 }
 void CFX_Matrix::SetReverse(const CFX_Matrix &m)
 {
index 5087b62..e87092f 100644 (file)
@@ -22,7 +22,7 @@
                                return;
                        unsigned aa = antialias[0];
                        if (aa)
-                               (this->*composite_span)(m_pDestScan, m_pOriScan, 0, x, width, y, aa, m_ClipBox.top, m_ClipBox.left, m_ClipBox.right, m_pClipScan, m_pDestExtraAlphaScan);
+                               (*composite_span)(m_pDestScan, m_pOriScan, 0, x, width, y, aa, m_ClipBox.top, m_ClipBox.left, m_ClipBox.right, m_pClipScan, m_pDestExtraAlphaScan);
                        runs += width;
                        antialias += width;
                        x += width;
        {
                FXSYS_assert(m_Alpha && width);
                if (y < m_ClipBox.top || y >= m_ClipBox.bottom) return;
-               (this->*composite_span)(m_pDestScan, m_pOriScan, 0, x, width, y, 255, m_ClipBox.top, m_ClipBox.left, m_ClipBox.right, m_pClipScan, m_pDestExtraAlphaScan);
+               (*composite_span)(m_pDestScan, m_pOriScan, 0, x, width, y, 255, m_ClipBox.top, m_ClipBox.left, m_ClipBox.right, m_pClipScan, m_pDestExtraAlphaScan);
        }
 
        void CFX_SkiaRenderer::blitV(int x, int y, int height, SkAlpha alpha)
        {
                FXSYS_assert(m_Alpha && alpha);
                if (alpha == 255) {
-                       this->blitRect(x, y, 1, height);
+                       blitRect(x, y, 1, height);
                } else {
                        int16_t runs[2];
                        runs[0] = 1;
@@ -48,7 +48,7 @@
                        while (--height >= 0) {
                                if (y >= m_ClipBox.bottom)
                                        return;
-                               this->blitAntiH(x, y ++, &alpha, runs);
+                               blitAntiH(x, y ++, &alpha, runs);
                        }
                }
        }
        {
                FXSYS_assert(alpha);
                if (alpha == 255) {
-                       this->blitRect(x, y, 1, height);
+                       blitRect(x, y, 1, height);
                } else {
                        int16_t runs[2];
                        runs[0] = 1;
                        while (--height >= 0) {
                                if (y >= m_dstHeight)
                                        return;
-                               this->blitAntiH(x, y ++, &alpha, runs);
+                               blitAntiH(x, y ++, &alpha, runs);
                        }
                }
        }
index 3893144..785b0e2 100644 (file)
@@ -450,7 +450,7 @@ LayoutType CPDF_LayoutElement::GetType()
         return LayoutUnknown;
     }
     CFX_ByteString name = m_pTaggedElement->GetType();
-    return this->ConvertLayoutType(name);
+    return ConvertLayoutType(name);
 }
 int    CPDF_LayoutElement::CountAttrValues(LayoutAttr attr_type)
 {
index b7048b6..3335eed 100644 (file)
@@ -226,7 +226,7 @@ void CPDF_ReflowedPage::FocusGetData(const CFX_AffineMatrix matrix, int32_t x, i
         if(FXSYS_fabs(tempdy - dy) < 1) {
             continue;
         }
-        CFX_FloatRect rect (0, pData->m_PosY + pData->m_Height, this->m_PageWidth, pData->m_PosY);
+        CFX_FloatRect rect (0, pData->m_PosY + pData->m_Height, m_PageWidth, pData->m_PosY);
         if(rect.Contains(x1, y1)) {
             pos = i;
             dx = 0;
@@ -321,7 +321,7 @@ void CPDF_ProgressiveReflowPageParser::Continue(IFX_Pause* pPause)
 }
 void CPDF_ProgressiveReflowPageParser::Clear()
 {
-    this->Init();
+    Init();
     return;
 }
 FX_BOOL IPDF_ProgressiveReflowPageParser::IsTaggedPage(CPDF_PageObjects*pPage)