From ee572971d6c24eb4182a21e811bdfb5b2fc735d0 Mon Sep 17 00:00:00 2001 From: Victor Cebollada Date: Thu, 5 May 2016 07:38:21 +0100 Subject: [PATCH] Svace issues. * Add undefined and private copy constructors and assignment operators to avoid copies. Change-Id: I7ff0665f11f5b557ddb76e15b016ebda6eaaa808 Signed-off-by: Victor Cebollada --- text/dali/internal/glyphy/vector-font-cache.cpp | 9 +++++++++ text/dali/internal/glyphy/vector-font-cache.h | 2 +- text/dali/internal/text-abstraction/bidirectional-support-impl.h | 2 +- text/dali/internal/text-abstraction/font-client-impl.h | 2 +- text/dali/internal/text-abstraction/font-client-plugin-impl.h | 9 +++++++++ text/dali/internal/text-abstraction/shaping-impl.h | 2 +- 6 files changed, 22 insertions(+), 4 deletions(-) diff --git a/text/dali/internal/glyphy/vector-font-cache.cpp b/text/dali/internal/glyphy/vector-font-cache.cpp index 972327a..23ad8ba 100644 --- a/text/dali/internal/glyphy/vector-font-cache.cpp +++ b/text/dali/internal/glyphy/vector-font-cache.cpp @@ -204,6 +204,15 @@ struct VectorFontCache::Impl glyphy_arc_accumulator_destroy( mAccumulator ); } +private: + + // Declared private and left undefined to avoid copies. + Impl( const Impl& ); + // Declared private and left undefined to avoid copies. + Impl& operator=( const Impl& ); + +public: + FT_Library mFreeTypeLibrary; ///< A handle to a FreeType library instance. vector mIdLookup; diff --git a/text/dali/internal/glyphy/vector-font-cache.h b/text/dali/internal/glyphy/vector-font-cache.h index 91fa2e4..cb04606 100644 --- a/text/dali/internal/glyphy/vector-font-cache.h +++ b/text/dali/internal/glyphy/vector-font-cache.h @@ -108,7 +108,7 @@ private: VectorFontCache( const VectorFontCache& ); // Undefined assignment constructor. - VectorFontCache& operator=( VectorFontCache& ); + VectorFontCache& operator=( const VectorFontCache& ); private: diff --git a/text/dali/internal/text-abstraction/bidirectional-support-impl.h b/text/dali/internal/text-abstraction/bidirectional-support-impl.h index 65b1711..ab180c2 100644 --- a/text/dali/internal/text-abstraction/bidirectional-support-impl.h +++ b/text/dali/internal/text-abstraction/bidirectional-support-impl.h @@ -107,7 +107,7 @@ private: BidirectionalSupport( const BidirectionalSupport& ); // Undefined assignment constructor. - BidirectionalSupport& operator=( BidirectionalSupport& ); + BidirectionalSupport& operator=( const BidirectionalSupport& ); private: diff --git a/text/dali/internal/text-abstraction/font-client-impl.h b/text/dali/internal/text-abstraction/font-client-impl.h index aea274c..8cc77ad 100644 --- a/text/dali/internal/text-abstraction/font-client-impl.h +++ b/text/dali/internal/text-abstraction/font-client-impl.h @@ -179,7 +179,7 @@ private: FontClient( const FontClient& ); // Undefined assignment constructor. - FontClient& operator=( FontClient& ); + FontClient& operator=( const FontClient& ); private: diff --git a/text/dali/internal/text-abstraction/font-client-plugin-impl.h b/text/dali/internal/text-abstraction/font-client-plugin-impl.h index d43e350..9f997a2 100644 --- a/text/dali/internal/text-abstraction/font-client-plugin-impl.h +++ b/text/dali/internal/text-abstraction/font-client-plugin-impl.h @@ -442,6 +442,15 @@ private: */ void CacheFontPath( FT_Face ftFace, FontId id, PointSize26Dot6 pointSize, const FontPath& path ); +private: + + // Declared private and left undefined to avoid copies. + Plugin( const Plugin& ); + // Declared private and left undefined to avoid copies. + Plugin& operator=( const Plugin& ); + +private: + FT_Library mFreeTypeLibrary; ///< A handle to a FreeType library instance. unsigned int mDpiHorizontal; ///< Horizontal dpi. diff --git a/text/dali/internal/text-abstraction/shaping-impl.h b/text/dali/internal/text-abstraction/shaping-impl.h index 2944cc7..e528817 100644 --- a/text/dali/internal/text-abstraction/shaping-impl.h +++ b/text/dali/internal/text-abstraction/shaping-impl.h @@ -83,7 +83,7 @@ private: Shaping( const Shaping& ); // Undefined assignment constructor. - Shaping& operator=( Shaping& ); + Shaping& operator=( const Shaping& ); struct Plugin; Plugin* mPlugin; -- 2.7.4