summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorthestig <thestig@chromium.org>2016-05-10 13:24:16 -0700
committerCommit bot <commit-bot@chromium.org>2016-05-10 13:24:17 -0700
commit2c3a16a7698ba15476173e849f82c97ea3da9939 (patch)
treee0a66aaa5e28af2cf5fea56f25306a8f531f892c /core
parent245ae9ce1bb854e5e3da400c6d8c8061d81953a9 (diff)
downloadpdfium-2c3a16a7698ba15476173e849f82c97ea3da9939.tar.xz
Remove some dead code.
- No caller checks the CPDF_VariableText::SetProvider() return value. - IFX_Edit::SetVTProvider() is unused. - CFX_ListItem::SetCaret() is useless. - CFX_List::SetItemCaret() is also useless. - CPVT_GenerateAP::GenerateEditAP() has a param that's always NULL. Review-Url: https://codereview.chromium.org/1960183003
Diffstat (limited to 'core')
-rw-r--r--core/fpdfdoc/cpdf_variabletext.cpp5
-rw-r--r--core/fpdfdoc/cpvt_generateap.cpp11
-rw-r--r--core/fpdfdoc/cpvt_generateap.h3
-rw-r--r--core/fpdfdoc/include/cpdf_variabletext.h9
4 files changed, 8 insertions, 20 deletions
diff --git a/core/fpdfdoc/cpdf_variabletext.cpp b/core/fpdfdoc/cpdf_variabletext.cpp
index 67887400a4..427cd5d306 100644
--- a/core/fpdfdoc/cpdf_variabletext.cpp
+++ b/core/fpdfdoc/cpdf_variabletext.cpp
@@ -1153,9 +1153,6 @@ CPDF_VariableText::Iterator* CPDF_VariableText::GetIterator() {
return m_pVTIterator;
}
-CPDF_VariableText::Provider* CPDF_VariableText::SetProvider(
- CPDF_VariableText::Provider* pProvider) {
- CPDF_VariableText::Provider* pOld = m_pVTProvider;
+void CPDF_VariableText::SetProvider(CPDF_VariableText::Provider* pProvider) {
m_pVTProvider = pProvider;
- return pOld;
}
diff --git a/core/fpdfdoc/cpvt_generateap.cpp b/core/fpdfdoc/cpvt_generateap.cpp
index ec1b9fbf4e..5ec9513e84 100644
--- a/core/fpdfdoc/cpvt_generateap.cpp
+++ b/core/fpdfdoc/cpvt_generateap.cpp
@@ -503,23 +503,16 @@ CFX_ByteString CPVT_GenerateAP::GenerateEditAP(
CPDF_VariableText::Iterator* pIterator,
const CFX_FloatPoint& ptOffset,
FX_BOOL bContinuous,
- uint16_t SubWord,
- const CPVT_WordRange* pVisible) {
+ uint16_t SubWord) {
CFX_ByteTextBuf sEditStream, sLineStream, sWords;
CFX_FloatPoint ptOld(0.0f, 0.0f), ptNew(0.0f, 0.0f);
int32_t nCurFontIndex = -1;
if (pIterator) {
- if (pVisible)
- pIterator->SetAt(pVisible->BeginPos);
- else
- pIterator->SetAt(0);
+ pIterator->SetAt(0);
CPVT_WordPlace oldplace;
while (pIterator->NextWord()) {
CPVT_WordPlace place = pIterator->GetAt();
- if (pVisible && place.WordCmp(pVisible->EndPos) > 0)
- break;
-
if (bContinuous) {
if (place.LineCmp(oldplace) != 0) {
if (sWords.GetSize() > 0) {
diff --git a/core/fpdfdoc/cpvt_generateap.h b/core/fpdfdoc/cpvt_generateap.h
index 09c0507941..924de40ed4 100644
--- a/core/fpdfdoc/cpvt_generateap.h
+++ b/core/fpdfdoc/cpvt_generateap.h
@@ -42,8 +42,7 @@ class CPVT_GenerateAP {
CPDF_VariableText::Iterator* pIterator,
const CFX_FloatPoint& ptOffset,
FX_BOOL bContinuous,
- uint16_t SubWord = 0,
- const CPVT_WordRange* pVisible = NULL);
+ uint16_t SubWord);
static CFX_ByteString GenerateBorderAP(const CFX_FloatRect& rect,
FX_FLOAT fWidth,
const CPVT_Color& color,
diff --git a/core/fpdfdoc/include/cpdf_variabletext.h b/core/fpdfdoc/include/cpdf_variabletext.h
index b73d3df8c1..a14ad52752 100644
--- a/core/fpdfdoc/include/cpdf_variabletext.h
+++ b/core/fpdfdoc/include/cpdf_variabletext.h
@@ -24,8 +24,8 @@ struct CPVT_SecProps;
struct CPVT_Section;
struct CPVT_SectionInfo;
struct CPVT_Word;
-struct CPVT_WordProps;
struct CPVT_WordInfo;
+struct CPVT_WordProps;
#define VARIABLETEXT_HALF 0.5f
@@ -60,7 +60,7 @@ class CPDF_VariableText : private CPDF_EditContainer {
class Provider {
public:
- Provider(IPVT_FontMap* pFontMap);
+ explicit Provider(IPVT_FontMap* pFontMap);
virtual ~Provider();
virtual int32_t GetCharWidth(int32_t nFontIndex,
@@ -79,10 +79,9 @@ class CPDF_VariableText : private CPDF_EditContainer {
};
CPDF_VariableText();
- virtual ~CPDF_VariableText();
+ ~CPDF_VariableText() override;
- CPDF_VariableText::Provider* SetProvider(
- CPDF_VariableText::Provider* pProvider);
+ void SetProvider(CPDF_VariableText::Provider* pProvider);
CPDF_VariableText::Iterator* GetIterator();
// CPDF_EditContainer.