summaryrefslogtreecommitdiff
path: root/fpdfsdk/pdfwindow
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-07-18 10:04:07 -0700
committerCommit bot <commit-bot@chromium.org>2016-07-18 10:04:07 -0700
commitefd5a99f98a263da9de52059681ff6ed27b2567c (patch)
tree83abdb823c7b2941f4891f4f27986576c740ab7b /fpdfsdk/pdfwindow
parentd8f397878b5cd83ba4b75b3e69331986357301b9 (diff)
downloadpdfium-efd5a99f98a263da9de52059681ff6ed27b2567c.tar.xz
Removing default params from CFX_Edit.
This CL removes all of the default params from CFX_Edit. They are either moved to the callsite or removed completely if unused. Review-Url: https://codereview.chromium.org/2152473002
Diffstat (limited to 'fpdfsdk/pdfwindow')
-rw-r--r--fpdfsdk/pdfwindow/PWL_Edit.cpp19
-rw-r--r--fpdfsdk/pdfwindow/PWL_Edit.h5
-rw-r--r--fpdfsdk/pdfwindow/PWL_EditCtrl.cpp2
-rw-r--r--fpdfsdk/pdfwindow/PWL_Utils.cpp20
4 files changed, 17 insertions, 29 deletions
diff --git a/fpdfsdk/pdfwindow/PWL_Edit.cpp b/fpdfsdk/pdfwindow/PWL_Edit.cpp
index 39ea822ea2..5d20dd46a3 100644
--- a/fpdfsdk/pdfwindow/PWL_Edit.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Edit.cpp
@@ -463,17 +463,8 @@ void CPWL_Edit::OnKillFocus() {
m_bFocus = FALSE;
}
-void CPWL_Edit::SetHorzScale(int32_t nHorzScale, FX_BOOL bPaint /* = TRUE*/) {
- m_pEdit->SetHorzScale(nHorzScale, bPaint);
-}
-
-void CPWL_Edit::SetCharSpace(FX_FLOAT fCharSpace, FX_BOOL bPaint /* = TRUE*/) {
- m_pEdit->SetCharSpace(fCharSpace, bPaint);
-}
-
-void CPWL_Edit::SetLineLeading(FX_FLOAT fLineLeading,
- FX_BOOL bPaint /* = TRUE*/) {
- m_pEdit->SetLineLeading(fLineLeading, bPaint);
+void CPWL_Edit::SetCharSpace(FX_FLOAT fCharSpace) {
+ m_pEdit->SetCharSpace(fCharSpace);
}
CFX_ByteString CPWL_Edit::GetSelectAppearanceStream(
@@ -559,14 +550,14 @@ FX_FLOAT CPWL_Edit::GetCharArrayAutoFontSize(CPDF_Font* pFont,
void CPWL_Edit::SetCharArray(int32_t nCharArray) {
if (HasFlag(PES_CHARARRAY) && nCharArray > 0) {
m_pEdit->SetCharArray(nCharArray);
- m_pEdit->SetTextOverflow(TRUE);
+ m_pEdit->SetTextOverflow(TRUE, TRUE);
if (HasFlag(PWS_AUTOFONTSIZE)) {
if (IPVT_FontMap* pFontMap = GetFontMap()) {
FX_FLOAT fFontSize = GetCharArrayAutoFontSize(
pFontMap->GetPDFFont(0), GetClientRect(), nCharArray);
if (fFontSize > 0.0f) {
- m_pEdit->SetAutoFontSize(FALSE);
+ m_pEdit->SetAutoFontSize(FALSE, TRUE);
m_pEdit->SetFontSize(fFontSize);
}
}
@@ -580,7 +571,7 @@ void CPWL_Edit::SetLimitChar(int32_t nLimitChar) {
void CPWL_Edit::ReplaceSel(const FX_WCHAR* csText) {
m_pEdit->Clear();
- m_pEdit->InsertText(csText);
+ m_pEdit->InsertText(csText, DEFAULT_CHARSET);
}
CFX_FloatRect CPWL_Edit::GetFocusRect() const {
diff --git a/fpdfsdk/pdfwindow/PWL_Edit.h b/fpdfsdk/pdfwindow/PWL_Edit.h
index 008e1fd4a5..df69ebf5d7 100644
--- a/fpdfsdk/pdfwindow/PWL_Edit.h
+++ b/fpdfsdk/pdfwindow/PWL_Edit.h
@@ -76,10 +76,7 @@ class CPWL_Edit : public CPWL_EditCtrl {
void SetCharArray(int32_t nCharArray);
void SetLimitChar(int32_t nLimitChar);
- void SetHorzScale(int32_t nHorzScale, FX_BOOL bPaint = TRUE);
- void SetCharSpace(FX_FLOAT fCharSpace, FX_BOOL bPaint = TRUE);
-
- void SetLineLeading(FX_FLOAT fLineLeading, FX_BOOL bPaint = TRUE);
+ void SetCharSpace(FX_FLOAT fCharSpace);
FX_BOOL CanSelectAll() const;
FX_BOOL CanClear() const;
diff --git a/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp b/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp
index 1bb17db6de..ee3df36a71 100644
--- a/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp
+++ b/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp
@@ -483,7 +483,7 @@ void CPWL_EditCtrl::ShowVScrollBar(FX_BOOL bShow) {}
void CPWL_EditCtrl::InsertText(const FX_WCHAR* csText) {
if (!IsReadOnly())
- m_pEdit->InsertText(csText);
+ m_pEdit->InsertText(csText, DEFAULT_CHARSET);
}
void CPWL_EditCtrl::InsertWord(uint16_t word, int32_t nCharset) {
diff --git a/fpdfsdk/pdfwindow/PWL_Utils.cpp b/fpdfsdk/pdfwindow/PWL_Utils.cpp
index c8b2239a36..a9698860fe 100644
--- a/fpdfsdk/pdfwindow/PWL_Utils.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Utils.cpp
@@ -441,12 +441,12 @@ CFX_ByteString CPWL_Utils::GetTextAppStream(const CFX_FloatRect& rcBBox,
std::unique_ptr<CFX_Edit> pEdit(new CFX_Edit);
pEdit->SetFontMap(pFontMap);
pEdit->SetPlateRect(rcBBox);
- pEdit->SetAlignmentH(nAlignmentH);
- pEdit->SetAlignmentV(nAlignmentV);
- pEdit->SetMultiLine(bMultiLine);
- pEdit->SetAutoReturn(bAutoReturn);
+ pEdit->SetAlignmentH(nAlignmentH, TRUE);
+ pEdit->SetAlignmentV(nAlignmentV, TRUE);
+ pEdit->SetMultiLine(bMultiLine, TRUE);
+ pEdit->SetAutoReturn(bAutoReturn, TRUE);
if (IsFloatZero(fFontSize))
- pEdit->SetAutoFontSize(TRUE);
+ pEdit->SetAutoFontSize(TRUE, TRUE);
else
pEdit->SetFontSize(fFontSize);
@@ -473,12 +473,12 @@ CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CFX_FloatRect& rcBBox,
std::unique_ptr<CFX_Edit> pEdit(new CFX_Edit);
pEdit->SetFontMap(pFontMap);
- pEdit->SetAlignmentH(1);
- pEdit->SetAlignmentV(1);
- pEdit->SetMultiLine(FALSE);
- pEdit->SetAutoReturn(FALSE);
+ pEdit->SetAlignmentH(1, TRUE);
+ pEdit->SetAlignmentV(1, TRUE);
+ pEdit->SetMultiLine(FALSE, TRUE);
+ pEdit->SetAutoReturn(FALSE, TRUE);
if (IsFloatZero(fFontSize))
- pEdit->SetAutoFontSize(TRUE);
+ pEdit->SetAutoFontSize(TRUE, TRUE);
else
pEdit->SetFontSize(fFontSize);