summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-12-22 17:20:31 -0800
committerLei Zhang <thestig@chromium.org>2015-12-22 17:20:31 -0800
commitae6c84307e7db98564617fb90221ab339f4ca3f1 (patch)
treeb3544446b5e1d2c886883a89e483237bb247bef6
parent9ba6a147311eacb933c175168de6d11c439985d3 (diff)
downloadpdfium-ae6c84307e7db98564617fb90221ab339f4ca3f1.tar.xz
Merge to XFA: Cleanup: Remove some dead code in CPWL_Note.
TBR=ochang@chromium.org Review URL: https://codereview.chromium.org/1544953002 . (cherry picked from commit cd0ade6f77b1a3e7c340a05bc6cb448f52e9bb96) Review URL: https://codereview.chromium.org/1547843003 .
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_Note.h10
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Note.cpp46
2 files changed, 4 insertions, 52 deletions
diff --git a/fpdfsdk/include/pdfwindow/PWL_Note.h b/fpdfsdk/include/pdfwindow/PWL_Note.h
index 0edb1e3437..9946f4473d 100644
--- a/fpdfsdk/include/pdfwindow/PWL_Note.h
+++ b/fpdfsdk/include/pdfwindow/PWL_Note.h
@@ -307,12 +307,6 @@ class CPWL_Note : public CPWL_NoteItem {
CFX_WideString GetReplyString() const;
void SetReplyString(const CFX_WideString& string);
- // 0-normal / 1-caption / 2-leftbottom corner / 3-rightbottom corner / 4-close
- // / 5-options
- int32_t NoteHitTest(const CPDF_Point& point) const;
- CPDF_Rect GetCaptionRect() const { return m_rcCaption; }
- IPopup_Note* GetPopupNote() const { return m_pPopupNote; }
-
// CPWL_NoteItem
void SetSubjectName(const CFX_WideString& sName) override;
void SetAuthorName(const CFX_WideString& sName) override;
@@ -350,9 +344,7 @@ class CPWL_Note : public CPWL_NoteItem {
IPWL_NoteNotify* m_pNoteNotify;
FX_BOOL m_bResizing;
PWL_SCROLL_INFO m_OldScrollInfo;
- CPDF_Rect m_rcCaption;
- FX_BOOL m_bEnalbleNotify;
- IPopup_Note* m_pPopupNote;
+ FX_BOOL m_bEnableNotify;
CFX_WideString m_sReplyString;
};
diff --git a/fpdfsdk/src/pdfwindow/PWL_Note.cpp b/fpdfsdk/src/pdfwindow/PWL_Note.cpp
index d87c3df916..4ac237df7f 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Note.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Note.cpp
@@ -1059,9 +1059,7 @@ CPWL_Note::CPWL_Note(IPopup_Note* pPopupNote,
m_pOptions(NULL),
m_pNoteNotify(pNoteNotify),
m_bResizing(FALSE),
- m_rcCaption(0, 0, 0, 0),
- m_bEnalbleNotify(TRUE),
- m_pPopupNote(pPopupNote) {}
+ m_bEnableNotify(TRUE) {}
CPWL_Note::~CPWL_Note() {}
@@ -1070,7 +1068,7 @@ IPWL_NoteItem* CPWL_Note::Reply() {
}
void CPWL_Note::EnableNotify(FX_BOOL bEnabled) {
- m_bEnalbleNotify = bEnabled;
+ m_bEnableNotify = bEnabled;
}
void CPWL_Note::RePosChildWnd() {
@@ -1234,46 +1232,11 @@ void CPWL_Note::RePosNoteChildren() {
rcContentsBar.left = rcContentsBar.right - PWL_SCROLLBAR_WIDTH;
rcContentsBar.Normalize();
m_pContentsBar->Move(rcContentsBar, TRUE, FALSE);
-
- m_rcCaption = rcClient;
- m_rcCaption.bottom = rcContents.top;
}
m_bResizing = FALSE;
}
-// TODO(thestig): Make this return an enum.
-// 0-normal / 1-caption / 2-leftbottom corner / 3-rightbottom corner / 4-close /
-// 5-options
-int32_t CPWL_Note::NoteHitTest(const CPDF_Point& point) const {
- GetClientRect();
-
- if (m_pSubject->WndHitTest(m_pSubject->ParentToChild(point)))
- return 1;
- if (m_pDateTime->WndHitTest(m_pDateTime->ParentToChild(point)))
- return 1;
- if (m_pAuthor->WndHitTest(m_pAuthor->ParentToChild(point)))
- return 1;
- if (m_pIcon->WndHitTest(m_pIcon->ParentToChild(point)))
- return 1;
-
- if (m_pContents->WndHitTest(m_pContents->ParentToChild(point)))
- return 0;
- if (m_pContentsBar->WndHitTest(m_pContentsBar->ParentToChild(point)))
- return 0;
-
- if (m_pCloseBox->WndHitTest(m_pCloseBox->ParentToChild(point)))
- return 4;
- if (m_pLBBox->WndHitTest(m_pLBBox->ParentToChild(point)))
- return 2;
- if (m_pRBBox->WndHitTest(m_pRBBox->ParentToChild(point)))
- return 3;
- if (m_pOptions->WndHitTest(m_pOptions->ParentToChild(point)))
- return 5;
-
- return 1;
-}
-
void CPWL_Note::CreateChildWnd(const PWL_CREATEPARAM& cp) {
CPWL_NoteItem::CreateChildWnd(cp);
@@ -1551,10 +1514,7 @@ const CPWL_Note* CPWL_Note::GetNote() const {
}
IPWL_NoteNotify* CPWL_Note::GetNoteNotify() const {
- if (m_bEnalbleNotify)
- return m_pNoteNotify;
-
- return NULL;
+ return m_bEnableNotify ? m_pNoteNotify : nullptr;
}
void CPWL_Note::SetIconType(int32_t nType) {