From d9a4e803d7b5e9fde3009052653ec3fdf77c5c09 Mon Sep 17 00:00:00 2001 From: Neil Date: Wed, 19 Apr 2017 17:44:09 +1000 Subject: Use =delete for unwanted functions. --- src/ViewStyle.h | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/ViewStyle.h') diff --git a/src/ViewStyle.h b/src/ViewStyle.h index f08fb777a..95e1ffc2c 100644 --- a/src/ViewStyle.h +++ b/src/ViewStyle.h @@ -30,24 +30,23 @@ public: class FontNames { private: std::vector names; - +public: + FontNames(); // FontNames objects can not be copied FontNames(const FontNames &) = delete; FontNames &operator=(const FontNames &) = delete; -public: - FontNames(); ~FontNames(); void Clear(); const char *Save(const char *name); }; class FontRealised : public FontMeasurements { - // FontRealised objects can not be copied - FontRealised(const FontRealised &) = delete; - FontRealised &operator=(const FontRealised &) = delete; public: Font font; FontRealised(); + // FontRealised objects can not be copied + FontRealised(const FontRealised &) = delete; + FontRealised &operator=(const FontRealised &) = delete; virtual ~FontRealised(); void Realise(Surface &surface, int zoomLevel, int technology, const FontSpecification &fs); }; @@ -177,6 +176,8 @@ public: ViewStyle(); ViewStyle(const ViewStyle &source); + // Can only be copied through copy constructor which ensures font names initialised correctly + ViewStyle &operator=(const ViewStyle &) = delete; ~ViewStyle(); void CalculateMarginWidthAndMask(); void Init(size_t stylesSize_=256); @@ -212,8 +213,6 @@ private: void CreateAndAddFont(const FontSpecification &fs); FontRealised *Find(const FontSpecification &fs); void FindMaxAscentDescent(); - // Can only be copied through copy constructor which ensures font names initialised correctly - ViewStyle &operator=(const ViewStyle &) = delete; }; #ifdef SCI_NAMESPACE -- cgit v1.2.3