Remove unused parameters
Remove unused params from CPDF_VariableText methods.
Change-Id: Ia02f99ea84f0c29e9f674a2cb837b422de390d33
Reviewed-on: https://pdfium-review.googlesource.com/15670
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
diff --git a/core/fpdfdoc/cpdf_variabletext.cpp b/core/fpdfdoc/cpdf_variabletext.cpp
index d3de612..753e7ea 100644
--- a/core/fpdfdoc/cpdf_variabletext.cpp
+++ b/core/fpdfdoc/cpdf_variabletext.cpp
@@ -191,7 +191,7 @@
if (pWord->pWordProps)
word.WordProps = *pWord->pWordProps;
word.nFontIndex = m_pVT->GetWordFontIndex(*pWord);
- word.fFontSize = m_pVT->GetWordFontSize(*pWord);
+ word.fFontSize = m_pVT->GetWordFontSize();
return true;
}
@@ -302,8 +302,7 @@
CPVT_WordPlace CPDF_VariableText::InsertWord(const CPVT_WordPlace& place,
uint16_t word,
- int32_t charset,
- const CPVT_WordProps* pWordProps) {
+ int32_t charset) {
int32_t nTotalWords = GetTotalWords();
if (m_nLimitChar > 0 && nTotalWords >= m_nLimitChar)
return place;
@@ -318,10 +317,7 @@
return AddWord(newplace, CPVT_WordInfo(word, charset, nFontIndex, nullptr));
}
-CPVT_WordPlace CPDF_VariableText::InsertSection(
- const CPVT_WordPlace& place,
- const CPVT_SecProps* pSecProps,
- const CPVT_WordProps* pWordProps) {
+CPVT_WordPlace CPDF_VariableText::InsertSection(const CPVT_WordPlace& place) {
int32_t nTotalWords = GetTotalWords();
if (m_nLimitChar > 0 && nTotalWords >= m_nLimitChar)
return place;
@@ -365,7 +361,7 @@
if (swText[i + 1] == 0x0A)
i += 1;
- wp = InsertSection(wp, nullptr, nullptr);
+ wp = InsertSection(wp);
}
break;
case 0x0A:
@@ -373,13 +369,13 @@
if (swText[i + 1] == 0x0D)
i += 1;
- wp = InsertSection(wp, nullptr, nullptr);
+ wp = InsertSection(wp);
}
break;
case 0x09:
word = 0x20;
default:
- wp = InsertWord(wp, word, FX_CHARSET_Default, nullptr);
+ wp = InsertWord(wp, word, FX_CHARSET_Default);
break;
}
if (wp == oldwp)
@@ -447,7 +443,7 @@
case 0x09:
word = 0x20;
default:
- wp = InsertWord(wp, word, FX_CHARSET_Default, nullptr);
+ wp = InsertWord(wp, word, FX_CHARSET_Default);
break;
}
nCharCount++;
@@ -780,7 +776,7 @@
return m_rcPlate;
}
-float CPDF_VariableText::GetWordFontSize(const CPVT_WordInfo& WordInfo) {
+float CPDF_VariableText::GetWordFontSize() {
return GetFontSize();
}
@@ -803,15 +799,15 @@
float CPDF_VariableText::GetWordWidth(const CPVT_WordInfo& WordInfo) {
return GetWordWidth(GetWordFontIndex(WordInfo), WordInfo.Word, GetSubWord(),
- GetCharSpace(WordInfo), GetHorzScale(WordInfo),
- GetWordFontSize(WordInfo), WordInfo.fWordTail);
+ GetCharSpace(), GetHorzScale(), GetWordFontSize(),
+ WordInfo.fWordTail);
}
-float CPDF_VariableText::GetLineAscent(const CPVT_SectionInfo& SecInfo) {
+float CPDF_VariableText::GetLineAscent() {
return GetFontAscent(GetDefaultFontIndex(), GetFontSize());
}
-float CPDF_VariableText::GetLineDescent(const CPVT_SectionInfo& SecInfo) {
+float CPDF_VariableText::GetLineDescent() {
return GetFontDescent(GetDefaultFontIndex(), GetFontSize());
}
@@ -834,33 +830,25 @@
}
float CPDF_VariableText::GetWordAscent(const CPVT_WordInfo& WordInfo) {
- return GetFontAscent(GetWordFontIndex(WordInfo), GetWordFontSize(WordInfo));
+ return GetFontAscent(GetWordFontIndex(WordInfo), GetWordFontSize());
}
float CPDF_VariableText::GetWordDescent(const CPVT_WordInfo& WordInfo) {
- return GetFontDescent(GetWordFontIndex(WordInfo), GetWordFontSize(WordInfo));
+ return GetFontDescent(GetWordFontIndex(WordInfo), GetWordFontSize());
}
-float CPDF_VariableText::GetLineLeading(const CPVT_SectionInfo& SecInfo) {
+float CPDF_VariableText::GetLineLeading() {
return m_fLineLeading;
}
-float CPDF_VariableText::GetLineIndent(const CPVT_SectionInfo& SecInfo) {
+float CPDF_VariableText::GetLineIndent() {
return 0.0f;
}
-int32_t CPDF_VariableText::GetAlignment(const CPVT_SectionInfo& SecInfo) {
+int32_t CPDF_VariableText::GetAlignment() {
return m_nAlignment;
}
-float CPDF_VariableText::GetCharSpace(const CPVT_WordInfo& WordInfo) {
- return m_fCharSpace;
-}
-
-int32_t CPDF_VariableText::GetHorzScale(const CPVT_WordInfo& WordInfo) {
- return m_nHorzScale;
-}
-
void CPDF_VariableText::ClearSectionRightWords(const CPVT_WordPlace& place) {
CPVT_WordPlace wordplace = AdjustLineHeader(place, true);
if (!pdfium::IndexInBounds(m_SectionArray, place.nSecIndex))
diff --git a/core/fpdfdoc/cpdf_variabletext.h b/core/fpdfdoc/cpdf_variabletext.h
index 2319df7..9daf56e 100644
--- a/core/fpdfdoc/cpdf_variabletext.h
+++ b/core/fpdfdoc/cpdf_variabletext.h
@@ -109,11 +109,8 @@
void SetText(const WideString& text);
CPVT_WordPlace InsertWord(const CPVT_WordPlace& place,
uint16_t word,
- int32_t charset,
- const CPVT_WordProps* pWordProps);
- CPVT_WordPlace InsertSection(const CPVT_WordPlace& place,
- const CPVT_SecProps* pSecProps,
- const CPVT_WordProps* pWordProps);
+ int32_t charset);
+ CPVT_WordPlace InsertSection(const CPVT_WordPlace& place);
CPVT_WordPlace InsertText(const CPVT_WordPlace& place, const wchar_t* text);
CPVT_WordPlace DeleteWords(const CPVT_WordRange& PlaceRange);
CPVT_WordPlace DeleteWord(const CPVT_WordPlace& place);
@@ -165,8 +162,8 @@
float GetFontAscent(int32_t nFontIndex, float fFontSize);
float GetFontDescent(int32_t nFontIndex, float fFontSize);
int32_t GetDefaultFontIndex();
- float GetLineLeading(const CPVT_SectionInfo& SecInfo);
- int32_t GetAlignment(const CPVT_SectionInfo& SecInfo);
+ float GetLineLeading();
+ int32_t GetAlignment();
float GetWordWidth(const CPVT_WordInfo& WordInfo);
float GetWordWidth(int32_t nFontIndex,
uint16_t Word,
@@ -179,9 +176,9 @@
float GetWordDescent(const CPVT_WordInfo& WordInfo);
float GetWordAscent(const CPVT_WordInfo& WordInfo, float fFontSize);
float GetWordDescent(const CPVT_WordInfo& WordInfo, float fFontSize);
- float GetLineAscent(const CPVT_SectionInfo& SecInfo);
- float GetLineDescent(const CPVT_SectionInfo& SecInfo);
- float GetLineIndent(const CPVT_SectionInfo& SecInfo);
+ float GetLineAscent();
+ float GetLineDescent();
+ float GetLineIndent();
private:
int32_t GetCharWidth(int32_t nFontIndex, uint16_t Word, uint16_t SubWord);
@@ -200,10 +197,8 @@
bool SetWordInfo(const CPVT_WordPlace& place, const CPVT_WordInfo& wordinfo);
bool GetLineInfo(const CPVT_WordPlace& place, CPVT_LineInfo& lineinfo);
bool GetSectionInfo(const CPVT_WordPlace& place, CPVT_SectionInfo& secinfo);
- float GetWordFontSize(const CPVT_WordInfo& WordInfo);
+ float GetWordFontSize();
int32_t GetWordFontIndex(const CPVT_WordInfo& WordInfo);
- float GetCharSpace(const CPVT_WordInfo& WordInfo);
- int32_t GetHorzScale(const CPVT_WordInfo& WordInfo);
void ClearSectionRightWords(const CPVT_WordPlace& place);
diff --git a/core/fpdfdoc/csection.cpp b/core/fpdfdoc/csection.cpp
index 0c8c025..1f2bef4 100644
--- a/core/fpdfdoc/csection.cpp
+++ b/core/fpdfdoc/csection.cpp
@@ -133,7 +133,7 @@
while (nLeft <= nRight) {
CLine* pLine = m_LineArray[nMid].get();
float fTop = pLine->m_LineInfo.fLineY - pLine->m_LineInfo.fLineAscent -
- m_pVT->GetLineLeading(m_SecInfo);
+ m_pVT->GetLineLeading();
float fBottom = pLine->m_LineInfo.fLineY - pLine->m_LineInfo.fLineDescent;
if (IsFloatBigger(point.y, fTop))
bUp = false;
diff --git a/core/fpdfdoc/ctypeset.cpp b/core/fpdfdoc/ctypeset.cpp
index 920ac03..856377e 100644
--- a/core/fpdfdoc/ctypeset.cpp
+++ b/core/fpdfdoc/ctypeset.cpp
@@ -191,10 +191,10 @@
float fLineDescent =
m_pVT->GetFontDescent(m_pVT->GetDefaultFontIndex(), m_pVT->GetFontSize());
float x = 0.0f;
- float y = m_pVT->GetLineLeading(m_pSection->m_SecInfo) + fLineAscent;
+ float y = m_pVT->GetLineLeading() + fLineAscent;
int32_t nStart = 0;
CLine* pLine = m_pSection->m_LineArray.front().get();
- switch (m_pVT->GetAlignment(m_pSection->m_SecInfo)) {
+ switch (m_pVT->GetAlignment()) {
case 0:
pLine->m_LineInfo.fLineX = fNodeWidth * VARIABLETEXT_HALF;
break;
@@ -289,9 +289,8 @@
int32_t nCharIndex = 0;
CPVT_LineInfo line;
float fWordWidth = 0;
- float fTypesetWidth = std::max(
- m_pVT->GetPlateWidth() - m_pVT->GetLineIndent(m_pSection->m_SecInfo),
- 0.0f);
+ float fTypesetWidth =
+ std::max(m_pVT->GetPlateWidth() - m_pVT->GetLineIndent(), 0.0f);
int32_t nTotalWords =
pdfium::CollectionSize<int32_t>(m_pSection->m_WordArray);
bool bOpened = false;
@@ -366,7 +365,7 @@
line.fLineDescent = fLineDescent;
m_pSection->AddLine(line);
}
- fMaxY += (fLineAscent + m_pVT->GetLineLeading(m_pSection->m_SecInfo));
+ fMaxY += (fLineAscent + m_pVT->GetLineLeading());
fMaxY -= fLineDescent;
fMaxX = std::max(fLineWidth, fMaxX);
nLineHead = i;
@@ -392,14 +391,14 @@
line.fLineDescent = fLineDescent;
m_pSection->AddLine(line);
}
- fMaxY += (fLineAscent + m_pVT->GetLineLeading(m_pSection->m_SecInfo));
+ fMaxY += (fLineAscent + m_pVT->GetLineLeading());
fMaxY -= fLineDescent;
fMaxX = std::max(fLineWidth, fMaxX);
}
} else {
if (bTypeset) {
- fLineAscent = m_pVT->GetLineAscent(m_pSection->m_SecInfo);
- fLineDescent = m_pVT->GetLineDescent(m_pSection->m_SecInfo);
+ fLineAscent = m_pVT->GetLineAscent();
+ fLineDescent = m_pVT->GetLineDescent();
} else {
fLineAscent =
m_pVT->GetFontAscent(m_pVT->GetDefaultFontIndex(), fFontSize);
@@ -415,8 +414,7 @@
line.fLineDescent = fLineDescent;
m_pSection->AddLine(line);
}
- fMaxY += m_pVT->GetLineLeading(m_pSection->m_SecInfo) + fLineAscent -
- fLineDescent;
+ fMaxY += m_pVT->GetLineLeading() + fLineAscent - fLineDescent;
}
m_rcRet = CPVT_FloatRect(0, 0, fMaxX, fMaxY);
}
@@ -426,9 +424,9 @@
ASSERT(m_pSection);
float fMinX = 0.0f, fMinY = 0.0f, fMaxX = 0.0f, fMaxY = 0.0f;
float fPosX = 0.0f, fPosY = 0.0f;
- float fLineIndent = m_pVT->GetLineIndent(m_pSection->m_SecInfo);
+ float fLineIndent = m_pVT->GetLineIndent();
float fTypesetWidth = std::max(m_pVT->GetPlateWidth() - fLineIndent, 0.0f);
- switch (m_pVT->GetAlignment(m_pSection->m_SecInfo)) {
+ switch (m_pVT->GetAlignment()) {
default:
case 0:
fMinX = 0.0f;
@@ -449,7 +447,7 @@
m_pSection->m_SecInfo.nTotalLine = nTotalLines;
for (int32_t l = 0; l < nTotalLines; l++) {
CLine* pLine = m_pSection->m_LineArray[l].get();
- switch (m_pVT->GetAlignment(m_pSection->m_SecInfo)) {
+ switch (m_pVT->GetAlignment()) {
default:
case 0:
fPosX = 0;
@@ -463,7 +461,7 @@
break;
}
fPosX += fLineIndent;
- fPosY += m_pVT->GetLineLeading(m_pSection->m_SecInfo);
+ fPosY += m_pVT->GetLineLeading();
fPosY += pLine->m_LineInfo.fLineAscent;
pLine->m_LineInfo.fLineX = fPosX - fMinX;
pLine->m_LineInfo.fLineY = fPosY - fMinY;
diff --git a/fpdfsdk/pwl/cpwl_edit_impl.cpp b/fpdfsdk/pwl/cpwl_edit_impl.cpp
index 7d8c0c3..7da5cdd 100644
--- a/fpdfsdk/pwl/cpwl_edit_impl.cpp
+++ b/fpdfsdk/pwl/cpwl_edit_impl.cpp
@@ -1535,8 +1535,8 @@
return false;
m_pVT->UpdateWordPlace(m_wpCaret);
- SetCaret(m_pVT->InsertWord(m_wpCaret, word,
- GetCharSetFromUnicode(word, charset), pWordProps));
+ SetCaret(
+ m_pVT->InsertWord(m_wpCaret, word, GetCharSetFromUnicode(word, charset)));
m_SelState.Set(m_wpCaret, m_wpCaret);
if (m_wpCaret == m_wpOldCaret)
return false;
@@ -1562,7 +1562,7 @@
return false;
m_pVT->UpdateWordPlace(m_wpCaret);
- SetCaret(m_pVT->InsertSection(m_wpCaret, pSecProps, pWordProps));
+ SetCaret(m_pVT->InsertSection(m_wpCaret));
m_SelState.Set(m_wpCaret, m_wpCaret);
if (m_wpCaret == m_wpOldCaret)
return false;
@@ -1846,18 +1846,18 @@
uint16_t word = sText[i];
switch (word) {
case 0x0D:
- wp = m_pVT->InsertSection(wp, nullptr, nullptr);
+ wp = m_pVT->InsertSection(wp);
if (i + 1 < sz && sText[i + 1] == 0x0A)
i++;
break;
case 0x0A:
- wp = m_pVT->InsertSection(wp, nullptr, nullptr);
+ wp = m_pVT->InsertSection(wp);
break;
case 0x09:
word = 0x20;
default:
- wp = m_pVT->InsertWord(wp, word, GetCharSetFromUnicode(word, charset),
- nullptr);
+ wp =
+ m_pVT->InsertWord(wp, word, GetCharSetFromUnicode(word, charset));
break;
}
}