diff options
| author | Neil Hodgson <nyamatongwe@gmail.com> | 2019-09-30 10:42:08 +1000 | 
|---|---|---|
| committer | Neil Hodgson <nyamatongwe@gmail.com> | 2019-09-30 10:42:08 +1000 | 
| commit | 44b175314f0b875e6d3fa0664ad2c0133e4542f9 (patch) | |
| tree | 705658e775b8822305573ebf9d1a91cbbcf11aa2 | |
| parent | 6341309b1a394ba95c3b9cae037cbcd3d181c25d (diff) | |
| download | scintilla-mirror-44b175314f0b875e6d3fa0664ad2c0133e4542f9.tar.gz | |
Backport: Delete standard functions on classes where there could be attempts to copy.
Backport of changeset 7696:18f98becfeaa.
| -rwxr-xr-x[-rw-r--r--] | gtk/Converter.h | 5 | ||||
| -rwxr-xr-x[-rw-r--r--] | gtk/PlatGTK.cxx | 27 | ||||
| -rwxr-xr-x[-rw-r--r--] | gtk/ScintillaGTK.cxx | 10 | ||||
| -rwxr-xr-x[-rw-r--r--] | gtk/ScintillaGTK.h | 6 | 
4 files changed, 47 insertions, 1 deletions
diff --git a/gtk/Converter.h b/gtk/Converter.h index eb665b4b6..30bb781ac 100644..100755 --- a/gtk/Converter.h +++ b/gtk/Converter.h @@ -29,6 +29,11 @@ public:  		iconvh = iconvhBad;  		Open(charSetDestination, charSetSource, transliterations);  	} +	// Deleted so Converter objects can not be copied. +	Converter(const Converter &) = delete; +	Converter(Converter &&) = delete; +	Converter &operator=(const Converter &) = delete; +	Converter &operator=(Converter &&) = delete;  	~Converter() {  		Close();  	} diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx index 8dfbb2227..94f6c449f 100644..100755 --- a/gtk/PlatGTK.cxx +++ b/gtk/PlatGTK.cxx @@ -80,6 +80,11 @@ public:  		pfd = pfd_;  		characterSet = characterSet_;  	} +	// Deleted so FontHandle objects can not be copied. +	FontHandle(const FontHandle &) = delete; +	FontHandle(FontHandle &&) = delete; +	FontHandle &operator=(const FontHandle &) = delete; +	FontHandle &operator=(FontHandle &&) = delete;  	~FontHandle() {  		if (pfd)  			pango_font_description_free(pfd); @@ -145,6 +150,11 @@ class SurfaceImpl : public Surface {  	void SetConverter(int characterSet_);  public:  	SurfaceImpl() noexcept; +	// Deleted so SurfaceImpl objects can not be copied. +	SurfaceImpl(const SurfaceImpl&) = delete; +	SurfaceImpl(SurfaceImpl&&) = delete; +	SurfaceImpl&operator=(const SurfaceImpl&) = delete; +	SurfaceImpl&operator=(SurfaceImpl&&) = delete;  	~SurfaceImpl() override;  	void Init(WindowID wid) override; @@ -747,6 +757,12 @@ public:  		iter = pango_layout_get_iter(layout);  		pango_layout_iter_get_cluster_extents(iter, nullptr, &pos);  	} +	// Deleted so ClusterIterator objects can not be copied. +	ClusterIterator(const ClusterIterator&) = delete; +	ClusterIterator(ClusterIterator&&) = delete; +	ClusterIterator&operator=(const ClusterIterator&) = delete; +	ClusterIterator&operator=(ClusterIterator&&) = delete; +  	~ClusterIterator() {  		pango_layout_iter_free(iter);  	} @@ -1208,6 +1224,11 @@ public:  #endif  		delegate(nullptr) {  	} +	// Deleted so ListBoxX objects can not be copied. +	ListBoxX(const ListBoxX&) = delete; +	ListBoxX(ListBoxX&&) = delete; +	ListBoxX&operator=(const ListBoxX&) = delete; +	ListBoxX&operator=(ListBoxX&&) = delete;  	~ListBoxX() override {  		if (pixhash) {  			g_hash_table_foreach((GHashTable *) pixhash, list_image_free, nullptr); @@ -1947,7 +1968,11 @@ public:  	explicit DynamicLibraryImpl(const char *modulePath) noexcept {  		m = g_module_open(modulePath, G_MODULE_BIND_LAZY);  	} - +	// Deleted so DynamicLibraryImpl objects can not be copied. +	DynamicLibraryImpl(const DynamicLibraryImpl&) = delete; +	DynamicLibraryImpl(DynamicLibraryImpl&&) = delete; +	DynamicLibraryImpl&operator=(const DynamicLibraryImpl&) = delete; +	DynamicLibraryImpl&operator=(DynamicLibraryImpl&&) = delete;  	~DynamicLibraryImpl() override {  		if (m != nullptr)  			g_module_close(m); diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index 9e3410450..8ed9ea1ce 100644..100755 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -432,6 +432,11 @@ public:  		uniStr = g_utf8_to_ucs4_fast(str, strlen(str), &uniStrLen);  		pscript = pango_script_for_unichar(uniStr[0]);  	} +	// Deleted so PreEditString objects can not be copied. +	PreEditString(const PreEditString&) = delete; +	PreEditString(PreEditString&&) = delete; +	PreEditString&operator=(const PreEditString&) = delete; +	PreEditString&operator=(PreEditString&&) = delete;  	~PreEditString() {  		g_free(str);  		g_free(uniStr); @@ -1201,6 +1206,11 @@ struct CaseMapper {  			mapped = g_utf8_strdown(sUTF8.c_str(), sUTF8.length());  		}  	} +	// Deleted so CaseMapper objects can not be copied. +	CaseMapper(const CaseMapper&) = delete; +	CaseMapper(CaseMapper&&) = delete; +	CaseMapper&operator=(const CaseMapper&) = delete; +	CaseMapper&operator=(CaseMapper&&) = delete;  	~CaseMapper() {  		g_free(mapped);  	} diff --git a/gtk/ScintillaGTK.h b/gtk/ScintillaGTK.h index b87808824..357efee8a 100644..100755 --- a/gtk/ScintillaGTK.h +++ b/gtk/ScintillaGTK.h @@ -274,6 +274,12 @@ public:  		g_object_weak_ref(weakRef, WeakNotify, this);  	} +	// Deleted so GObjectWatcher objects can not be copied. +	GObjectWatcher(const GObjectWatcher&) = delete; +	GObjectWatcher(GObjectWatcher&&) = delete; +	GObjectWatcher&operator=(const GObjectWatcher&) = delete; +	GObjectWatcher&operator=(GObjectWatcher&&) = delete; +  	virtual ~GObjectWatcher() {  		if (weakRef) {  			g_object_weak_unref(weakRef, WeakNotify, this);  | 
