diff options
| author | Neil <nyamatongwe@gmail.com> | 2020-03-23 09:39:32 +1100 | 
|---|---|---|
| committer | Neil <nyamatongwe@gmail.com> | 2020-03-23 09:39:32 +1100 | 
| commit | 6e7f7105447e81fed1e0ccc2545ca36fb7f05657 (patch) | |
| tree | d4b4b109bc1ef1cb9038e60b03b4f68dc6406baa /src/Document.cxx | |
| parent | 02869f8e756f4082210799851a6ee7723a995913 (diff) | |
| download | scintilla-mirror-6e7f7105447e81fed1e0ccc2545ca36fb7f05657.tar.gz | |
Backport: perLineData is polymorphic so replace static_cast with dynamic_cast for better
type safety and adherence to C++ Core Guidelines C.146.
Backport of changeset 8019:91a3db714f60.
Diffstat (limited to 'src/Document.cxx')
| -rw-r--r-- | src/Document.cxx | 10 | 
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Document.cxx b/src/Document.cxx index 157599952..9a068fcf8 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -189,23 +189,23 @@ void Document::RemoveLine(Sci::Line line) {  }  LineMarkers *Document::Markers() const noexcept { -	return static_cast<LineMarkers *>(perLineData[ldMarkers].get()); +	return dynamic_cast<LineMarkers *>(perLineData[ldMarkers].get());  }  LineLevels *Document::Levels() const noexcept { -	return static_cast<LineLevels *>(perLineData[ldLevels].get()); +	return dynamic_cast<LineLevels *>(perLineData[ldLevels].get());  }  LineState *Document::States() const noexcept { -	return static_cast<LineState *>(perLineData[ldState].get()); +	return dynamic_cast<LineState *>(perLineData[ldState].get());  }  LineAnnotation *Document::Margins() const noexcept { -	return static_cast<LineAnnotation *>(perLineData[ldMargin].get()); +	return dynamic_cast<LineAnnotation *>(perLineData[ldMargin].get());  }  LineAnnotation *Document::Annotations() const noexcept { -	return static_cast<LineAnnotation *>(perLineData[ldAnnotation].get()); +	return dynamic_cast<LineAnnotation *>(perLineData[ldAnnotation].get());  }  int Document::LineEndTypesSupported() const {  | 
