summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2014-07-30 14:16:25 -0700
committerNico Weber <thakis@chromium.org>2014-07-30 14:16:25 -0700
commitfe08482976fb43cc93e4f8a3ea799d98dfe96ada (patch)
treed4e72584a31ccf49859490121ddb83df7753cf10
parent8dee6cab8f10a257d3b551ede6ca85466bf0bac7 (diff)
downloadpdfium-fe08482976fb43cc93e4f8a3ea799d98dfe96ada.tar.xz
Fix incorrect override of GetLayoutOrder().
fsdk_baseform.h:63:19: error: 'CPDFSDK_Widget::GetLayoutOrder' hides overloaded virtual function [-Werror,-Woverloaded-virtual] virtual int GetLayoutOrder() {return 2;} ^ fsdk_baseannot.h:70:18: note: hidden overloaded virtual function 'CPDFSDK_Annot::GetLayoutOrder' declared here: different qualifiers (const vs none) virtual int GetLayoutOrder() const { return 5; } ^ On Windows, I believe MSVS treats these as override since it's such a common and easy mistake, but clang and gcc do what the standard specifies. Add a "const" to the function in the subclass so that this is actually an override, as intended. BUG=pdfium:29 R=bo_xu@foxitsoftware.com Review URL: https://codereview.chromium.org/427173002
-rw-r--r--fpdfsdk/include/fsdk_baseform.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/fpdfsdk/include/fsdk_baseform.h b/fpdfsdk/include/fsdk_baseform.h
index b93cbbd81f..073c99f199 100644
--- a/fpdfsdk/include/fsdk_baseform.h
+++ b/fpdfsdk/include/fsdk_baseform.h
@@ -60,7 +60,7 @@ public:
int GetFieldType() const;
//define layout order to 2.
- virtual int GetLayoutOrder() {return 2;}
+ virtual int GetLayoutOrder() const {return 2;}
/*
FIELDFLAG_READONLY
FIELDFLAG_REQUIRED