Attempt to fix some -Woverloaded-virtual warnings.
authorNico Weber <thakis@chromium.org>
Wed, 30 Jul 2014 21:17:19 +0000 (14:17 -0700)
committerNico Weber <thakis@chromium.org>
Wed, 30 Jul 2014 21:17:19 +0000 (14:17 -0700)
There are many warnings that look like:

error: 'CPWL_RadioButton::OnChar' hides overloaded virtual function [-Werror,-Woverloaded-virtual]
        virtual FX_BOOL                         OnChar(FX_WORD nChar);
                                                ^
note: hidden overloaded virtual function 'CPWL_Wnd::OnChar' declared here: different number of parameters (2 vs 1)
        virtual FX_BOOL                                 OnChar(FX_WORD nChar, FX_DWORD nFlag);
                                                        ^

It looks like someone added the nFlag parameter to the methods in CPWL_Wnd
at some point and missed to update all overloads This patch attempts to fix this:
It adds the parameter to all methods that look like they're trying to overload the base
class method, and renames the method in one case where it fairly clearly looks like
that it's not supposed to be an overload.

BUG=pdfium:29
R=bo_xu@foxitsoftware.com

Review URL: https://codereview.chromium.org/416383004

fpdfsdk/include/pdfwindow/PWL_ComboBox.h
fpdfsdk/include/pdfwindow/PWL_IconList.h
fpdfsdk/include/pdfwindow/PWL_SpecialButton.h
fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp
fpdfsdk/src/pdfwindow/PWL_IconList.cpp
fpdfsdk/src/pdfwindow/PWL_SpecialButton.cpp

index 5b91fe4..40523d7 100644 (file)
@@ -23,8 +23,8 @@ public:
 public:
        virtual FX_BOOL                         OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
 
-       virtual FX_BOOL                         OnKeyDown(FX_WORD nChar, FX_BOOL & bExit, FX_DWORD nFlag);
-       virtual FX_BOOL                         OnChar(FX_WORD nChar, FX_BOOL & bExit, FX_DWORD nFlag);
+       FX_BOOL                         OnKeyDownWithExit(FX_WORD nChar, FX_BOOL & bExit, FX_DWORD nFlag);
+       FX_BOOL                         OnCharWithExit(FX_WORD nChar, FX_BOOL & bExit, FX_DWORD nFlag);
 };
 
 #define PWL_COMBOBOX_BUTTON_WIDTH              13
index f084448..effabd0 100644 (file)
@@ -72,10 +72,10 @@ public:
 
 protected:
        virtual void                                            CreateChildWnd(const PWL_CREATEPARAM & cp);
-       virtual FX_BOOL                                         OnLButtonDown(const CPDF_Point & point);
-       virtual FX_BOOL                                         OnLButtonUp(const CPDF_Point & point);
-       virtual FX_BOOL                                         OnMouseMove(const CPDF_Point & point);
-       virtual FX_BOOL                                         OnKeyDown(FX_WORD nChar);
+       virtual FX_BOOL                                         OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
+       virtual FX_BOOL                                         OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
+       virtual FX_BOOL                                         OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag);
+       virtual FX_BOOL                                         OnKeyDown(FX_WORD nChar, FX_DWORD nFlag);
 
 private:
        CPWL_IconList_Item*                                     GetListItem(FX_INT32 nItemIndex) const;
@@ -95,7 +95,7 @@ public:
        CPWL_IconList(FX_INT32 nListCount);
        virtual ~CPWL_IconList();
 
-       virtual FX_BOOL                                         OnMouseWheel(short zDelta, const CPDF_Point & point);
+       virtual FX_BOOL                                         OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag);
 
        void                                                            SetSelect(FX_INT32 nIndex);
        void                                                            SetTopItem(FX_INT32 nIndex);
index ae882ea..656bb2e 100644 (file)
@@ -30,8 +30,8 @@ public:
 
 public:
        virtual CFX_ByteString          GetClassName() const;
-       virtual FX_BOOL                         OnLButtonUp(const CPDF_Point & point);
-       virtual FX_BOOL                         OnChar(FX_WORD nChar);
+       virtual FX_BOOL                         OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
+       virtual FX_BOOL                         OnChar(FX_WORD nChar, FX_DWORD nFlag);
 
        void                                            SetCheck(FX_BOOL bCheck);
        FX_BOOL                                         IsChecked() const;
@@ -48,8 +48,8 @@ public:
 
 public:
        virtual CFX_ByteString          GetClassName() const;
-       virtual FX_BOOL                         OnLButtonUp(const CPDF_Point & point);
-       virtual FX_BOOL                         OnChar(FX_WORD nChar);
+       virtual FX_BOOL                         OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
+       virtual FX_BOOL                         OnChar(FX_WORD nChar, FX_DWORD nFlag);
 
        void                                            SetCheck(FX_BOOL bCheck);
        FX_BOOL                                         IsChecked() const;
index 020765a..01810ff 100644 (file)
@@ -47,7 +47,7 @@ FX_BOOL       CPWL_CBListBox::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
        return TRUE;
 }
 
