summaryrefslogtreecommitdiff
path: root/core/src/fpdftext
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-12-10 14:49:23 -0800
committerTom Sepez <tsepez@chromium.org>2015-12-10 14:49:23 -0800
commitf32c969bce6743fca1e7ff796b54a1692d26d7f0 (patch)
treef35f0ae0c8505394b2f195f4ea849249668af170 /core/src/fpdftext
parent94edf0c37d1ee6a03697375b9e227071ff2ee69d (diff)
downloadpdfium-f32c969bce6743fca1e7ff796b54a1692d26d7f0.tar.xz
Remove CFX_AffineMatrix/CPDF_Matrix
These are synonyms for CFX_Matrix. Nothing but sed and manual deletion of 2 #defines in fpdf_parser.h and fx_coordinates.h R=thestig@chromium.org Review URL: https://codereview.chromium.org/1513363002 .
Diffstat (limited to 'core/src/fpdftext')
-rw-r--r--core/src/fpdftext/fpdf_text.cpp4
-rw-r--r--core/src/fpdftext/fpdf_text_int.cpp36
-rw-r--r--core/src/fpdftext/fpdf_text_search.cpp4
-rw-r--r--core/src/fpdftext/text_int.h14
4 files changed, 29 insertions, 29 deletions
diff --git a/core/src/fpdftext/fpdf_text.cpp b/core/src/fpdftext/fpdf_text.cpp
index e70d0e0e4b..9a967e62fd 100644
--- a/core/src/fpdftext/fpdf_text.cpp
+++ b/core/src/fpdftext/fpdf_text.cpp
@@ -69,7 +69,7 @@ void CTextPage::ProcessObject(CPDF_PageObject* pObject) {
}
if (pText->m_TextState.GetBaselineAngle() != 0) {
int cc = 0;
- CFX_AffineMatrix matrix;
+ CFX_Matrix matrix;
pText->GetTextMatrix(&matrix);
for (int i = 0; i < pText->m_nChars; i++) {
FX_DWORD charcode = pText->m_nChars == 1
@@ -707,7 +707,7 @@ static void CheckRotate(CPDF_Page& page, CFX_FloatRect& page_bbox) {
if (total_count == 0) {
return;
}
- CFX_AffineMatrix matrix;
+ CFX_Matrix matrix;
if (rotated_count[0] > total_count * 2 / 3) {
matrix.Set(0, -1, 1, 0, 0, page.GetPageHeight());
} else if (rotated_count[1] > total_count * 2 / 3) {
diff --git a/core/src/fpdftext/fpdf_text_int.cpp b/core/src/fpdftext/fpdf_text_int.cpp
index ee768af3bc..314cc0e062 100644
--- a/core/src/fpdftext/fpdf_text_int.cpp
+++ b/core/src/fpdftext/fpdf_text_int.cpp
@@ -51,7 +51,7 @@ FX_FLOAT _NormalizeThreshold(FX_FLOAT threshold) {
}
FX_FLOAT _CalculateBaseSpace(const CPDF_TextObject* pTextObj,
- const CFX_AffineMatrix& matrix) {
+ const CFX_Matrix& matrix) {
FX_FLOAT baseSpace = 0.0;
const int nItems = pTextObj->CountItems();
if (pTextObj->m_TextState.GetObject()->m_CharSpace && nItems >= 3) {
@@ -265,7 +265,7 @@ void CPDF_TextPage::GetRectArray(int start,
}
if (flagNewRect) {
FX_FLOAT orgX = info_curchar.m_OriginX, orgY = info_curchar.m_OriginY;
- CFX_AffineMatrix matrix, matrix_reverse;
+ CFX_Matrix matrix, matrix_reverse;
info_curchar.m_pTextObj->GetTextMatrix(&matrix);
matrix.Concat(info_curchar.m_Matrix);
matrix_reverse.SetReverse(matrix);
@@ -908,11 +908,11 @@ void CPDF_TextPage::ProcessObject() {
pPageObj = m_pPage->GetNextObject(pos);
if (pPageObj) {
if (pPageObj->m_Type == PDFPAGE_TEXT) {
- CFX_AffineMatrix matrix;
+ CFX_Matrix matrix;
ProcessTextObject((CPDF_TextObject*)pPageObj, matrix, pos);
nCount++;
} else if (pPageObj->m_Type == PDFPAGE_FORM) {
- CFX_AffineMatrix formMatrix(1, 0, 0, 1, 0, 0);
+ CFX_Matrix formMatrix(1, 0, 0, 1, 0, 0);
ProcessFormObject((CPDF_FormObject*)pPageObj, formMatrix);
}
}
@@ -926,7 +926,7 @@ void CPDF_TextPage::ProcessObject() {
CloseTempLine();
}
void CPDF_TextPage::ProcessFormObject(CPDF_FormObject* pFormObj,
- const CFX_AffineMatrix& formMatrix) {
+ const CFX_Matrix& formMatrix) {
CPDF_PageObject* pPageObj = NULL;
FX_POSITION pos;
if (!pFormObj) {
@@ -936,7 +936,7 @@ void CPDF_TextPage::ProcessFormObject(CPDF_FormObject* pFormObj,
if (!pos) {
return;
}
- CFX_AffineMatrix curFormMatrix;
+ CFX_Matrix curFormMatrix;
curFormMatrix.Copy(pFormObj->m_FormMatrix);
curFormMatrix.Concat(formMatrix);
while (pos) {
@@ -1187,7 +1187,7 @@ void CPDF_TextPage::CloseTempLine() {
m_TempTextBuf.Delete(0, m_TempTextBuf.GetLength());
}
void CPDF_TextPage::ProcessTextObject(CPDF_TextObject* pTextObj,
- const CFX_AffineMatrix& formMatrix,
+ const CFX_Matrix& formMatrix,
FX_POSITION ObjPos) {
CFX_FloatRect re(pTextObj->m_Left, pTextObj->m_Bottom, pTextObj->m_Right,
pTextObj->m_Top);
@@ -1212,7 +1212,7 @@ void CPDF_TextPage::ProcessTextObject(CPDF_TextObject* pTextObj,
FX_FLOAT prev_width =
GetCharWidth(item.m_CharCode, prev_Obj.m_pTextObj->GetFont()) *
prev_Obj.m_pTextObj->GetFontSize() / 1000;
- CFX_AffineMatrix prev_matrix;
+ CFX_Matrix prev_matrix;
prev_Obj.m_pTextObj->GetTextMatrix(&prev_matrix);
prev_width = FXSYS_fabs(prev_width);
prev_matrix.Concat(prev_Obj.m_formMatrix);
@@ -1221,7 +1221,7 @@ void CPDF_TextPage::ProcessTextObject(CPDF_TextObject* pTextObj,
FX_FLOAT this_width = GetCharWidth(item.m_CharCode, pTextObj->GetFont()) *
pTextObj->GetFontSize() / 1000;
this_width = FXSYS_fabs(this_width);
- CFX_AffineMatrix this_matrix;
+ CFX_Matrix this_matrix;
pTextObj->GetTextMatrix(&this_matrix);
this_width = FXSYS_fabs(this_width);
this_matrix.Concat(formMatrix);
@@ -1247,7 +1247,7 @@ void CPDF_TextPage::ProcessTextObject(CPDF_TextObject* pTextObj,
if (m_ParseOptions.m_bNormalizeObjs) {
for (i = count - 1; i >= 0; i--) {
PDFTEXT_Obj prev_Obj = m_LineObj.GetAt(i);
- CFX_AffineMatrix prev_matrix;
+ CFX_Matrix prev_matrix;
prev_Obj.m_pTextObj->GetTextMatrix(&prev_matrix);
FX_FLOAT Prev_x = prev_Obj.m_pTextObj->GetPosX(),
Prev_y = prev_Obj.m_pTextObj->GetPosY();
@@ -1369,8 +1369,8 @@ void CPDF_TextPage::ProcessMarkedContent(PDFTEXT_Obj Obj) {
return;
}
CPDF_Font* pFont = pTextObj->GetFont();
- CFX_AffineMatrix formMatrix = Obj.m_formMatrix;
- CFX_AffineMatrix matrix;
+ CFX_Matrix formMatrix = Obj.m_formMatrix;
+ CFX_Matrix matrix;
pTextObj->GetTextMatrix(&matrix);
matrix.Concat(formMatrix);
FX_FLOAT fPosX = pTextObj->GetPosX();
@@ -1482,9 +1482,9 @@ void CPDF_TextPage::ProcessTextObject(PDFTEXT_Obj Obj) {
if (FXSYS_fabs(pTextObj->m_Right - pTextObj->m_Left) < 0.01f) {
return;
}
- CFX_AffineMatrix formMatrix = Obj.m_formMatrix;
+ CFX_Matrix formMatrix = Obj.m_formMatrix;
CPDF_Font* pFont = pTextObj->GetFont();
- CFX_AffineMatrix matrix;
+ CFX_Matrix matrix;
pTextObj->GetTextMatrix(&matrix);
matrix.Concat(formMatrix);
int32_t bPreMKC = PreMarkedContent(Obj);
@@ -1814,7 +1814,7 @@ FX_BOOL CPDF_TextPage::IsHyphen(FX_WCHAR curChar) {
return FALSE;
}
int CPDF_TextPage::ProcessInsertObject(const CPDF_TextObject* pObj,
- const CFX_AffineMatrix& formMatrix) {
+ const CFX_Matrix& formMatrix) {
FindPreviousTextObject();
FX_BOOL bNewline = FALSE;
int WritingMode = GetTextObjectWritingMode(pObj);
@@ -1873,7 +1873,7 @@ int CPDF_TextPage::ProcessInsertObject(const CPDF_TextObject* pObj,
this_width = FXSYS_fabs(this_width);
FX_FLOAT threshold =
last_width > this_width ? last_width / 4 : this_width / 4;
- CFX_AffineMatrix prev_matrix, prev_reverse;
+ CFX_Matrix prev_matrix, prev_reverse;
m_pPreTextObj->GetTextMatrix(&prev_matrix);
prev_matrix.Concat(m_perMatrix);
prev_reverse.SetReverse(prev_matrix);
@@ -1898,7 +1898,7 @@ int CPDF_TextPage::ProcessInsertObject(const CPDF_TextObject* pObj,
if (nItem > 1) {
CPDF_TextObjectItem tempItem;
m_pPreTextObj->GetItemInfo(0, &tempItem);
- CFX_AffineMatrix m;
+ CFX_Matrix m;
m_pPreTextObj->GetTextMatrix(&m);
if (PrevItem.m_OriginX > tempItem.m_OriginX &&
m_DisplayMatrix.a > 0.9 && m_DisplayMatrix.b < 0.1 &&
@@ -1933,7 +1933,7 @@ int CPDF_TextPage::ProcessInsertObject(const CPDF_TextObject* pObj,
CFX_WideString PrevStr =
m_pPreTextObj->GetFont()->UnicodeFromCharCode(PrevItem.m_CharCode);
FX_WCHAR preChar = PrevStr.GetAt(PrevStr.GetLength() - 1);
- CFX_AffineMatrix matrix;
+ CFX_Matrix matrix;
pObj->GetTextMatrix(&matrix);
matrix.Concat(formMatrix);
threshold = (FX_FLOAT)(nLastWidth > nThisWidth ? nLastWidth : nThisWidth);
diff --git a/core/src/fpdftext/fpdf_text_search.cpp b/core/src/fpdftext/fpdf_text_search.cpp
index 0acea11cf2..43486c7ab8 100644
--- a/core/src/fpdftext/fpdf_text_search.cpp
+++ b/core/src/fpdftext/fpdf_text_search.cpp
@@ -113,7 +113,7 @@ int FPDFText_ProcessInterObj(const CPDF_TextObject* pPrevObj,
this_width = FXSYS_fabs(this_width);
FX_FLOAT threshold =
last_width > this_width ? last_width / 4 : this_width / 4;
- CFX_AffineMatrix prev_matrix, prev_reverse;
+ CFX_Matrix prev_matrix, prev_reverse;
pPrevObj->GetTextMatrix(&prev_matrix);
prev_reverse.SetReverse(prev_matrix);
FX_FLOAT x = pObj->GetPosX(), y = pObj->GetPosY();
@@ -151,7 +151,7 @@ int FPDFText_ProcessInterObj(const CPDF_TextObject* pPrevObj,
FX_BOOL CPDF_TextStream::ProcessObject(const CPDF_TextObject* pObj,
FX_BOOL bFirstLine) {
CPDF_Font* pFont = pObj->GetFont();
- CFX_AffineMatrix matrix;
+ CFX_Matrix matrix;
pObj->GetTextMatrix(&matrix);
int item_index = 0;
if (m_pLastObj) {
diff --git a/core/src/fpdftext/text_int.h b/core/src/fpdftext/text_int.h
index a7f3aaec7d..a8f4f37e98 100644
--- a/core/src/fpdftext/text_int.h
+++ b/core/src/fpdftext/text_int.h
@@ -34,7 +34,7 @@ typedef struct _PAGECHAR_INFO {
int32_t m_Flag;
CFX_FloatRect m_CharBox;
CPDF_TextObject* m_pTextObj;
- CFX_AffineMatrix m_Matrix;
+ CFX_Matrix m_Matrix;
int m_Index;
} PAGECHAR_INFO;
typedef CFX_SegmentedArray<PAGECHAR_INFO> PAGECHAR_InfoArray;
@@ -45,7 +45,7 @@ typedef struct {
typedef CFX_ArrayTemplate<FPDF_SEGMENT> SEGMENT_Array;
typedef struct {
CPDF_TextObject* m_pTextObj;
- CFX_AffineMatrix m_formMatrix;
+ CFX_Matrix m_formMatrix;
} PDFTEXT_Obj;
typedef CFX_ArrayTemplate<PDFTEXT_Obj> LINEOBJ;
@@ -103,13 +103,13 @@ class CPDF_TextPage : public IPDF_TextPage {
FX_BOOL GetBaselineRotate(int start, int end, int& Rotate);
void ProcessObject();
void ProcessFormObject(CPDF_FormObject* pFormObj,
- const CFX_AffineMatrix& formMatrix);
+ const CFX_Matrix& formMatrix);
void ProcessTextObject(PDFTEXT_Obj pObj);
void ProcessTextObject(CPDF_TextObject* pTextObj,
- const CFX_AffineMatrix& formMatrix,
+ const CFX_Matrix& formMatrix,
FX_POSITION ObjPos);
int ProcessInsertObject(const CPDF_TextObject* pObj,
- const CFX_AffineMatrix& formMatrix);
+ const CFX_Matrix& formMatrix);
FX_BOOL GenerateCharInfo(FX_WCHAR unicode, PAGECHAR_INFO& info);
FX_BOOL IsSameAsPreTextObject(CPDF_TextObject* pTextObj, FX_POSITION ObjPos);
FX_BOOL IsSameTextObject(CPDF_TextObject* pTextObj1,
@@ -139,9 +139,9 @@ class CPDF_TextPage : public IPDF_TextPage {
CFX_WideTextBuf m_TempTextBuf;
const int m_parserflag;
CPDF_TextObject* m_pPreTextObj;
- CFX_AffineMatrix m_perMatrix;
+ CFX_Matrix m_perMatrix;
bool m_bIsParsed;
- CFX_AffineMatrix m_DisplayMatrix;
+ CFX_Matrix m_DisplayMatrix;
SEGMENT_Array m_Segment;
CFX_RectArray m_SelRects;
LINEOBJ m_LineObj;