Browse Source

Fix potential problems

Michael Ragazzon 6 years ago
parent
commit
cfaab542f4

+ 2 - 2
Source/Core/BitmapFont/FontFaceLayer.h

@@ -60,14 +60,14 @@ public:
 	/// @param[in] clone The layer to optionally clone geometry and texture data from.
 	/// @param[in] deep_clone If true, the clones geometry will be completely cloned and the effect will have no option to affect even the glyph origins.
 	/// @return True if the layer was generated successfully, false if not.
-	virtual bool Initialise(const FontFaceHandle* handle, FontEffect* effect = NULL, const Rocket::Core::FontFaceLayer* clone = NULL, bool deep_clone = false);
+	virtual bool Initialise(const Rocket::Core::FontFaceHandle* handle, FontEffect* effect = NULL, const Rocket::Core::FontFaceLayer* clone = NULL, bool deep_clone = false) override;
 
 	/// Generates the texture data for a layer (for the texture database).
 	/// @param[out] texture_data The pointer to be set to the generated texture data.
 	/// @param[out] texture_dimensions The dimensions of the texture.
 	/// @param[in] glyphs The glyphs required by the font face handle.
 	/// @param[in] texture_id The index of the texture within the layer to generate.
-	virtual bool GenerateTexture(const byte*& texture_data, Vector2i& texture_dimensions, int texture_id);
+	virtual bool GenerateTexture(const byte*& texture_data, Vector2i& texture_dimensions, int texture_id) override;
 
 };
 

+ 1 - 1
Source/Core/Context.cpp

@@ -40,7 +40,7 @@ namespace Core {
 
 const float DOUBLE_CLICK_TIME = 0.5f;
 
-Context::Context(const String& name) : name(name), dimensions(0, 0), mouse_position(0, 0), clip_origin(-1, -1), clip_dimensions(-1, -1), density_independent_pixel_ratio(1.0f), view_state()
+Context::Context(const String& name) : name(name), dimensions(0, 0), density_independent_pixel_ratio(1.0f), mouse_position(0, 0), clip_origin(-1, -1), clip_dimensions(-1, -1), view_state()
 {
 	instancer = NULL;
 

+ 0 - 1
Source/Core/ElementStyle.cpp

@@ -382,7 +382,6 @@ bool ElementStyle::SetProperty(const String& name, const Property& property)
 	if (new_property.definition == NULL)
 		return false;
 
-	sizeof(ElementDefinition);
 	if (local_properties == NULL)
 		local_properties = new PropertyDictionary();
 

+ 1 - 1
Source/Core/ElementTextDefault.cpp

@@ -218,7 +218,7 @@ bool ElementTextDefault::GenerateLine(WString& line, int& line_length, float& li
 		{
 			if (!line.Empty() &&
 				(line_width + token_width > maximum_line_width ||
-				 LastToken(next_token_begin, string_end, collapse_white_space, break_at_endline) && line_width + token_width > maximum_line_width - right_spacing_width))
+				 (LastToken(next_token_begin, string_end, collapse_white_space, break_at_endline) && line_width + token_width > maximum_line_width - right_spacing_width)))
 			{
 				return false;
 			}

+ 1 - 1
Source/Core/FontFaceLayer.h

@@ -52,7 +52,7 @@ class FontFaceLayer
 {
 public:
 	FontFaceLayer();
-	~FontFaceLayer();
+	virtual ~FontFaceLayer();
 
 	/// Generates the character and texture data for the layer.
 	/// @param[in] handle The handle generating this layer.