-FX_BOOL CPWL_CBListBox::OnKeyDown(FX_WORD nChar, FX_BOOL & bExit, FX_DWORD nFlag)
+FX_BOOL CPWL_CBListBox::OnKeyDownWithExit(FX_WORD nChar, FX_BOOL & bExit, FX_DWORD nFlag)
 {
        if (!m_pList) return FALSE;
 
@@ -93,7 +93,7 @@ FX_BOOL CPWL_CBListBox::OnKeyDown(FX_WORD nChar, FX_BOOL & bExit, FX_DWORD nFlag
        return TRUE;
 }
 
-FX_BOOL        CPWL_CBListBox::OnChar(FX_WORD nChar, FX_BOOL & bExit, FX_DWORD nFlag)
+FX_BOOL        CPWL_CBListBox::OnCharWithExit(FX_WORD nChar, FX_BOOL & bExit, FX_DWORD nFlag)
 {
        if (!m_pList) return FALSE;
 
@@ -552,7 +552,7 @@ FX_BOOL CPWL_ComboBox::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
                if (m_pList->GetCurSel() > 0)
                {
                        FX_BOOL bExit = FALSE;
-                       if (m_pList->OnKeyDown(nChar,bExit,nFlag))
+                       if (m_pList->OnKeyDownWithExit(nChar,bExit,nFlag))
                        {
                                if (bExit) return FALSE;
                                SetSelectText();                                
@@ -563,7 +563,7 @@ FX_BOOL CPWL_ComboBox::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
                if (m_pList->GetCurSel() < m_pList->GetCount() - 1)
                {
                        FX_BOOL bExit = FALSE;
-                       if (m_pList->OnKeyDown(nChar,bExit,nFlag))
+                       if (m_pList->OnKeyDownWithExit(nChar,bExit,nFlag))
                        {
                                if (bExit) return FALSE;
                                SetSelectText();                                
@@ -592,7 +592,7 @@ FX_BOOL CPWL_ComboBox::OnChar(FX_WORD nChar, FX_DWORD nFlag)
        }
        else
        {
-               if (m_pList->OnChar(nChar,bExit,nFlag))
+               if (m_pList->OnCharWithExit(nChar,bExit,nFlag))
                {
                        return bExit;
                }
index 7231790..1d58a90 100644 (file)
@@ -192,7 +192,7 @@ void CPWL_IconList_Content::CreateChildWnd(const PWL_CREATEPARAM & cp)
        }
 }
 
-FX_BOOL        CPWL_IconList_Content::OnLButtonDown(const CPDF_Point & point)
+FX_BOOL        CPWL_IconList_Content::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
 {
        SetFocus();
 
@@ -206,7 +206,7 @@ FX_BOOL     CPWL_IconList_Content::OnLButtonDown(const CPDF_Point & point)
        return TRUE;
 }
 
-FX_BOOL        CPWL_IconList_Content::OnLButtonUp(const CPDF_Point & point)
+FX_BOOL        CPWL_IconList_Content::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
 {
        m_bMouseDown = FALSE;
        ReleaseCapture();
@@ -214,7 +214,7 @@ FX_BOOL     CPWL_IconList_Content::OnLButtonUp(const CPDF_Point & point)
        return TRUE;
 }
 
-FX_BOOL CPWL_IconList_Content::OnMouseMove(const CPDF_Point & point)
+FX_BOOL CPWL_IconList_Content::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag)
 {
        if (m_bMouseDown)
        {
@@ -226,7 +226,7 @@ FX_BOOL CPWL_IconList_Content::OnMouseMove(const CPDF_Point & point)
        return TRUE;
 }
 
-FX_BOOL        CPWL_IconList_Content::OnKeyDown(FX_WORD nChar)
+FX_BOOL        CPWL_IconList_Content::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
 {
        switch (nChar)
        {
@@ -552,7 +552,7 @@ void CPWL_IconList::SetIconFillColor(const CPWL_Color& color)
        m_pListContent->SetIconFillColor(color);
 }
 
-FX_BOOL        CPWL_IconList::OnMouseWheel(short zDelta, const CPDF_Point & point)
+FX_BOOL        CPWL_IconList::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag)
 {
        CPDF_Point ptScroll = m_pListContent->GetScrollPos();
        CPDF_Rect rcScroll = m_pListContent->GetScrollArea();
index 287fec1..609beeb 100644 (file)
@@ -55,7 +55,7 @@ FX_BOOL CPWL_CheckBox::IsChecked() const
        return m_bChecked;
 }
 
-FX_BOOL CPWL_CheckBox::OnLButtonUp(const CPDF_Point & point)
+FX_BOOL CPWL_CheckBox::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
 {
        if (IsReadOnly()) return FALSE;
 
@@ -63,7 +63,7 @@ FX_BOOL CPWL_CheckBox::OnLButtonUp(const CPDF_Point & point)
        return TRUE;
 }
 
-FX_BOOL CPWL_CheckBox::OnChar(FX_WORD nChar)
+FX_BOOL CPWL_CheckBox::OnChar(FX_WORD nChar, FX_DWORD nFlag)
 {
        SetCheck(!IsChecked());
        return TRUE;
@@ -84,7 +84,7 @@ CFX_ByteString CPWL_RadioButton::GetClassName() const
        return "CPWL_RadioButton";
 }
 
-FX_BOOL        CPWL_RadioButton::OnLButtonUp(const CPDF_Point & point)
+FX_BOOL        CPWL_RadioButton::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
 {
        if (IsReadOnly()) return FALSE;
 
@@ -102,7 +102,7 @@ FX_BOOL CPWL_RadioButton::IsChecked() const
        return m_bChecked;
 }
 
-FX_BOOL CPWL_RadioButton::OnChar(FX_WORD nChar)
+FX_BOOL CPWL_RadioButton::OnChar(FX_WORD nChar, FX_DWORD nFlag)
 {
        SetCheck(TRUE);
        return TRUE;